qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] LSI53C895A: Introduce CASE_GET_REG24
@ 2009-01-03 19:03 Sebastian Herbszt
  2009-01-14 21:42 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Herbszt @ 2009-01-03 19:03 UTC (permalink / raw)
  To: qemu-devel

CASE_GET_REG32 is already defined in lsi53c895a.c; introduce CASE_GET_REG24.

- Sebastian

--- qemu-r6133/hw/lsi53c895a.c.bak Sat Dec 27 16:18:23 2008
+++ qemu-r6133/hw/lsi53c895a.c Sat Jan  3 18:51:59 2009
@@ -1316,6 +1316,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; \
@@ -1391,12 +1396,7 @@ static uint8_t lsi_reg_readb(LSIState *s
         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)
@@ -1481,6 +1481,7 @@ static uint8_t lsi_reg_readb(LSIState *s
     }
     BADF("readb 0x%x\n", offset);
     exit(1);
+#undef CASE_GET_REG24
 #undef CASE_GET_REG32
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] LSI53C895A: Introduce CASE_GET_REG24
  2009-01-03 19:03 [Qemu-devel] [PATCH] LSI53C895A: Introduce CASE_GET_REG24 Sebastian Herbszt
@ 2009-01-14 21:42 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2009-01-14 21:42 UTC (permalink / raw)
  To: qemu-devel

On Sat, Jan 03, 2009 at 08:03:18PM +0100, Sebastian Herbszt wrote:
> CASE_GET_REG32 is already defined in lsi53c895a.c; introduce CASE_GET_REG24.

Thanks, applied.

> - Sebastian
>
> --- qemu-r6133/hw/lsi53c895a.c.bak Sat Dec 27 16:18:23 2008
> +++ qemu-r6133/hw/lsi53c895a.c Sat Jan  3 18:51:59 2009
> @@ -1316,6 +1316,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; \
> @@ -1391,12 +1396,7 @@ static uint8_t lsi_reg_readb(LSIState *s
>         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)
> @@ -1481,6 +1481,7 @@ static uint8_t lsi_reg_readb(LSIState *s
>     }
>     BADF("readb 0x%x\n", offset);
>     exit(1);
> +#undef CASE_GET_REG24
> #undef CASE_GET_REG32
> }
>
>
>
>
>

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-14 21:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-03 19:03 [Qemu-devel] [PATCH] LSI53C895A: Introduce CASE_GET_REG24 Sebastian Herbszt
2009-01-14 21:42 ` Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).