Commit 75f765317b0bce0ad250f665c24c844d775ea4da
1 parent
6f1bf24d
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
Showing
1 changed file
with
7 additions
and
6 deletions
hw/lsi53c895a.c
... | ... | @@ -1314,6 +1314,11 @@ again: |
1314 | 1314 | static uint8_t lsi_reg_readb(LSIState *s, int offset) |
1315 | 1315 | { |
1316 | 1316 | uint8_t tmp; |
1317 | +#define CASE_GET_REG24(name, addr) \ | |
1318 | + case addr: return s->name & 0xff; \ | |
1319 | + case addr + 1: return (s->name >> 8) & 0xff; \ | |
1320 | + case addr + 2: return (s->name >> 16) & 0xff; | |
1321 | + | |
1317 | 1322 | #define CASE_GET_REG32(name, addr) \ |
1318 | 1323 | case addr: return s->name & 0xff; \ |
1319 | 1324 | case addr + 1: return (s->name >> 8) & 0xff; \ |
... | ... | @@ -1389,12 +1394,7 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset) |
1389 | 1394 | return s->ctest5; |
1390 | 1395 | case 0x23: /* CTEST6 */ |
1391 | 1396 | return 0; |
1392 | - case 0x24: /* DBC[0:7] */ | |
1393 | - return s->dbc & 0xff; | |
1394 | - case 0x25: /* DBC[8:15] */ | |
1395 | - return (s->dbc >> 8) & 0xff; | |
1396 | - case 0x26: /* DBC[16->23] */ | |
1397 | - return (s->dbc >> 16) & 0xff; | |
1397 | + CASE_GET_REG24(dbc, 0x24) | |
1398 | 1398 | case 0x27: /* DCMD */ |
1399 | 1399 | return s->dcmd; |
1400 | 1400 | CASE_GET_REG32(dsp, 0x2c) |
... | ... | @@ -1477,6 +1477,7 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset) |
1477 | 1477 | } |
1478 | 1478 | BADF("readb 0x%x\n", offset); |
1479 | 1479 | exit(1); |
1480 | +#undef CASE_GET_REG24 | |
1480 | 1481 | #undef CASE_GET_REG32 |
1481 | 1482 | } |
1482 | 1483 | ... | ... |