PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
hdd_blkio.h
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#ifndef _HDD_BLKIO_H
12#define _HDD_BLKIO_H
13
14#ifdef APA_USE_ATAD
15#include <atad.h>
16
17#define BLKIO_MAX_VOLUMES 2
18
19#define BLKIO_DIR_READ ATA_DIR_READ
20#define BLKIO_DIR_WRITE ATA_DIR_WRITE
21
22static inline int blkIoInit(void)
23{
24 return 0;
25}
26
27static inline int blkIoDmaTransfer(int device, void *buf, u32 lba, u32 nsectors, int dir)
28{
29 return sceAtaDmaTransfer(device, buf, lba, nsectors, dir);
30}
31
32static inline int blkIoIdle(int device, int period)
33{
34 return sceAtaIdle(device, period);
35}
36
37static inline int blkIoGetSceId(int device, void *data)
38{
39 return sceAtaGetSceId(device, data);
40}
41
42static inline int blkIoSmartReturnStatus(int device)
43{
44 return sceAtaSmartReturnStatus(device);
45}
46
47static inline int blkIoSmartSaveAttr(int device)
48{
49 return sceAtaSmartSaveAttr(device);
50}
51
52static inline int blkIoFlushCache(int device)
53{
54 return sceAtaFlushCache(device);
55}
56
57static inline int blkIoIdleImmediate(int device)
58{
59 return sceAtaIdleImmediate(device);
60}
61#else
62#define BLKIO_MAX_VOLUMES 10
63
64#define BLKIO_DIR_READ 0
65#define BLKIO_DIR_WRITE 1
66
67extern int blkIoInit(void);
68extern int blkIoDmaTransfer(int device, void *buf, u32 lba, u32 nsectors, int dir);
69extern int blkIoIdle(int device, int period);
70extern int blkIoGetSceId(int device, void *data);
71extern int blkIoSmartReturnStatus(int device);
72extern int blkIoSmartSaveAttr(int device);
73extern int blkIoFlushCache(int device);
74extern int blkIoIdleImmediate(int device);
75
76#ifdef APA_USE_IOMANX
77extern int hdd_blkio_vhdd_mount(int slot, const char *filename);
78extern int hdd_blkio_vhdd_umount(int slot);
79#endif
80#endif
81
82#endif /* _HDD_BLKIO_H */