diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-14 21:42:48 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-14 21:42:48 +0000 |
commit | 75f765317b0bce0ad250f665c24c844d775ea4da (patch) | |
tree | 48d9c7472cbe5511c3e8f2f0a7fb4cb369473696 /hw/lsi53c895a.c | |
parent | Fix day of week in mc146818 (diff) | |
download | qemu-kvm-75f765317b0bce0ad250f665c24c844d775ea4da.tar.gz qemu-kvm-75f765317b0bce0ad250f665c24c844d775ea4da.tar.bz2 qemu-kvm-75f765317b0bce0ad250f665c24c844d775ea4da.zip |
LSI53C895A: Introduce CASE_GET_REG24
CASE_GET_REG32 is already defined in lsi53c895a.c; introduce CASE_GET_REG24.
(Sebastian Herbszt)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6311 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/lsi53c895a.c')
-rw-r--r-- | hw/lsi53c895a.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 81d567245..9f50dcbd1 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -1314,6 +1314,11 @@ again: static uint8_t lsi_reg_readb(LSIState *s, int offset) { uint8_t tmp; +#define CASE_GET_REG24(name, addr) \ + case addr: return s->name & 0xff; \ + case addr + 1: return (s->name >> 8) & 0xff; \ + case addr + 2: return (s->name >> 16) & 0xff; + #define CASE_GET_REG32(name, addr) \ case addr: return s->name & 0xff; \ case addr + 1: return (s->name >> 8) & 0xff; \ @@ -1389,12 +1394,7 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset) return s->ctest5; case 0x23: /* CTEST6 */ return 0; - case 0x24: /* DBC[0:7] */ - return s->dbc & 0xff; - case 0x25: /* DBC[8:15] */ - return (s->dbc >> 8) & 0xff; - case 0x26: /* DBC[16->23] */ - return (s->dbc >> 16) & 0xff; + CASE_GET_REG24(dbc, 0x24) case 0x27: /* DCMD */ return s->dcmd; CASE_GET_REG32(dsp, 0x2c) @@ -1477,6 +1477,7 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset) } BADF("readb 0x%x\n", offset); exit(1); +#undef CASE_GET_REG24 #undef CASE_GET_REG32 } |