mgh: fix for default HDD DMA mode, that wasn't correctly set
[open-ps2-loader.git] / modules / mcemu / mcemu_utils.h
blob4202839049342fa4a144c1a5cde166c0750243c6
1 /*
2 Copyright 2006-2008, Romz
3 Copyright 2010, Polo
4 Licenced under Academic Free License version 3.0
5 Review OpenUsbLd README & LICENSE files for further details.
6 */
8 #ifndef __MCEMU_UTILS_H
9 #define __MCEMU_UTILS_H
11 #include <irx.h>
13 typedef struct {
14 int version;
15 void **exports;
16 } modinfo_t;
18 /* SMS Utils Imports */
19 #define smsutils_IMPORTS_start DECLARE_IMPORT_TABLE( smsutils, 1, 1 )
21 void mips_memcpy ( void*, const void*, unsigned );
22 #define I_mips_memcpy DECLARE_IMPORT( 4, mips_memcpy )
24 void mips_memset ( void*, int, unsigned );
25 #define I_mips_memset DECLARE_IMPORT( 5, mips_memset )
27 #define smsutils_IMPORTS_end END_IMPORT_TABLE
30 #define oplutils_IMPORTS_start DECLARE_IMPORT_TABLE( oplutils, 1, 1 )
32 int getModInfo(u8 *modname, modinfo_t *info);
33 #define I_getModInfo DECLARE_IMPORT(4, getModInfo)
35 /* MASS Transfer Imports */
36 #ifdef USB_DRIVER
38 int mass_stor_readSector(unsigned int lba, int nsectors, unsigned char* buffer);
39 #define I_mass_stor_readSector DECLARE_IMPORT(5, mass_stor_readSector)
41 int mass_stor_writeSector(unsigned int lba, int nsectors, unsigned char* buffer);
42 #define I_mass_stor_writeSector DECLARE_IMPORT(6, mass_stor_writeSector)
44 #endif
46 /* ATAD Transfer Imports */
47 #ifdef HDD_DRIVER
49 /* These are used with the dir parameter of ata_device_dma_transfer(). */
50 #define ATA_DIR_READ 0
51 #define ATA_DIR_WRITE 1
53 int ata_device_dma_transfer( unsigned int unit, void *buf, unsigned int lba, unsigned int sectors, int dir);
54 #define I_ata_device_dma_transfer DECLARE_IMPORT(5, ata_device_dma_transfer)
56 #endif
58 /* SMB Transfer Imports */
59 #ifdef SMB_DRIVER
61 int smb_OpenAndX(char *filename, u16 *FID, int Write);
62 #define I_smb_OpenAndX DECLARE_IMPORT(5, smb_OpenAndX)
64 int smb_ReadFile(u16 FID, u32 offsetlow, u32 offsethigh, void *readbuf, u16 nbytes);
65 #define I_smb_ReadFile DECLARE_IMPORT(6, smb_ReadFile)
67 int smb_WriteFile(u16 FID, u32 offsetlow, u32 offsethigh, void *writebuf, u16 nbytes);
68 #define I_smb_WriteFile DECLARE_IMPORT(7, smb_WriteFile)
70 #endif
72 #define oplutils_IMPORTS_end END_IMPORT_TABLE
74 #endif /* __MCEMU_UTILS_H */