Skip to content

Commit 13d9abf

Browse files
committed
vjag_memory.h add more struct definitions
Signed-off-by: Joseph Mattello <[email protected]>
1 parent 8a0a2df commit 13d9abf

1 file changed

Lines changed: 74 additions & 7 deletions

File tree

src/vjag_memory.h

Lines changed: 74 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,34 @@
1313
extern "C" {
1414
#endif
1515

16+
#pragma pack(push, 1)
17+
typedef union Bits64 {
18+
uint64_t DATA;
19+
struct Bytes8 {
20+
#ifdef LITTLE_ENDIAN
21+
uint8_t b0;
22+
uint8_t b1;
23+
uint8_t b2;
24+
uint8_t b3;
25+
uint8_t b4;
26+
uint8_t b5;
27+
uint8_t b6;
28+
uint8_t b7;
29+
#else
30+
uint8_t b7;
31+
uint8_t b6;
32+
uint8_t b5;
33+
uint8_t b4;
34+
uint8_t b3;
35+
uint8_t b2;
36+
uint8_t b1;
37+
uint8_t b0;
38+
#endif
39+
} bytes;
40+
} Bits64;
41+
#pragma pack(pop)
42+
43+
#pragma pack(push, 1)
1644
typedef union Bits32 {
1745
uint32_t WORD;
1846
struct Words {
@@ -23,8 +51,30 @@ typedef union Bits32 {
2351
uint16_t UWORD;
2452
uint16_t LWORD;
2553
#endif
26-
} Words;
27-
struct bits {
54+
} words;
55+
struct Bytes4 {
56+
#ifdef LITTLE_ENDIAN
57+
uint8_t LL;
58+
uint8_t LU;
59+
uint8_t UL;
60+
uint8_t UU; // Upper upper [UU, UL, LU, LL]
61+
#else
62+
uint8_t UU; // Upper upper [UU, UL, LU, LL]
63+
uint8_t UL;
64+
uint8_t LU;
65+
uint8_t LL;
66+
#endif
67+
} bytes;
68+
struct TopThreeOne {
69+
#ifdef LITTLE_ENDIAN
70+
unsigned int : 1;
71+
uint32_t value : 31;
72+
#else
73+
uint32_t value : 31;
74+
unsigned int : 1;
75+
#endif
76+
} topThreeOne;
77+
struct Bits {
2878
#ifdef LITTLE_ENDIAN
2979
unsigned int b0: 1;
3080
unsigned int b1: 1;
@@ -95,12 +145,32 @@ typedef union Bits32 {
95145
#endif
96146
} bits;
97147
} Bits32;
148+
#pragma pack(pop)
149+
150+
#pragma pack(push, 1)
151+
typedef union GPUControl {
152+
uint32_t WORD;
153+
struct Words words;
154+
struct Bits bits;
155+
struct __attribute__ ((__packed__)) {
156+
#ifdef LITTLE_ENDIAN
157+
unsigned int : 6;
158+
unsigned int irqMask: 5;
159+
unsigned int : 21;
160+
#else
161+
unsigned int : 21;
162+
unsigned int irqMask: 5;
163+
unsigned int : 6;
164+
#endif
165+
} gpuIRQ;
166+
#pragma pack(pop)
167+
168+
} GPUControl;
98169

99-
#ifdef USE_STRUCTS
100170
#pragma pack(push, 1)
101171
typedef union OpCode {
102172
uint16_t WORD;
103-
struct Bytes {
173+
struct Bytes2 {
104174
#ifdef LITTLE_ENDIAN
105175
uint8_t LBYTE;
106176
uint8_t UBYTE;
@@ -124,9 +194,7 @@ typedef union Bits32 {
124194
#pragma pack(pop)
125195

126196
typedef OpCode U16Union;
127-
#endif //USE_STRUCTS
128197

129-
#ifdef USE_STRUCTS
130198
typedef union Offset {
131199
uint32_t LONG;
132200
#pragma pack(push, 1)
@@ -141,7 +209,6 @@ typedef union Offset {
141209
} Members;
142210
#pragma pack(pop)
143211
} Offset;
144-
#endif //USE_STRUCTS
145212

146213
typedef union DSPLong {
147214
uint32_t LONG;

0 commit comments

Comments
 (0)