sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
hdd_blkio.h
Go to the documentation of this file.
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
15#ifndef _HDD_BLKIO_H
16#define _HDD_BLKIO_H
17
18#ifdef APA_USE_ATAD
19#include <atad.h>
20
21#define BLKIO_MAX_VOLUMES 2
22
23#define BLKIO_DIR_READ ATA_DIR_READ
24#define BLKIO_DIR_WRITE ATA_DIR_WRITE
25
26static inline int blkIoInit(void)
27{
28 return 0;
29}
30
31static inline int blkIoDmaTransfer(int device, void *buf, u32 lba, u32 nsectors, int dir)
32{
33 return sceAtaDmaTransfer(device, buf, lba, nsectors, dir);
34}
35
36static inline int blkIoIdle(int device, int period)
37{
38 return sceAtaIdle(device, period);
39}
40
41static inline int blkIoGetSceId(int device, void *data)
42{
43 return sceAtaGetSceId(device, data);
44}
45
46static inline int blkIoSmartReturnStatus(int device)
47{
48 return sceAtaSmartReturnStatus(device);
49}
50
51static inline int blkIoSmartSaveAttr(int device)
52{
53 return sceAtaSmartSaveAttr(device);
54}
55
56static inline int blkIoFlushCache(int device)
57{
58 return sceAtaFlushCache(device);
59}
60
61static inline int blkIoIdleImmediate(int device)
62{
63 return sceAtaIdleImmediate(device);
64}
65#else
66#define BLKIO_MAX_VOLUMES 10
67
68#define BLKIO_DIR_READ 0
69#define BLKIO_DIR_WRITE 1
70
71extern int blkIoInit(void);
72extern int blkIoDmaTransfer(int device, void *buf, u32 lba, u32 nsectors, int dir);
73extern int blkIoIdle(int device, int period);
74extern int blkIoGetSceId(int device, void *data);
75extern int blkIoSmartReturnStatus(int device);
76extern int blkIoSmartSaveAttr(int device);
77extern int blkIoFlushCache(int device);
78extern int blkIoIdleImmediate(int device);
79
80#ifdef APA_USE_IOMANX
81extern int hdd_blkio_vhdd_mount(int slot, const char *filename);
82extern int hdd_blkio_vhdd_umount(int slot);
83#endif
84#endif
85
86#endif /* _HDD_BLKIO_H */