HW: Make various DMAC/IPU/VIF register types POD

This commit is contained in:
Stenzek 2024-01-08 22:31:43 +10:00 committed by Connor McLaughlin
parent bfe1746ddb
commit 1fedd31229
3 changed files with 21 additions and 4 deletions

View File

@ -83,7 +83,7 @@ union tDMA_TAG {
};
u32 _u32;
tDMA_TAG() {}
tDMA_TAG() = default;
tDMA_TAG(u32 val) { _u32 = val; }
u16 upper() const { return (_u32 >> 16); }
@ -121,6 +121,7 @@ union tDMA_CHCR {
};
u32 _u32;
tDMA_CHCR() = default;
tDMA_CHCR( u32 val) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
@ -143,6 +144,7 @@ union tDMA_SADR {
};
u32 _u32;
tDMA_SADR() = default;
tDMA_SADR(u32 val) { _u32 = val; }
void reset() { _u32 = 0; }
@ -156,6 +158,7 @@ union tDMA_QWC {
};
u32 _u32;
tDMA_QWC() = default;
tDMA_QWC(u32 val) { _u32 = val; }
void reset() { _u32 = 0; }
@ -264,6 +267,7 @@ union tDMAC_QUEUE
};
u16 _u16;
tDMAC_QUEUE() = default;
tDMAC_QUEUE(u16 val) { _u16 = val; }
void reset() { _u16 = 0; }
bool empty() const { return (_u16 == 0); }
@ -322,6 +326,7 @@ union tDMAC_CTRL {
};
u32 _u32;
tDMAC_CTRL() = default;
tDMAC_CTRL(u32 val) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
@ -348,6 +353,7 @@ union tDMAC_STAT {
u32 _u32;
u16 _u16[2];
tDMAC_STAT() = default;
tDMAC_STAT(u32 val) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
@ -372,6 +378,7 @@ union tDMAC_PCR {
};
u32 _u32;
tDMAC_PCR() = default;
tDMAC_PCR(u32 val) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
@ -390,6 +397,7 @@ union tDMAC_SQWC {
};
u32 _u32;
tDMAC_SQWC() = default;
tDMAC_SQWC(u32 val) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
@ -406,6 +414,7 @@ union tDMAC_RBSR {
};
u32 _u32;
tDMAC_RBSR() = default;
tDMAC_RBSR(u32 val) { _u32 = val; }
void reset() { _u32 = 0; }
@ -419,6 +428,7 @@ union tDMAC_RBOR {
};
u32 _u32;
tDMAC_RBOR() = default;
tDMAC_RBOR(u32 val) { _u32 = val; }
void reset() { _u32 = 0; }
@ -440,7 +450,7 @@ union tDMAC_ADDR
};
u32 _u32;
tDMAC_ADDR() {}
tDMAC_ADDR() = default;
tDMAC_ADDR(u32 val) { _u32 = val; }
void clear() { _u32 = 0; }
@ -490,6 +500,7 @@ union tINTC_STAT {
};
u32 _u32;
tINTC_STAT() = default;
tINTC_STAT(u32 val) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
@ -506,6 +517,7 @@ union tINTC_MASK {
};
u32 _u32;
tINTC_MASK() = default;
tINTC_MASK(u32 val) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }

View File

@ -52,6 +52,7 @@ union tIPU_CTRL {
};
u32 _u32;
tIPU_CTRL() = default;
tIPU_CTRL( u32 val ) { _u32 = val; }
// CTRL = the first 16 bits of ctrl [0x8000ffff], + value for the next 16 bits,
@ -153,6 +154,7 @@ union tIPU_CMD_IDEC
u32 _u32;
tIPU_CMD_IDEC() = default;
tIPU_CMD_IDEC( u32 val ) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
@ -177,6 +179,7 @@ union tIPU_CMD_BDEC
};
u32 _u32;
tIPU_CMD_BDEC() = default;
tIPU_CMD_BDEC( u32 val ) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
@ -198,6 +201,7 @@ union tIPU_CMD_CSC
};
u32 _u32;
tIPU_CMD_CSC() = default;
tIPU_CMD_CSC( u32 val ){ _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }

View File

@ -102,7 +102,7 @@ union tVIF_STAT {
};
u32 _u32;
tVIF_STAT() {}
tVIF_STAT() = default;
tVIF_STAT(u32 val) { _u32 = val; }
bool test(u32 flags) const { return !!(_u32 & flags); }
void set_flags (u32 flags) { _u32 |= flags; }
@ -123,6 +123,7 @@ union tVIF_FBRST {
};
u32 _u32;
tVIF_FBRST() = default;
tVIF_FBRST(u32 val) { _u32 = val; }
bool test (u32 flags) const { return !!(_u32 & flags); }
void set_flags (u32 flags) { _u32 |= flags; }
@ -142,7 +143,7 @@ union tVIF_ERR {
};
u32 _u32;
tVIF_ERR() {}
tVIF_ERR() = default;
tVIF_ERR (u32 val) { _u32 = val; }
void write(u32 val) { _u32 = val; }
bool test (u32 flags) const { return !!(_u32 & flags); }