-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdmac.h
More file actions
108 lines (94 loc) · 2.48 KB
/
dmac.h
File metadata and controls
108 lines (94 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/* Copyright (C) 2000,2001,2002 Sony Computer Entertainment America
This file is subject to the terms and conditions of the GNU Lesser
General Public License Version 2.1. See the file "COPYING" in the
main directory of this archive for more details. */
#ifndef ps2s_dmac_h
#define ps2s_dmac_h
// PLIN
#include "ps2s/types.h"
/********************************************
* typedefs
*/
// PLIN
typedef struct tD_CHCR_t {
unsigned DIR : 1; // Direction
unsigned p0 : 1;
unsigned MOD : 2; // Mode
unsigned ASP : 2; // Address stack pointer
unsigned TTE : 1; // Tag trasfer enable
unsigned TIE : 1; // Tag interrupt enable
unsigned STR : 1; // start
unsigned p1 : 7;
unsigned TAG : 16; // DMAtag
} tD_CHCR;
typedef struct tSourceChainTag_t {
uint64_t QWC : 16;
uint64_t pad : 10;
uint64_t PCE : 2;
uint64_t ID : 3;
uint64_t IRQ : 1;
uint64_t ADDR : 31;
uint64_t SPR : 1;
uint32_t opt1;
uint32_t opt2;
} __attribute__((packed,aligned(16))) tSourceChainTag;
typedef tSourceChainTag tDmaTag;
typedef struct {
tD_CHCR chcr;
unsigned int p0[3]; // channel control
void* madr;
unsigned int p1[3]; // memory address
unsigned int qwc;
unsigned int p2[3]; // transfer count
tDmaTag* tadr;
unsigned int p3[3]; // tag address
void* as0;
unsigned int p4[3]; // address stack
void* as1;
unsigned int p5[3]; // address stack
unsigned int p6[4]; // pad
unsigned int p7[4]; // pad
void* sadr;
unsigned int p8[3]; // spr address
} tDmaChannel;
/********************************************
* DMAC
*/
namespace DMAC {
namespace Channels {
enum eChannels { vif0,
vif1,
gif,
fromIpu,
toIpu,
sif0,
sif1,
sif2,
fromSpr,
toSpr };
}
enum { kRefe,
kCnt,
kNext,
kRef,
kRefs,
kCall,
kRet,
kEnd };
/*
namespace ChannelPtrs {
const volatile tDmaChannel *vif0 = (volatile tDmaChannel*)D0_CHCR,
*vif1 = (volatile tDmaChannel*)D1_CHCR,
*gif = (volatile tDmaChannel*)D2_CHCR,
*fromIpu = (volatile tDmaChannel*)D3_CHCR,
*toIpu = (volatile tDmaChannel*)D4_CHCR,
*sif0 = (volatile tDmaChannel*)D5_CHCR,
*sif1 = (volatile tDmaChannel*)D6_CHCR,
*sif2 = (volatile tDmaChannel*)D7_CHCR,
*fromSpr = (volatile tDmaChannel*)D8_CHCR,
*toSpr = (volatile tDmaChannel*)D9_CHCR;
}
*/
}
typedef DMAC::Channels::eChannels tDmaChannelId;
#endif // ps2s_dmac_h