PS2SDK
PS2 Homebrew Libraries
accore.h
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 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 _ACCORE_H
12 #define _ACCORE_H
13 
14 #include <irx.h>
15 #include <tamtypes.h>
16 
17 typedef s8 acInt8;
18 typedef u8 acUint8;
19 typedef s16 acInt16;
20 typedef u16 acUint16;
21 typedef s32 acInt32;
22 typedef u32 acUint32;
23 typedef s64 acInt64;
24 typedef u64 acUint64;
25 
26 typedef int acSpl;
27 
28 typedef enum ac_dma_state
29 {
30  AC_DMA_STATE_FREE = 0x0,
31  AC_DMA_STATE_QUEUE = 0x1,
32  AC_DMA_STATE_READY = 0x2,
33  AC_DMA_STATE_XFER = 0x3,
34 } acDmaState;
35 
36 typedef struct ac_dma acDmaData;
37 typedef acDmaData *acDmaT;
38 
39 typedef int (*acDmaOp)(acDmaT dma, void *ioptr, void *buf, int count);
40 
41 typedef struct ac_dma_ops
42 {
43  int (*do_xfer)(acDmaT dma, int intr, acDmaOp op);
44  void (*do_done)(acDmaT dma);
45  void (*do_error)(acDmaT dma, int intr, acDmaState state, int result);
46 } acDmaOpsData;
47 typedef acDmaOpsData *acDmaOpsT;
48 
49 typedef struct ac_queue acQueueData;
50 typedef acQueueData *acQueueT;
51 
52 struct ac_queue
53 {
54  acQueueT q_prev;
55  acQueueT q_next;
56 };
57 
60 
61 struct ac_dma
62 {
63  acQueueChainData d_chain;
64  acDmaOpsT d_ops;
65  acUint16 d_slice;
66  acUint8 d_attr;
67  acUint8 d_state;
68 };
69 
70 typedef enum ac_intr_num
71 {
72  AC_INTR_NUM_ATA = 0x0,
73  AC_INTR_NUM_JV = 0x1,
74  AC_INTR_NUM_UART = 0x2,
75  AC_INTR_NUM_LAST = 0x2,
76 } acIntrNum;
77 
78 typedef int (*acIntrHandler)(void *arg);
79 
80 typedef volatile acUint16 *acC448Reg;
81 
82 extern int acDmaModuleRestart(int argc, char **argv);
83 extern int acDmaModuleStart(int argc, char **argv);
84 extern int acDmaModuleStatus();
85 extern int acDmaModuleStop();
86 extern acDmaT acDmaSetup(acDmaData *dma, acDmaOpsData *ops, int priority, int slice, int output);
87 extern int acDmaRequest(acDmaT dma);
88 extern int acDmaRequestI(acDmaT dma);
89 extern int acDmaCancel(acDmaT dma, int result);
90 extern int acDmaCancelI(acDmaT dma, int result);
91 extern int acIntrModuleRestart(int argc, char **argv);
92 extern int acIntrModuleStart(int argc, char **argv);
93 extern int acIntrModuleStatus();
94 extern int acIntrModuleStop();
95 extern int acIntrRegister(acIntrNum inum, acIntrHandler func, void *arg);
96 extern int acIntrRelease(acIntrNum inum);
97 extern int acIntrEnable(acIntrNum inum);
98 extern int acIntrDisable(acIntrNum inum);
99 extern int acIntrClear(acIntrNum inum);
100 
101 #define accore_IMPORTS_start DECLARE_IMPORT_TABLE(accore, 1, 1)
102 #define accore_IMPORTS_end END_IMPORT_TABLE
103 
104 #define I_acDmaModuleRestart DECLARE_IMPORT(4, acDmaModuleRestart)
105 #define I_acDmaModuleStart DECLARE_IMPORT(5, acDmaModuleStart)
106 #define I_acDmaModuleStatus DECLARE_IMPORT(6, acDmaModuleStatus)
107 #define I_acDmaModuleStop DECLARE_IMPORT(7, acDmaModuleStop)
108 #define I_acDmaSetup DECLARE_IMPORT(8, acDmaSetup)
109 #define I_acDmaRequest DECLARE_IMPORT(9, acDmaRequest)
110 #define I_acDmaRequestI DECLARE_IMPORT(10, acDmaRequestI)
111 #define I_acDmaCancel DECLARE_IMPORT(11, acDmaCancel)
112 #define I_acDmaCancelI DECLARE_IMPORT(12, acDmaCancelI)
113 #define I_acIntrModuleRestart DECLARE_IMPORT(13, acIntrModuleRestart)
114 #define I_acIntrModuleStart DECLARE_IMPORT(14, acIntrModuleStart)
115 #define I_acIntrModuleStatus DECLARE_IMPORT(15, acIntrModuleStatus)
116 #define I_acIntrModuleStop DECLARE_IMPORT(16, acIntrModuleStop)
117 #define I_acIntrRegister DECLARE_IMPORT(17, acIntrRegister)
118 #define I_acIntrRelease DECLARE_IMPORT(18, acIntrRelease)
119 #define I_acIntrEnable DECLARE_IMPORT(19, acIntrEnable)
120 #define I_acIntrDisable DECLARE_IMPORT(20, acIntrDisable)
121 #define I_acIntrClear DECLARE_IMPORT(21, acIntrClear)
122 
123 #endif
ac_dma
Definition: accore.h:61
ac_queue
Definition: accore.h:52
count
u32 count
start sector of fragmented bd/file
Definition: usbhdfsd-common.h:3
irx.h
tamtypes.h
ac_dma_ops
Definition: accore.h:41