[PATCH 38/44] xfree86: Switch int10 code to stdint types

Keith Packard keithp at keithp.com
Wed Dec 11 12:24:10 PST 2013


CARD32 is not type compatible with uint32_t and ends up generating a
pile of warnings. Fix this by replacing all of the CARD* types with
stdint types.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xfree86/int10/generic.c     |  40 +++++-----
 hw/xfree86/int10/helper_exec.c | 166 ++++++++++++++++++++---------------------
 hw/xfree86/int10/xf86int10.h   |  72 +++++++++---------
 hw/xfree86/int10/xf86x86emu.c  |  12 +--
 4 files changed, 145 insertions(+), 145 deletions(-)

diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index d7594de..41e348c 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -20,12 +20,12 @@
 
 #define ALLOC_ENTRIES(x) ((V_RAM / x) - 1)
 
-static CARD8 read_b(xf86Int10InfoPtr pInt, int addr);
-static CARD16 read_w(xf86Int10InfoPtr pInt, int addr);
-static CARD32 read_l(xf86Int10InfoPtr pInt, int addr);
-static void write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val);
-static void write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val);
-static void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val);
+static uint8_t read_b(xf86Int10InfoPtr pInt, int addr);
+static uint16_t read_w(xf86Int10InfoPtr pInt, int addr);
+static uint32_t read_l(xf86Int10InfoPtr pInt, int addr);
+static void write_b(xf86Int10InfoPtr pInt, int addr, uint8_t val);
+static void write_w(xf86Int10InfoPtr pInt, int addr, uint16_t val);
+static void write_l(xf86Int10InfoPtr pInt, int addr, uint32_t val);
 
 /*
  * the emulator cannot pass a pointer to the current xf86Int10InfoRec
@@ -339,39 +339,39 @@ xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
 
 #define VRAM(addr) ((addr >= V_RAM) && (addr < (V_RAM + VRAM_SIZE)))
 #define V_ADDR_RB(addr) \
-	(VRAM(addr)) ? MMIO_IN8((CARD8*)VRAM_BASE,VRAM_ADDR(addr)) \
-	   : *(CARD8*) V_ADDR(addr)
+	(VRAM(addr)) ? MMIO_IN8((uint8_t*)VRAM_BASE,VRAM_ADDR(addr)) \
+	   : *(uint8_t*) V_ADDR(addr)
 #define V_ADDR_RW(addr) \
-	(VRAM(addr)) ? MMIO_IN16((CARD16*)VRAM_BASE,VRAM_ADDR(addr)) \
+	(VRAM(addr)) ? MMIO_IN16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr)) \
 	   : ldw_u((pointer)V_ADDR(addr))
 #define V_ADDR_RL(addr) \
-	(VRAM(addr)) ? MMIO_IN32((CARD32*)VRAM_BASE,VRAM_ADDR(addr)) \
+	(VRAM(addr)) ? MMIO_IN32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr)) \
 	   : ldl_u((pointer)V_ADDR(addr))
 
 #define V_ADDR_WB(addr,val) \
 	if(VRAM(addr)) \
-	    MMIO_OUT8((CARD8*)VRAM_BASE,VRAM_ADDR(addr),val); \
+	    MMIO_OUT8((uint8_t*)VRAM_BASE,VRAM_ADDR(addr),val); \
 	else \
-	    *(CARD8*) V_ADDR(addr) = val;
+	    *(uint8_t*) V_ADDR(addr) = val;
 #define V_ADDR_WW(addr,val) \
 	if(VRAM(addr)) \
-	    MMIO_OUT16((CARD16*)VRAM_BASE,VRAM_ADDR(addr),val); \
+	    MMIO_OUT16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr),val); \
 	else \
 	    stw_u((val),(pointer)(V_ADDR(addr)));
 
 #define V_ADDR_WL(addr,val) \
 	if (VRAM(addr)) \
-	    MMIO_OUT32((CARD32*)VRAM_BASE,VRAM_ADDR(addr),val); \
+	    MMIO_OUT32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr),val); \
 	else \
 	    stl_u(val,(pointer)(V_ADDR(addr)));
 
-static CARD8
+static uint8_t
 read_b(xf86Int10InfoPtr pInt, int addr)
 {
     return V_ADDR_RB(addr);
 }
 
-static CARD16
+static uint16_t
 read_w(xf86Int10InfoPtr pInt, int addr)
 {
 #if X_BYTE_ORDER == X_LITTLE_ENDIAN
@@ -381,7 +381,7 @@ read_w(xf86Int10InfoPtr pInt, int addr)
     return V_ADDR_RB(addr) | (V_ADDR_RB(addr + 1) << 8);
 }
 
-static CARD32
+static uint32_t
 read_l(xf86Int10InfoPtr pInt, int addr)
 {
 #if X_BYTE_ORDER == X_LITTLE_ENDIAN
@@ -394,7 +394,7 @@ read_l(xf86Int10InfoPtr pInt, int addr)
 }
 
 static void
-write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val)
+write_b(xf86Int10InfoPtr pInt, int addr, uint8_t val)
 {
     V_ADDR_WB(addr, val);
 }
@@ -412,7 +412,7 @@ write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val)
 }
 
 static void
-write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
+write_l(xf86Int10InfoPtr pInt, int addr, uint32_t val)
 {
 #if X_BYTE_ORDER == X_LITTLE_ENDIAN
     if (OFF(addr + 3) > 2) {
@@ -426,7 +426,7 @@ write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
 }
 
 pointer
-xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
+xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr)
 {
     return V_ADDR(addr);
 }
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index 925da3c..6a83f42 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -37,12 +37,12 @@
 #endif
 #include <pciaccess.h>
 
-static int pciCfg1in(CARD16 addr, CARD32 *val);
-static int pciCfg1out(CARD16 addr, CARD32 val);
-static int pciCfg1inw(CARD16 addr, CARD16 *val);
-static int pciCfg1outw(CARD16 addr, CARD16 val);
-static int pciCfg1inb(CARD16 addr, CARD8 *val);
-static int pciCfg1outb(CARD16 addr, CARD8 val);
+static int pciCfg1in(uint16_t addr, uint32_t *val);
+static int pciCfg1out(uint16_t addr, uint32_t val);
+static int pciCfg1inw(uint16_t addr, uint16_t *val);
+static int pciCfg1outw(uint16_t addr, uint16_t val);
+static int pciCfg1inb(uint16_t addr, uint8_t *val);
+static int pciCfg1outb(uint16_t addr, uint8_t val);
 
 #if defined (_PC)
 static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set);
@@ -58,13 +58,13 @@ setup_int(xf86Int10InfoPtr pInt)
             return -1;
         Int10Current = pInt;
     }
-    X86_EAX = (CARD32) pInt->ax;
-    X86_EBX = (CARD32) pInt->bx;
-    X86_ECX = (CARD32) pInt->cx;
-    X86_EDX = (CARD32) pInt->dx;
-    X86_ESI = (CARD32) pInt->si;
-    X86_EDI = (CARD32) pInt->di;
-    X86_EBP = (CARD32) pInt->bp;
+    X86_EAX = (uint32_t) pInt->ax;
+    X86_EBX = (uint32_t) pInt->bx;
+    X86_ECX = (uint32_t) pInt->cx;
+    X86_EDX = (uint32_t) pInt->dx;
+    X86_ESI = (uint32_t) pInt->si;
+    X86_EDI = (uint32_t) pInt->di;
+    X86_EBP = (uint32_t) pInt->bp;
     X86_ESP = 0x1000;
     X86_SS = pInt->stackseg >> 4;
     X86_EIP = 0x0600;
@@ -86,15 +86,15 @@ void
 finish_int(xf86Int10InfoPtr pInt, int sig)
 {
     OsReleaseSignals();
-    pInt->ax = (CARD32) X86_EAX;
-    pInt->bx = (CARD32) X86_EBX;
-    pInt->cx = (CARD32) X86_ECX;
-    pInt->dx = (CARD32) X86_EDX;
-    pInt->si = (CARD32) X86_ESI;
-    pInt->di = (CARD32) X86_EDI;
-    pInt->es = (CARD16) X86_ES;
-    pInt->bp = (CARD32) X86_EBP;
-    pInt->flags = (CARD32) X86_FLAGS;
+    pInt->ax = (uint32_t) X86_EAX;
+    pInt->bx = (uint32_t) X86_EBX;
+    pInt->cx = (uint32_t) X86_ECX;
+    pInt->dx = (uint32_t) X86_EDX;
+    pInt->si = (uint32_t) X86_ESI;
+    pInt->di = (uint32_t) X86_EDI;
+    pInt->es = (uint16_t) X86_ES;
+    pInt->bp = (uint32_t) X86_EBP;
+    pInt->flags = (uint32_t) X86_FLAGS;
 #if defined (_PC)
     if (pInt->Flags & RESTORE_BIOS_SCRATCH)
         SetResetBIOSVars(pInt, FALSE);
@@ -102,23 +102,23 @@ finish_int(xf86Int10InfoPtr pInt, int sig)
 }
 
 /* general software interrupt handler */
-CARD32
+uint32_t
 getIntVect(xf86Int10InfoPtr pInt, int num)
 {
     return MEM_RW(pInt, num << 2) + (MEM_RW(pInt, (num << 2) + 2) << 4);
 }
 
 void
-pushw(xf86Int10InfoPtr pInt, CARD16 val)
+pushw(xf86Int10InfoPtr pInt, uint16_t val)
 {
     X86_ESP -= 2;
-    MEM_WW(pInt, ((CARD32) X86_SS << 4) + X86_SP, val);
+    MEM_WW(pInt, ((uint32_t) X86_SS << 4) + X86_SP, val);
 }
 
 int
 run_bios_int(int num, xf86Int10InfoPtr pInt)
 {
-    CARD32 eflags;
+    uint32_t eflags;
 
 #ifndef _PC
     /* check if bios vector is initialized */
@@ -167,7 +167,7 @@ void
 dump_code(xf86Int10InfoPtr pInt)
 {
     int i;
-    CARD32 lina = SEG_ADR((CARD32), X86_CS, IP);
+    uint32_t lina = SEG_ADR((uint32_t), X86_CS, IP);
 
     xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n",
                    (unsigned) lina);
@@ -203,8 +203,8 @@ void
 stack_trace(xf86Int10InfoPtr pInt)
 {
     int i = 0;
-    unsigned long stack = SEG_ADR((CARD32), X86_SS, SP);
-    unsigned long tail = (CARD32) ((X86_SS << 4) + 0x1000);
+    unsigned long stack = SEG_ADR((uint32_t), X86_SS, SP);
+    unsigned long tail = (uint32_t) ((X86_SS << 4) + 0x1000);
 
     if (stack >= tail)
         return;
@@ -222,10 +222,10 @@ stack_trace(xf86Int10InfoPtr pInt)
 
 int
 port_rep_inb(xf86Int10InfoPtr pInt,
-             CARD16 port, CARD32 base, int d_f, CARD32 count)
+             uint16_t port, uint32_t base, int d_f, uint32_t count)
 {
     register int inc = d_f ? -1 : 1;
-    CARD32 dst = base;
+    uint32_t dst = base;
 
     if (PRINT_PORT && DEBUG_IO_TRACE())
         ErrorF(" rep_insb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
@@ -239,10 +239,10 @@ port_rep_inb(xf86Int10InfoPtr pInt,
 
 int
 port_rep_inw(xf86Int10InfoPtr pInt,
-             CARD16 port, CARD32 base, int d_f, CARD32 count)
+             uint16_t port, uint32_t base, int d_f, uint32_t count)
 {
     register int inc = d_f ? -2 : 2;
-    CARD32 dst = base;
+    uint32_t dst = base;
 
     if (PRINT_PORT && DEBUG_IO_TRACE())
         ErrorF(" rep_insw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
@@ -256,10 +256,10 @@ port_rep_inw(xf86Int10InfoPtr pInt,
 
 int
 port_rep_inl(xf86Int10InfoPtr pInt,
-             CARD16 port, CARD32 base, int d_f, CARD32 count)
+             uint16_t port, uint32_t base, int d_f, uint32_t count)
 {
     register int inc = d_f ? -4 : 4;
-    CARD32 dst = base;
+    uint32_t dst = base;
 
     if (PRINT_PORT && DEBUG_IO_TRACE())
         ErrorF(" rep_insl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
@@ -273,10 +273,10 @@ port_rep_inl(xf86Int10InfoPtr pInt,
 
 int
 port_rep_outb(xf86Int10InfoPtr pInt,
-              CARD16 port, CARD32 base, int d_f, CARD32 count)
+              uint16_t port, uint32_t base, int d_f, uint32_t count)
 {
     register int inc = d_f ? -1 : 1;
-    CARD32 dst = base;
+    uint32_t dst = base;
 
     if (PRINT_PORT && DEBUG_IO_TRACE())
         ErrorF(" rep_outb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
@@ -290,10 +290,10 @@ port_rep_outb(xf86Int10InfoPtr pInt,
 
 int
 port_rep_outw(xf86Int10InfoPtr pInt,
-              CARD16 port, CARD32 base, int d_f, CARD32 count)
+              uint16_t port, uint32_t base, int d_f, uint32_t count)
 {
     register int inc = d_f ? -2 : 2;
-    CARD32 dst = base;
+    uint32_t dst = base;
 
     if (PRINT_PORT && DEBUG_IO_TRACE())
         ErrorF(" rep_outw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
@@ -307,10 +307,10 @@ port_rep_outw(xf86Int10InfoPtr pInt,
 
 int
 port_rep_outl(xf86Int10InfoPtr pInt,
-              CARD16 port, CARD32 base, int d_f, CARD32 count)
+              uint16_t port, uint32_t base, int d_f, uint32_t count)
 {
     register int inc = d_f ? -4 : 4;
-    CARD32 dst = base;
+    uint32_t dst = base;
 
     if (PRINT_PORT && DEBUG_IO_TRACE())
         ErrorF(" rep_outl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
@@ -322,14 +322,14 @@ port_rep_outl(xf86Int10InfoPtr pInt,
     return dst - base;
 }
 
-CARD8
-x_inb(CARD16 port)
+uint8_t
+x_inb(uint16_t port)
 {
-    CARD8 val;
+    uint8_t val;
 
     if (port == 0x40) {
         Int10Current->inb40time++;
-        val = (CARD8) (Int10Current->inb40time >>
+        val = (uint8_t) (Int10Current->inb40time >>
                        ((Int10Current->inb40time & 1) << 3));
         if (PRINT_PORT && DEBUG_IO_TRACE())
             ErrorF(" inb(%#x) = %2.2x\n", port, val);
@@ -353,10 +353,10 @@ x_inb(CARD16 port)
     return val;
 }
 
-CARD16
-x_inw(CARD16 port)
+uint16_t
+x_inw(uint16_t port)
 {
-    CARD16 val;
+    uint16_t val;
 
     if (port == 0x5c) {
         struct timeval tv;
@@ -366,7 +366,7 @@ x_inw(CARD16 port)
          * Approximate this by dividing by 3.
          */
         X_GETTIMEOFDAY(&tv);
-        val = (CARD16) (tv.tv_usec / 3);
+        val = (uint16_t) (tv.tv_usec / 3);
     }
     else if (!pciCfg1inw(port, &val)) {
         val = pci_io_read16(Int10Current->io, port);
@@ -377,7 +377,7 @@ x_inw(CARD16 port)
 }
 
 void
-x_outb(CARD16 port, CARD8 val)
+x_outb(uint16_t port, uint8_t val)
 {
     if ((port == 0x43) && (val == 0)) {
         struct timeval tv;
@@ -389,7 +389,7 @@ x_outb(CARD16 port, CARD8 val)
          * the bottom bit as a byte select.  See inb(0x40) above.
          */
         X_GETTIMEOFDAY(&tv);
-        Int10Current->inb40time = (CARD16) (tv.tv_usec | 1);
+        Int10Current->inb40time = (uint16_t) (tv.tv_usec | 1);
         if (PRINT_PORT && DEBUG_IO_TRACE())
             ErrorF(" outb(%#x, %2.2x)\n", port, val);
 #ifdef __NOT_YET__
@@ -411,7 +411,7 @@ x_outb(CARD16 port, CARD8 val)
 }
 
 void
-x_outw(CARD16 port, CARD16 val)
+x_outw(uint16_t port, uint16_t val)
 {
 
     if (!pciCfg1outw(port, val)) {
@@ -421,10 +421,10 @@ x_outw(CARD16 port, CARD16 val)
     }
 }
 
-CARD32
-x_inl(CARD16 port)
+uint32_t
+x_inl(uint16_t port)
 {
-    CARD32 val;
+    uint32_t val;
 
     if (!pciCfg1in(port, &val)) {
         val = pci_io_read32(Int10Current->io, port);
@@ -435,7 +435,7 @@ x_inl(CARD16 port)
 }
 
 void
-x_outl(CARD16 port, CARD32 val)
+x_outl(uint16_t port, uint32_t val)
 {
     if (!pciCfg1out(port, val)) {
         if (PRINT_PORT && DEBUG_IO_TRACE())
@@ -444,43 +444,43 @@ x_outl(CARD16 port, CARD32 val)
     }
 }
 
-CARD8
-Mem_rb(CARD32 addr)
+uint8_t
+Mem_rb(uint32_t addr)
 {
     return (*Int10Current->mem->rb) (Int10Current, addr);
 }
 
-CARD16
-Mem_rw(CARD32 addr)
+uint16_t
+Mem_rw(uint32_t addr)
 {
     return (*Int10Current->mem->rw) (Int10Current, addr);
 }
 
-CARD32
-Mem_rl(CARD32 addr)
+uint32_t
+Mem_rl(uint32_t addr)
 {
     return (*Int10Current->mem->rl) (Int10Current, addr);
 }
 
 void
-Mem_wb(CARD32 addr, CARD8 val)
+Mem_wb(uint32_t addr, uint8_t val)
 {
     (*Int10Current->mem->wb) (Int10Current, addr, val);
 }
 
 void
-Mem_ww(CARD32 addr, CARD16 val)
+Mem_ww(uint32_t addr, uint16_t val)
 {
     (*Int10Current->mem->ww) (Int10Current, addr, val);
 }
 
 void
-Mem_wl(CARD32 addr, CARD32 val)
+Mem_wl(uint32_t addr, uint32_t val)
 {
     (*Int10Current->mem->wl) (Int10Current, addr, val);
 }
 
-static CARD32 PciCfg1Addr = 0;
+static uint32_t PciCfg1Addr = 0;
 
 #define PCI_DOM_FROM_TAG(tag)  (((tag) >> 24) & (PCI_DOM_MASK))
 #define PCI_BUS_FROM_TAG(tag)  (((tag) >> 16) & (PCI_DOMBUS_MASK))
@@ -491,10 +491,10 @@ static CARD32 PciCfg1Addr = 0;
 #define PCI_TAG(x)    ((x) & 0x7fffff00)
 
 static struct pci_device *
-pci_device_for_cfg_address(CARD32 addr)
+pci_device_for_cfg_address(uint32_t addr)
 {
     struct pci_device *dev = NULL;
-    CARD32 tag = PCI_TAG(addr);
+    uint32_t tag = PCI_TAG(addr);
 
     struct pci_slot_match slot_match = {
         .domain = PCI_DOM_FROM_TAG(tag),
@@ -516,7 +516,7 @@ pci_device_for_cfg_address(CARD32 addr)
 }
 
 static int
-pciCfg1in(CARD16 addr, CARD32 *val)
+pciCfg1in(uint16_t addr, uint32_t *val)
 {
     if (addr == 0xCF8) {
         *val = PciCfg1Addr;
@@ -534,7 +534,7 @@ pciCfg1in(CARD16 addr, CARD32 *val)
 }
 
 static int
-pciCfg1out(CARD16 addr, CARD32 val)
+pciCfg1out(uint16_t addr, uint32_t val)
 {
     if (addr == 0xCF8) {
         PciCfg1Addr = val;
@@ -552,7 +552,7 @@ pciCfg1out(CARD16 addr, CARD32 val)
 }
 
 static int
-pciCfg1inw(CARD16 addr, CARD16 *val)
+pciCfg1inw(uint16_t addr, uint16_t *val)
 {
     int shift;
 
@@ -575,14 +575,14 @@ pciCfg1inw(CARD16 addr, CARD16 *val)
 }
 
 static int
-pciCfg1outw(CARD16 addr, CARD16 val)
+pciCfg1outw(uint16_t addr, uint16_t val)
 {
     int shift;
 
     if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
         shift = (addr - 0xCF8) * 8;
         PciCfg1Addr &= ~(0xffff << shift);
-        PciCfg1Addr |= ((CARD32) val) << shift;
+        PciCfg1Addr |= ((uint32_t) val) << shift;
         return 1;
     }
     if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
@@ -599,7 +599,7 @@ pciCfg1outw(CARD16 addr, CARD16 val)
 }
 
 static int
-pciCfg1inb(CARD16 addr, CARD8 *val)
+pciCfg1inb(uint16_t addr, uint8_t *val)
 {
     int shift;
 
@@ -622,14 +622,14 @@ pciCfg1inb(CARD16 addr, CARD8 *val)
 }
 
 static int
-pciCfg1outb(CARD16 addr, CARD8 val)
+pciCfg1outb(uint16_t addr, uint8_t val)
 {
     int shift;
 
     if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
         shift = (addr - 0xCF8) * 8;
         PciCfg1Addr &= ~(0xff << shift);
-        PciCfg1Addr |= ((CARD32) val) << shift;
+        PciCfg1Addr |= ((uint32_t) val) << shift;
         return 1;
     }
     if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
@@ -645,10 +645,10 @@ pciCfg1outb(CARD16 addr, CARD8 val)
     return 0;
 }
 
-CARD8
-bios_checksum(const CARD8 *start, int size)
+uint8_t
+bios_checksum(const uint8_t *start, int size)
 {
-    CARD8 sum = 0;
+    uint8_t sum = 0;
 
     while (size-- > 0)
         sum += *start++;
@@ -682,12 +682,12 @@ LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
     vga->save_46e8 = pci_io_read8(pInt->io, 0x46E8);
 #endif
     vga->save_pos102 = pci_io_read8(pInt->io, 0x0102);
-    pci_io_write8(pInt->io, 0x03C2, ~(CARD8) 0x03 & vga->save_msr);
-    pci_io_write8(pInt->io, 0x03C3, ~(CARD8) 0x01 & vga->save_vse);
+    pci_io_write8(pInt->io, 0x03C2, ~(uint8_t) 0x03 & vga->save_msr);
+    pci_io_write8(pInt->io, 0x03C3, ~(uint8_t) 0x01 & vga->save_vse);
 #ifndef __ia64__
-    pci_io_write8(pInt->io, 0x46E8, ~(CARD8) 0x08 & vga->save_46e8);
+    pci_io_write8(pInt->io, 0x46E8, ~(uint8_t) 0x08 & vga->save_46e8);
 #endif
-    pci_io_write8(pInt->io, 0x0102, ~(CARD8) 0x01 & vga->save_pos102);
+    pci_io_write8(pInt->io, 0x0102, ~(uint8_t) 0x01 & vga->save_pos102);
 }
 
 void
diff --git a/hw/xfree86/int10/xf86int10.h b/hw/xfree86/int10/xf86int10.h
index 6d564fc..94040c5 100644
--- a/hw/xfree86/int10/xf86int10.h
+++ b/hw/xfree86/int10/xf86int10.h
@@ -21,8 +21,8 @@
 /* int10 info structure */
 typedef struct {
     int entityIndex;
-    CARD16 BIOSseg;
-    CARD16 inb40time;
+    uint16_t BIOSseg;
+    uint16_t inb40time;
     ScrnInfoPtr pScrn;
     pointer cpuRegs;
     char *BIOSScratch;
@@ -45,19 +45,19 @@ typedef struct {
 } xf86Int10InfoRec, *xf86Int10InfoPtr;
 
 typedef struct _int10Mem {
-    CARD8 (*rb) (xf86Int10InfoPtr, int);
-    CARD16 (*rw) (xf86Int10InfoPtr, int);
-    CARD32 (*rl) (xf86Int10InfoPtr, int);
-    void (*wb) (xf86Int10InfoPtr, int, CARD8);
-    void (*ww) (xf86Int10InfoPtr, int, CARD16);
-    void (*wl) (xf86Int10InfoPtr, int, CARD32);
+    uint8_t (*rb) (xf86Int10InfoPtr, int);
+    uint16_t (*rw) (xf86Int10InfoPtr, int);
+    uint32_t (*rl) (xf86Int10InfoPtr, int);
+    void (*wb) (xf86Int10InfoPtr, int, uint8_t);
+    void (*ww) (xf86Int10InfoPtr, int, uint16_t);
+    void (*wl) (xf86Int10InfoPtr, int, uint32_t);
 } int10MemRec, *int10MemPtr;
 
 typedef struct {
-    CARD8 save_msr;
-    CARD8 save_pos102;
-    CARD8 save_vse;
-    CARD8 save_46e8;
+    uint8_t save_msr;
+    uint8_t save_pos102;
+    uint8_t save_vse;
+    uint8_t save_46e8;
 } legacyVGARec, *legacyVGAPtr;
 
 /* OS dependent functions */
@@ -69,7 +69,7 @@ extern _X_EXPORT void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num,
                                            int *off);
 extern _X_EXPORT void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase,
                                          int num);
-extern _X_EXPORT pointer xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr);
+extern _X_EXPORT pointer xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr);
 
 /* x86 executor related functions */
 extern _X_EXPORT void xf86ExecX86int10(xf86Int10InfoPtr pInt);
@@ -127,13 +127,13 @@ int int_handler(xf86Int10InfoPtr pInt);
 /* helper_exec.c */
 int setup_int(xf86Int10InfoPtr pInt);
 void finish_int(xf86Int10InfoPtr, int sig);
-CARD32 getIntVect(xf86Int10InfoPtr pInt, int num);
-void pushw(xf86Int10InfoPtr pInt, CARD16 val);
+uint32_t getIntVect(xf86Int10InfoPtr pInt, int num);
+void pushw(xf86Int10InfoPtr pInt, uint16_t val);
 int run_bios_int(int num, xf86Int10InfoPtr pInt);
 void dump_code(xf86Int10InfoPtr pInt);
 void dump_registers(xf86Int10InfoPtr pInt);
 void stack_trace(xf86Int10InfoPtr pInt);
-CARD8 bios_checksum(const CARD8 *start, int size);
+uint8_t bios_checksum(const uint8_t *start, int size);
 void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
 void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
 
@@ -142,31 +142,31 @@ extern _X_EXPORT void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt,
                                                    Bool save);
 #endif
 int port_rep_inb(xf86Int10InfoPtr pInt,
-                 CARD16 port, CARD32 base, int d_f, CARD32 count);
+                 uint16_t port, uint32_t base, int d_f, uint32_t count);
 int port_rep_inw(xf86Int10InfoPtr pInt,
-                 CARD16 port, CARD32 base, int d_f, CARD32 count);
+                 uint16_t port, uint32_t base, int d_f, uint32_t count);
 int port_rep_inl(xf86Int10InfoPtr pInt,
-                 CARD16 port, CARD32 base, int d_f, CARD32 count);
+                 uint16_t port, uint32_t base, int d_f, uint32_t count);
 int port_rep_outb(xf86Int10InfoPtr pInt,
-                  CARD16 port, CARD32 base, int d_f, CARD32 count);
+                  uint16_t port, uint32_t base, int d_f, uint32_t count);
 int port_rep_outw(xf86Int10InfoPtr pInt,
-                  CARD16 port, CARD32 base, int d_f, CARD32 count);
+                  uint16_t port, uint32_t base, int d_f, uint32_t count);
 int port_rep_outl(xf86Int10InfoPtr pInt,
-                  CARD16 port, CARD32 base, int d_f, CARD32 count);
-
-CARD8 x_inb(CARD16 port);
-CARD16 x_inw(CARD16 port);
-void x_outb(CARD16 port, CARD8 val);
-void x_outw(CARD16 port, CARD16 val);
-CARD32 x_inl(CARD16 port);
-void x_outl(CARD16 port, CARD32 val);
-
-CARD8 Mem_rb(CARD32 addr);
-CARD16 Mem_rw(CARD32 addr);
-CARD32 Mem_rl(CARD32 addr);
-void Mem_wb(CARD32 addr, CARD8 val);
-void Mem_ww(CARD32 addr, CARD16 val);
-void Mem_wl(CARD32 addr, CARD32 val);
+                  uint16_t port, uint32_t base, int d_f, uint32_t count);
+
+uint8_t x_inb(uint16_t port);
+uint16_t x_inw(uint16_t port);
+void x_outb(uint16_t port, uint8_t val);
+void x_outw(uint16_t port, uint16_t val);
+uint32_t x_inl(uint16_t port);
+void x_outl(uint16_t port, uint32_t val);
+
+uint8_t Mem_rb(uint32_t addr);
+uint16_t Mem_rw(uint32_t addr);
+uint32_t Mem_rl(uint32_t addr);
+void Mem_wb(uint32_t addr, uint8_t val);
+void Mem_ww(uint32_t addr, uint16_t val);
+void Mem_wl(uint32_t addr, uint32_t val);
 
 /* helper_mem.c */
 void setup_int_vect(xf86Int10InfoPtr pInt);
diff --git a/hw/xfree86/int10/xf86x86emu.c b/hw/xfree86/int10/xf86x86emu.c
index 0f8737b..b9a4d36 100644
--- a/hw/xfree86/int10/xf86x86emu.c
+++ b/hw/xfree86/int10/xf86x86emu.c
@@ -50,12 +50,12 @@ xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
     X86EMU_intrFuncs intFuncs[256];
 
     X86EMU_pioFuncs pioFuncs = {
-        (&x_inb),
-        (&x_inw),
-        (&x_inl),
-        (&x_outb),
-        (&x_outw),
-        (&x_outl)
+        .inb = x_inb,
+        .inw = x_inw,
+        .inl = x_inl,
+        .outb = x_outb,
+        .outw = x_outw,
+        .outl = x_outl
     };
 
     X86EMU_memFuncs memFuncs = {
-- 
1.8.4.4



More information about the xorg-devel mailing list