PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
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
17typedef s8 acInt8;
18typedef u8 acUint8;
19typedef s16 acInt16;
20typedef u16 acUint16;
21typedef s32 acInt32;
22typedef u32 acUint32;
23typedef s64 acInt64;
24typedef u64 acUint64;
25
26typedef int acSpl;
27
28typedef 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
36typedef struct ac_dma acDmaData;
37typedef acDmaData *acDmaT;
38
39typedef int (*acDmaOp)(acDmaT dma, void *ioptr, void *buf, int count);
40
41typedef 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);
47typedef acDmaOpsData *acDmaOpsT;
48
49typedef struct ac_queue acQueueData;
50typedef acQueueData *acQueueT;
51
53{
54 acQueueT q_prev;
55 acQueueT q_next;
56};
57
60
61struct 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
70typedef 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
78typedef int (*acIntrHandler)(void *arg);
79
80typedef volatile acUint16 *acC448Reg;
81
82extern int acDmaModuleRestart(int argc, char **argv);
83extern int acDmaModuleStart(int argc, char **argv);
84extern int acDmaModuleStatus();
85extern int acDmaModuleStop();
86extern acDmaT acDmaSetup(acDmaData *dma, acDmaOpsData *ops, int priority, int slice, int output);
87extern int acDmaRequest(acDmaT dma);
88extern int acDmaRequestI(acDmaT dma);
89extern int acDmaCancel(acDmaT dma, int result);
90extern int acDmaCancelI(acDmaT dma, int result);
91extern int acIntrModuleRestart(int argc, char **argv);
92extern int acIntrModuleStart(int argc, char **argv);
93extern int acIntrModuleStatus();
94extern int acIntrModuleStop();
95extern int acIntrRegister(acIntrNum inum, acIntrHandler func, void *arg);
96extern int acIntrRelease(acIntrNum inum);
97extern int acIntrEnable(acIntrNum inum);
98extern int acIntrDisable(acIntrNum inum);
99extern 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
u32 count
start sector of fragmented bd/file