aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/int10
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/int10')
-rw-r--r--xorg-server/hw/xfree86/int10/generic.c54
-rw-r--r--xorg-server/hw/xfree86/int10/helper_exec.c208
-rw-r--r--xorg-server/hw/xfree86/int10/helper_mem.c2
-rw-r--r--xorg-server/hw/xfree86/int10/stub.c2
-rw-r--r--xorg-server/hw/xfree86/int10/xf86int10.h76
-rw-r--r--xorg-server/hw/xfree86/int10/xf86x86emu.c12
6 files changed, 177 insertions, 177 deletions
diff --git a/xorg-server/hw/xfree86/int10/generic.c b/xorg-server/hw/xfree86/int10/generic.c
index d7594def2..abbd36f3c 100644
--- a/xorg-server/hw/xfree86/int10/generic.c
+++ b/xorg-server/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
@@ -87,8 +87,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
if (!xf86Int10ExecSetup(pInt))
goto error0;
pInt->mem = &genericMem;
- pInt->private = (pointer) xnfcalloc(1, sizeof(genericInt10Priv));
- INTPriv(pInt)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
+ pInt->private = (void *) xnfcalloc(1, sizeof(genericInt10Priv));
+ INTPriv(pInt)->alloc = (void *) xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
pInt->pScrn = pScrn;
base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS);
@@ -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)) \
- : ldw_u((pointer)V_ADDR(addr))
+ (VRAM(addr)) ? MMIO_IN16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr)) \
+ : ldw_u((void *)V_ADDR(addr))
#define V_ADDR_RL(addr) \
- (VRAM(addr)) ? MMIO_IN32((CARD32*)VRAM_BASE,VRAM_ADDR(addr)) \
- : ldl_u((pointer)V_ADDR(addr))
+ (VRAM(addr)) ? MMIO_IN32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr)) \
+ : ldl_u((void *)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)));
+ stw_u((val),(void *)(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)));
+ stl_u(val,(void *)(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) {
@@ -425,8 +425,8 @@ write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
V_ADDR_WB(addr + 3, val >> 24);
}
-pointer
-xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
+void *
+xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr)
{
return V_ADDR(addr);
}
diff --git a/xorg-server/hw/xfree86/int10/helper_exec.c b/xorg-server/hw/xfree86/int10/helper_exec.c
index 1c58cf7ae..6a83f422e 100644
--- a/xorg-server/hw/xfree86/int10/helper_exec.c
+++ b/xorg-server/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,10 +167,10 @@ 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",
- lina);
+ (unsigned) lina);
for (i = 0; i < 0x10; i++)
xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
xf86ErrorFVerb(3, "\n");
@@ -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,14 +222,14 @@ 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",
- port, count, base, d_f ? "up" : "down");
+ port, (unsigned) count, (unsigned) base, d_f ? "up" : "down");
while (count--) {
MEM_WB(pInt, dst, x_inb(port));
dst += inc;
@@ -239,14 +239,14 @@ 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",
- port, count, base, d_f ? "up" : "down");
+ port, (unsigned) count, (unsigned) base, d_f ? "up" : "down");
while (count--) {
MEM_WW(pInt, dst, x_inw(port));
dst += inc;
@@ -256,14 +256,14 @@ 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",
- port, count, base, d_f ? "up" : "down");
+ port, (unsigned) count, (unsigned) base, d_f ? "up" : "down");
while (count--) {
MEM_WL(pInt, dst, x_inl(port));
dst += inc;
@@ -273,14 +273,14 @@ 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",
- port, count, base, d_f ? "up" : "down");
+ port, (unsigned) count, (unsigned) base, d_f ? "up" : "down");
while (count--) {
x_outb(port, MEM_RB(pInt, dst));
dst += inc;
@@ -290,14 +290,14 @@ 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",
- port, count, base, d_f ? "up" : "down");
+ port, (unsigned) count, (unsigned) base, d_f ? "up" : "down");
while (count--) {
x_outw(port, MEM_RW(pInt, dst));
dst += inc;
@@ -307,14 +307,14 @@ 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",
- port, count, base, d_f ? "up" : "down");
+ port, (unsigned) count, (unsigned) base, d_f ? "up" : "down");
while (count--) {
x_outl(port, MEM_RL(pInt, dst));
dst += inc;
@@ -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,66 +421,66 @@ 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);
if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, val);
+ ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, (unsigned) val);
}
return val;
}
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())
- ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, val);
+ ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, (unsigned) val);
pci_io_write32(Int10Current->io, port, 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;
@@ -526,15 +526,15 @@ pciCfg1in(CARD16 addr, CARD32 *val)
pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr),
(uint32_t *) val, PCI_OFFSET(PciCfg1Addr));
if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_inl(%#" PRIx32 ") = %8.8" PRIx32 "\n", PciCfg1Addr,
- *val);
+ ErrorF(" cfg_inl(%#" PRIx32 ") = %8.8" PRIx32 "\n", (unsigned) PciCfg1Addr,
+ (unsigned) *val);
return 1;
}
return 0;
}
static int
-pciCfg1out(CARD16 addr, CARD32 val)
+pciCfg1out(uint16_t addr, uint32_t val)
{
if (addr == 0xCF8) {
PciCfg1Addr = val;
@@ -542,8 +542,8 @@ pciCfg1out(CARD16 addr, CARD32 val)
}
if (addr == 0xCFC) {
if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_outl(%#" PRIx32 ", %8.8" PRIx32 ")\n", PciCfg1Addr,
- val);
+ ErrorF(" cfg_outl(%#" PRIx32 ", %8.8" PRIx32 ")\n", (unsigned) PciCfg1Addr,
+ (unsigned) val);
pci_device_cfg_write_u32(pci_device_for_cfg_address(PciCfg1Addr), val,
PCI_OFFSET(PciCfg1Addr));
return 1;
@@ -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;
@@ -567,30 +567,30 @@ pciCfg1inw(CARD16 addr, CARD16 *val)
pci_device_cfg_read_u16(pci_device_for_cfg_address(PciCfg1Addr),
val, PCI_OFFSET(PciCfg1Addr) + offset);
if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_inw(%#" PRIx32 ") = %4.4x\n", PciCfg1Addr + offset,
- *val);
+ ErrorF(" cfg_inw(%#" PRIx32 ") = %4.4x\n", (unsigned) (PciCfg1Addr + offset),
+ (unsigned) *val);
return 1;
}
return 0;
}
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)) {
const unsigned offset = addr - 0xCFC;
if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_outw(%#" PRIx32 ", %4.4x)\n", PciCfg1Addr + offset,
- val);
+ ErrorF(" cfg_outw(%#" PRIx32 ", %4.4x)\n", (unsigned) (PciCfg1Addr + offset),
+ (unsigned) val);
pci_device_cfg_write_u16(pci_device_for_cfg_address(PciCfg1Addr), val,
PCI_OFFSET(PciCfg1Addr) + offset);
return 1;
@@ -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;
@@ -614,30 +614,30 @@ pciCfg1inb(CARD16 addr, CARD8 *val)
pci_device_cfg_read_u8(pci_device_for_cfg_address(PciCfg1Addr),
val, PCI_OFFSET(PciCfg1Addr) + offset);
if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_inb(%#" PRIx32 ") = %2.2x\n", PciCfg1Addr + offset,
- *val);
+ ErrorF(" cfg_inb(%#" PRIx32 ") = %2.2x\n", (unsigned) (PciCfg1Addr + offset),
+ (unsigned) *val);
return 1;
}
return 0;
}
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)) {
const unsigned offset = addr - 0xCFC;
if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_outb(%#" PRIx32 ", %2.2x)\n", PciCfg1Addr + offset,
- val);
+ ErrorF(" cfg_outb(%#" PRIx32 ", %2.2x)\n", (unsigned) (PciCfg1Addr + offset),
+ (unsigned) val);
pci_device_cfg_write_u8(pci_device_for_cfg_address(PciCfg1Addr), val,
PCI_OFFSET(PciCfg1Addr) + offset);
return 1;
@@ -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/xorg-server/hw/xfree86/int10/helper_mem.c b/xorg-server/hw/xfree86/int10/helper_mem.c
index 160c5aedf..1b5960e0c 100644
--- a/xorg-server/hw/xfree86/int10/helper_mem.c
+++ b/xorg-server/hw/xfree86/int10/helper_mem.c
@@ -199,7 +199,7 @@ xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex)
OptionInfoPtr options = NULL;
if (pEnt->device) {
- pointer configOptions = NULL;
+ void *configOptions = NULL;
/* Check if xf86CollectOptions() has already been called */
if (((pEnt->index < 0) ||
diff --git a/xorg-server/hw/xfree86/int10/stub.c b/xorg-server/hw/xfree86/int10/stub.c
index 8fd079069..40e0ba719 100644
--- a/xorg-server/hw/xfree86/int10/stub.c
+++ b/xorg-server/hw/xfree86/int10/stub.c
@@ -62,7 +62,7 @@ xf86ExecX86int10(xf86Int10InfoPtr pInt)
return;
}
-pointer
+void *
xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
{
return 0;
diff --git a/xorg-server/hw/xfree86/int10/xf86int10.h b/xorg-server/hw/xfree86/int10/xf86int10.h
index 6d564fc1a..83bab7e61 100644
--- a/xorg-server/hw/xfree86/int10/xf86int10.h
+++ b/xorg-server/hw/xfree86/int10/xf86int10.h
@@ -21,13 +21,13 @@
/* int10 info structure */
typedef struct {
int entityIndex;
- CARD16 BIOSseg;
- CARD16 inb40time;
+ uint16_t BIOSseg;
+ uint16_t inb40time;
ScrnInfoPtr pScrn;
- pointer cpuRegs;
+ void *cpuRegs;
char *BIOSScratch;
int Flags;
- pointer private;
+ void *private;
struct _int10Mem *mem;
int num;
int ax;
@@ -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 void *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/xorg-server/hw/xfree86/int10/xf86x86emu.c b/xorg-server/hw/xfree86/int10/xf86x86emu.c
index 0f8737b49..b9a4d3603 100644
--- a/xorg-server/hw/xfree86/int10/xf86x86emu.c
+++ b/xorg-server/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 = {