PS2SDK
PS2 Homebrew Libraries
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 
22 static inline int blkIoInit(void)
23 {
24  return 0;
25 }
26 
27 static inline int blkIoDmaTransfer(int device, void *buf, u32 lba, u32 nsectors, int dir)
28 {
29  return sceAtaDmaTransfer(device, buf, lba, nsectors, dir);
30 }
31 
32 static inline int blkIoIdle(int device, int period)
33 {
34  return sceAtaIdle(device, period);
35 }
36 
37 static inline int blkIoGetSceId(int device, void *data)
38 {
39  return sceAtaGetSceId(device, data);
40 }
41 
42 static inline int blkIoSmartReturnStatus(int device)
43 {
44  return sceAtaSmartReturnStatus(device);
45 }
46 
47 static inline int blkIoSmartSaveAttr(int device)
48 {
49  return sceAtaSmartSaveAttr(device);
50 }
51 
52 static inline int blkIoFlushCache(int device)
53 {
54  return sceAtaFlushCache(device);
55 }
56 
57 static 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 
67 extern int blkIoInit(void);
68 extern int blkIoDmaTransfer(int device, void *buf, u32 lba, u32 nsectors, int dir);
69 extern int blkIoIdle(int device, int period);
70 extern int blkIoGetSceId(int device, void *data);
71 extern int blkIoSmartReturnStatus(int device);
72 extern int blkIoSmartSaveAttr(int device);
73 extern int blkIoFlushCache(int device);
74 extern int blkIoIdleImmediate(int device);
75 
76 #ifdef APA_USE_IOMANX
77 extern int hdd_blkio_vhdd_mount(int slot, const char *filename);
78 extern int hdd_blkio_vhdd_umount(int slot);
79 #endif
80 #endif
81 
82 #endif /* _HDD_BLKIO_H */
atad.h