diff options
author | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
commit | 76bcc36ed305418a3ddc5752d287ede894243e1b (patch) | |
tree | bacb320c825768471ce56f058f17ce863d592376 /xorg-server/hw/xfree86/x86emu/sys.c | |
parent | 7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff) | |
parent | 0f834b91a4768673833ab4917e87d86c237bb1a6 (diff) | |
download | vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2 vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
pixman/pixman/pixman-mmx.c
xorg-server/Xext/shm.c
xorg-server/Xext/syncsrv.h
xorg-server/Xext/xvmain.c
xorg-server/Xi/exevents.c
xorg-server/Xi/opendev.c
xorg-server/composite/compalloc.c
xorg-server/composite/compoverlay.c
xorg-server/dix/colormap.c
xorg-server/dix/devices.c
xorg-server/dix/dispatch.c
xorg-server/dix/dixfonts.c
xorg-server/dix/eventconvert.c
xorg-server/dix/events.c
xorg-server/dix/gc.c
xorg-server/dix/getevents.c
xorg-server/dix/main.c
xorg-server/dix/privates.c
xorg-server/dix/registry.c
xorg-server/dix/resource.c
xorg-server/exa/exa_accel.c
xorg-server/exa/exa_migration_classic.c
xorg-server/exa/exa_unaccel.c
xorg-server/fb/fb.h
xorg-server/fb/fbcopy.c
xorg-server/fb/fbpixmap.c
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.h
xorg-server/glx/glapi_gentable.c
xorg-server/glx/glapitable.h
xorg-server/glx/glprocs.h
xorg-server/glx/glxcmds.c
xorg-server/glx/glxcmdsswap.c
xorg-server/glx/glxdricommon.c
xorg-server/glx/glxdriswrast.c
xorg-server/glx/glxext.c
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/glx/indirect_util.c
xorg-server/glx/rensize.c
xorg-server/glx/single2swap.c
xorg-server/glx/singlepix.c
xorg-server/glx/singlepixswap.c
xorg-server/glx/singlesize.c
xorg-server/hw/dmx/dmxinit.c
xorg-server/hw/kdrive/ephyr/ephyr.c
xorg-server/hw/kdrive/ephyr/hostx.c
xorg-server/hw/kdrive/ephyr/hostx.h
xorg-server/hw/kdrive/src/kinput.c
xorg-server/hw/xfree86/common/compiler.h
xorg-server/hw/xwin/InitInput.c
xorg-server/hw/xwin/InitOutput.c
xorg-server/hw/xwin/ddraw.h
xorg-server/hw/xwin/glx/glwrap.c
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/glx/wgl_ext_api.h
xorg-server/hw/xwin/glx/winpriv.c
xorg-server/hw/xwin/win.h
xorg-server/hw/xwin/winallpriv.c
xorg-server/hw/xwin/winauth.c
xorg-server/hw/xwin/winclipboard.h
xorg-server/hw/xwin/winclipboardinit.c
xorg-server/hw/xwin/winclipboardthread.c
xorg-server/hw/xwin/winclipboardunicode.c
xorg-server/hw/xwin/winclipboardwndproc.c
xorg-server/hw/xwin/winclipboardwrappers.c
xorg-server/hw/xwin/winclipboardxevents.c
xorg-server/hw/xwin/wincmap.c
xorg-server/hw/xwin/winconfig.c
xorg-server/hw/xwin/wincreatewnd.c
xorg-server/hw/xwin/wincursor.c
xorg-server/hw/xwin/windialogs.c
xorg-server/hw/xwin/winengine.c
xorg-server/hw/xwin/winerror.c
xorg-server/hw/xwin/wingc.c
xorg-server/hw/xwin/wingetsp.c
xorg-server/hw/xwin/winkeybd.c
xorg-server/hw/xwin/winkeybd.h
xorg-server/hw/xwin/winlayouts.h
xorg-server/hw/xwin/winmisc.c
xorg-server/hw/xwin/winmonitors.c
xorg-server/hw/xwin/winmouse.c
xorg-server/hw/xwin/winmsg.c
xorg-server/hw/xwin/winmsg.h
xorg-server/hw/xwin/winmultiwindowclass.c
xorg-server/hw/xwin/winmultiwindowicons.c
xorg-server/hw/xwin/winmultiwindowshape.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winmultiwindowwndproc.c
xorg-server/hw/xwin/winnativegdi.c
xorg-server/hw/xwin/winpfbdd.c
xorg-server/hw/xwin/winpixmap.c
xorg-server/hw/xwin/winpolyline.c
xorg-server/hw/xwin/winprefs.c
xorg-server/hw/xwin/winprocarg.c
xorg-server/hw/xwin/winregistry.c
xorg-server/hw/xwin/winscrinit.c
xorg-server/hw/xwin/winsetsp.c
xorg-server/hw/xwin/winshaddd.c
xorg-server/hw/xwin/winshadddnl.c
xorg-server/hw/xwin/winshadgdi.c
xorg-server/hw/xwin/wintrayicon.c
xorg-server/hw/xwin/winwin32rootless.c
xorg-server/hw/xwin/winwin32rootlesswindow.c
xorg-server/hw/xwin/winwin32rootlesswndproc.c
xorg-server/hw/xwin/winwindow.c
xorg-server/hw/xwin/winwindow.h
xorg-server/hw/xwin/winwindowswm.c
xorg-server/hw/xwin/winwndproc.c
xorg-server/include/callback.h
xorg-server/include/dixstruct.h
xorg-server/include/misc.h
xorg-server/include/os.h
xorg-server/include/scrnintstr.h
xorg-server/mi/micmap.c
xorg-server/mi/miinitext.c
xorg-server/mi/mioverlay.c
xorg-server/mi/misprite.c
xorg-server/mi/mivaltree.c
xorg-server/mi/miwindow.c
xorg-server/miext/damage/damage.c
xorg-server/miext/rootless/rootlessGC.c
xorg-server/miext/rootless/rootlessWindow.c
xorg-server/os/WaitFor.c
xorg-server/os/access.c
xorg-server/os/connection.c
xorg-server/os/io.c
xorg-server/os/log.c
xorg-server/os/osinit.c
xorg-server/os/utils.c
xorg-server/os/xdmcp.c
xorg-server/os/xprintf.c
xorg-server/os/xstrans.c
xorg-server/render/mipict.c
xorg-server/xkb/xkbActions.c
xorg-server/xkb/xkbInit.c
xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/hw/xfree86/x86emu/sys.c')
-rw-r--r-- | xorg-server/hw/xfree86/x86emu/sys.c | 427 |
1 files changed, 229 insertions, 198 deletions
diff --git a/xorg-server/hw/xfree86/x86emu/sys.c b/xorg-server/hw/xfree86/x86emu/sys.c index f389767f1..c514ddeea 100644 --- a/xorg-server/hw/xfree86/x86emu/sys.c +++ b/xorg-server/hw/xfree86/x86emu/sys.c @@ -47,101 +47,131 @@ #include "x86emu/prim_ops.h" #ifndef NO_SYS_HEADERS #include <string.h> -#endif +#endif -# ifdef __GNUC__ +#ifdef __GNUC__ /* Define some packed structures to use with unaligned accesses */ -struct __una_u64 { u64 x __attribute__((packed)); }; -struct __una_u32 { u32 x __attribute__((packed)); }; -struct __una_u16 { u16 x __attribute__((packed)); }; +struct __una_u64 { + u64 x __attribute__ ((packed)); +}; +struct __una_u32 { + u32 x __attribute__ ((packed)); +}; +struct __una_u16 { + u16 x __attribute__ ((packed)); +}; /* Elemental unaligned loads */ -static __inline__ u64 ldq_u(u64 *p) +static __inline__ u64 +ldq_u(u64 * p) { - const struct __una_u64 *ptr = (const struct __una_u64 *) p; - return ptr->x; + const struct __una_u64 *ptr = (const struct __una_u64 *) p; + + return ptr->x; } -static __inline__ u32 ldl_u(u32 *p) +static __inline__ u32 +ldl_u(u32 * p) { - const struct __una_u32 *ptr = (const struct __una_u32 *) p; - return ptr->x; + const struct __una_u32 *ptr = (const struct __una_u32 *) p; + + return ptr->x; } -static __inline__ u16 ldw_u(u16 *p) +static __inline__ u16 +ldw_u(u16 * p) { - const struct __una_u16 *ptr = (const struct __una_u16 *) p; - return ptr->x; + const struct __una_u16 *ptr = (const struct __una_u16 *) p; + + return ptr->x; } /* Elemental unaligned stores */ -static __inline__ void stq_u(u64 val, u64 *p) +static __inline__ void +stq_u(u64 val, u64 * p) { - struct __una_u64 *ptr = (struct __una_u64 *) p; - ptr->x = val; + struct __una_u64 *ptr = (struct __una_u64 *) p; + + ptr->x = val; } -static __inline__ void stl_u(u32 val, u32 *p) +static __inline__ void +stl_u(u32 val, u32 * p) { - struct __una_u32 *ptr = (struct __una_u32 *) p; - ptr->x = val; + struct __una_u32 *ptr = (struct __una_u32 *) p; + + ptr->x = val; } -static __inline__ void stw_u(u16 val, u16 *p) +static __inline__ void +stw_u(u16 val, u16 * p) { - struct __una_u16 *ptr = (struct __una_u16 *) p; - ptr->x = val; + struct __una_u16 *ptr = (struct __una_u16 *) p; + + ptr->x = val; } -# else /* !__GNUC__ */ +#else /* !__GNUC__ */ -static __inline__ u64 ldq_u(u64 *p) +static __inline__ u64 +ldq_u(u64 * p) { - u64 ret; - memmove(&ret, p, sizeof(*p)); - return ret; + u64 ret; + + memmove(&ret, p, sizeof(*p)); + return ret; } -static __inline__ u32 ldl_u(u32 *p) +static __inline__ u32 +ldl_u(u32 * p) { - u32 ret; - memmove(&ret, p, sizeof(*p)); - return ret; + u32 ret; + + memmove(&ret, p, sizeof(*p)); + return ret; } -static __inline__ u16 ldw_u(u16 *p) +static __inline__ u16 +ldw_u(u16 * p) { - u16 ret; - memmove(&ret, p, sizeof(*p)); - return ret; + u16 ret; + + memmove(&ret, p, sizeof(*p)); + return ret; } -static __inline__ void stq_u(u64 val, u64 *p) +static __inline__ void +stq_u(u64 val, u64 * p) { - u64 tmp = val; - memmove(p, &tmp, sizeof(*p)); + u64 tmp = val; + + memmove(p, &tmp, sizeof(*p)); } -static __inline__ void stl_u(u32 val, u32 *p) +static __inline__ void +stl_u(u32 val, u32 * p) { - u32 tmp = val; - memmove(p, &tmp, sizeof(*p)); + u32 tmp = val; + + memmove(p, &tmp, sizeof(*p)); } -static __inline__ void stw_u(u16 val, u16 *p) +static __inline__ void +stw_u(u16 val, u16 * p) { - u16 tmp = val; - memmove(p, &tmp, sizeof(*p)); + u16 tmp = val; + + memmove(p, &tmp, sizeof(*p)); } -# endif /* __GNUC__ */ +#endif /* __GNUC__ */ /*------------------------- Global Variables ------------------------------*/ -X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */ -X86EMU_intrFuncs _X86EMU_intrTab[256]; +X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */ +X86EMU_intrFuncs _X86EMU_intrTab[256]; /*----------------------------- Implementation ----------------------------*/ @@ -155,19 +185,20 @@ Byte value read from emulator memory. REMARKS: Reads a byte value from the emulator memory. ****************************************************************************/ -u8 X86API rdb( - u32 addr) +u8 X86API +rdb(u32 addr) { - u8 val; - - if (addr > M.mem_size - 1) { - DB(printk("mem_read: address %#lx out of range!\n", addr);) - HALT_SYS(); - } - val = *(u8*)(M.mem_base + addr); -DB( if (DEBUG_MEM_TRACE()) - printk("%#08x 1 -> %#x\n", addr, val);) - return val; + u8 val; + + if (addr > M.mem_size - 1) { + DB(printk("mem_read: address %#lx out of range!\n", addr); + ) + HALT_SYS(); + } + val = *(u8 *) (M.mem_base + addr); + DB(if (DEBUG_MEM_TRACE()) + printk("%#08x 1 -> %#x\n", addr, val);) + return val; } /**************************************************************************** @@ -180,26 +211,27 @@ Word value read from emulator memory. REMARKS: Reads a word value from the emulator memory. ****************************************************************************/ -u16 X86API rdw( - u32 addr) +u16 X86API +rdw(u32 addr) { - u16 val = 0; + u16 val = 0; - if (addr > M.mem_size - 2) { - DB(printk("mem_read: address %#lx out of range!\n", addr);) - HALT_SYS(); - } + if (addr > M.mem_size - 2) { + DB(printk("mem_read: address %#lx out of range!\n", addr); + ) + HALT_SYS(); + } #ifdef __BIG_ENDIAN__ - if (addr & 0x1) { - val = (*(u8*)(M.mem_base + addr) | - (*(u8*)(M.mem_base + addr + 1) << 8)); - } - else + if (addr & 0x1) { + val = (*(u8 *) (M.mem_base + addr) | + (*(u8 *) (M.mem_base + addr + 1) << 8)); + } + else #endif - val = ldw_u((u16*)(M.mem_base + addr)); - DB( if (DEBUG_MEM_TRACE()) - printk("%#08x 2 -> %#x\n", addr, val);) - return val; + val = ldw_u((u16 *) (M.mem_base + addr)); + DB(if (DEBUG_MEM_TRACE()) + printk("%#08x 2 -> %#x\n", addr, val);) + return val; } /**************************************************************************** @@ -211,28 +243,29 @@ Long value read from emulator memory. REMARKS: Reads a long value from the emulator memory. ****************************************************************************/ -u32 X86API rdl( - u32 addr) +u32 X86API +rdl(u32 addr) { - u32 val = 0; + u32 val = 0; - if (addr > M.mem_size - 4) { - DB(printk("mem_read: address %#lx out of range!\n", addr);) - HALT_SYS(); - } + if (addr > M.mem_size - 4) { + DB(printk("mem_read: address %#lx out of range!\n", addr); + ) + HALT_SYS(); + } #ifdef __BIG_ENDIAN__ - if (addr & 0x3) { - val = (*(u8*)(M.mem_base + addr + 0) | - (*(u8*)(M.mem_base + addr + 1) << 8) | - (*(u8*)(M.mem_base + addr + 2) << 16) | - (*(u8*)(M.mem_base + addr + 3) << 24)); - } - else + if (addr & 0x3) { + val = (*(u8 *) (M.mem_base + addr + 0) | + (*(u8 *) (M.mem_base + addr + 1) << 8) | + (*(u8 *) (M.mem_base + addr + 2) << 16) | + (*(u8 *) (M.mem_base + addr + 3) << 24)); + } + else #endif - val = ldl_u((u32*)(M.mem_base + addr)); -DB( if (DEBUG_MEM_TRACE()) - printk("%#08x 4 -> %#x\n", addr, val);) - return val; + val = ldl_u((u32 *) (M.mem_base + addr)); + DB(if (DEBUG_MEM_TRACE()) + printk("%#08x 4 -> %#x\n", addr, val);) + return val; } /**************************************************************************** @@ -243,17 +276,17 @@ val - Value to store REMARKS: Writes a byte value to emulator memory. ****************************************************************************/ -void X86API wrb( - u32 addr, - u8 val) +void X86API +wrb(u32 addr, u8 val) { -DB( if (DEBUG_MEM_TRACE()) - printk("%#08x 1 <- %#x\n", addr, val);) - if (addr > M.mem_size - 1) { - DB(printk("mem_write: address %#lx out of range!\n", addr);) - HALT_SYS(); - } - *(u8*)(M.mem_base + addr) = val; + DB(if (DEBUG_MEM_TRACE()) + printk("%#08x 1 <- %#x\n", addr, val);) + if (addr > M.mem_size - 1) { + DB(printk("mem_write: address %#lx out of range!\n", addr); + ) + HALT_SYS(); + } + *(u8 *) (M.mem_base + addr) = val; } /**************************************************************************** @@ -264,24 +297,24 @@ val - Value to store REMARKS: Writes a word value to emulator memory. ****************************************************************************/ -void X86API wrw( - u32 addr, - u16 val) +void X86API +wrw(u32 addr, u16 val) { -DB( if (DEBUG_MEM_TRACE()) - printk("%#08x 2 <- %#x\n", addr, val);) - if (addr > M.mem_size - 2) { - DB(printk("mem_write: address %#lx out of range!\n", addr);) - HALT_SYS(); - } + DB(if (DEBUG_MEM_TRACE()) + printk("%#08x 2 <- %#x\n", addr, val);) + if (addr > M.mem_size - 2) { + DB(printk("mem_write: address %#lx out of range!\n", addr); + ) + HALT_SYS(); + } #ifdef __BIG_ENDIAN__ - if (addr & 0x1) { - *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff; - *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff; - } - else + if (addr & 0x1) { + *(u8 *) (M.mem_base + addr + 0) = (val >> 0) & 0xff; + *(u8 *) (M.mem_base + addr + 1) = (val >> 8) & 0xff; + } + else #endif - stw_u(val,(u16*)(M.mem_base + addr)); + stw_u(val, (u16 *) (M.mem_base + addr)); } /**************************************************************************** @@ -292,26 +325,26 @@ val - Value to store REMARKS: Writes a long value to emulator memory. ****************************************************************************/ -void X86API wrl( - u32 addr, - u32 val) +void X86API +wrl(u32 addr, u32 val) { -DB( if (DEBUG_MEM_TRACE()) - printk("%#08x 4 <- %#x\n", addr, val);) - if (addr > M.mem_size - 4) { - DB(printk("mem_write: address %#lx out of range!\n", addr);) - HALT_SYS(); - } + DB(if (DEBUG_MEM_TRACE()) + printk("%#08x 4 <- %#x\n", addr, val);) + if (addr > M.mem_size - 4) { + DB(printk("mem_write: address %#lx out of range!\n", addr); + ) + HALT_SYS(); + } #ifdef __BIG_ENDIAN__ - if (addr & 0x1) { - *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff; - *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff; - *(u8*)(M.mem_base + addr + 2) = (val >> 16) & 0xff; - *(u8*)(M.mem_base + addr + 3) = (val >> 24) & 0xff; - } - else + if (addr & 0x1) { + *(u8 *) (M.mem_base + addr + 0) = (val >> 0) & 0xff; + *(u8 *) (M.mem_base + addr + 1) = (val >> 8) & 0xff; + *(u8 *) (M.mem_base + addr + 2) = (val >> 16) & 0xff; + *(u8 *) (M.mem_base + addr + 3) = (val >> 24) & 0xff; + } + else #endif - stl_u(val,(u32*)(M.mem_base + addr)); + stl_u(val, (u32 *) (M.mem_base + addr)); } /**************************************************************************** @@ -322,12 +355,12 @@ RETURN: REMARKS: Default PIO byte read function. Doesn't perform real inb. ****************************************************************************/ -static u8 X86API p_inb( - X86EMU_pioAddr addr) +static u8 X86API +p_inb(X86EMU_pioAddr addr) { -DB( if (DEBUG_IO_TRACE()) - printk("inb %#04x \n", addr);) - return 0; + DB(if (DEBUG_IO_TRACE()) + printk("inb %#04x \n", addr);) + return 0; } /**************************************************************************** @@ -338,12 +371,12 @@ RETURN: REMARKS: Default PIO word read function. Doesn't perform real inw. ****************************************************************************/ -static u16 X86API p_inw( - X86EMU_pioAddr addr) +static u16 X86API +p_inw(X86EMU_pioAddr addr) { -DB( if (DEBUG_IO_TRACE()) - printk("inw %#04x \n", addr);) - return 0; + DB(if (DEBUG_IO_TRACE()) + printk("inw %#04x \n", addr);) + return 0; } /**************************************************************************** @@ -354,12 +387,12 @@ RETURN: REMARKS: Default PIO long read function. Doesn't perform real inl. ****************************************************************************/ -static u32 X86API p_inl( - X86EMU_pioAddr addr) +static u32 X86API +p_inl(X86EMU_pioAddr addr) { -DB( if (DEBUG_IO_TRACE()) - printk("inl %#04x \n", addr);) - return 0; + DB(if (DEBUG_IO_TRACE()) + printk("inl %#04x \n", addr);) + return 0; } /**************************************************************************** @@ -369,13 +402,12 @@ val - Value to store REMARKS: Default PIO byte write function. Doesn't perform real outb. ****************************************************************************/ -static void X86API p_outb( - X86EMU_pioAddr addr, - u8 val) +static void X86API +p_outb(X86EMU_pioAddr addr, u8 val) { -DB( if (DEBUG_IO_TRACE()) - printk("outb %#02x -> %#04x \n", val, addr);) - return; + DB(if (DEBUG_IO_TRACE()) + printk("outb %#02x -> %#04x \n", val, addr);) + return; } /**************************************************************************** @@ -385,13 +417,12 @@ val - Value to store REMARKS: Default PIO word write function. Doesn't perform real outw. ****************************************************************************/ -static void X86API p_outw( - X86EMU_pioAddr addr, - u16 val) +static void X86API +p_outw(X86EMU_pioAddr addr, u16 val) { -DB( if (DEBUG_IO_TRACE()) - printk("outw %#04x -> %#04x \n", val, addr);) - return; + DB(if (DEBUG_IO_TRACE()) + printk("outw %#04x -> %#04x \n", val, addr);) + return; } /**************************************************************************** @@ -401,29 +432,29 @@ val - Value to store REMARKS: Default PIO ;ong write function. Doesn't perform real outl. ****************************************************************************/ -static void X86API p_outl( - X86EMU_pioAddr addr, - u32 val) +static void X86API +p_outl(X86EMU_pioAddr addr, u32 val) { -DB( if (DEBUG_IO_TRACE()) - printk("outl %#08x -> %#04x \n", val, addr);) - return; + DB(if (DEBUG_IO_TRACE()) + printk("outl %#08x -> %#04x \n", val, addr);) + return; } /*------------------------- Global Variables ------------------------------*/ -u8 (X86APIP sys_rdb)(u32 addr) = rdb; -u16 (X86APIP sys_rdw)(u32 addr) = rdw; -u32 (X86APIP sys_rdl)(u32 addr) = rdl; -void (X86APIP sys_wrb)(u32 addr,u8 val) = wrb; -void (X86APIP sys_wrw)(u32 addr,u16 val) = wrw; -void (X86APIP sys_wrl)(u32 addr,u32 val) = wrl; -u8 (X86APIP sys_inb)(X86EMU_pioAddr addr) = p_inb; -u16 (X86APIP sys_inw)(X86EMU_pioAddr addr) = p_inw; -u32 (X86APIP sys_inl)(X86EMU_pioAddr addr) = p_inl; -void (X86APIP sys_outb)(X86EMU_pioAddr addr, u8 val) = p_outb; -void (X86APIP sys_outw)(X86EMU_pioAddr addr, u16 val) = p_outw; -void (X86APIP sys_outl)(X86EMU_pioAddr addr, u32 val) = p_outl; +u8(X86APIP sys_rdb) (u32 addr) = rdb; +u16(X86APIP sys_rdw) (u32 addr) = rdw; +u32(X86APIP sys_rdl) (u32 addr) = rdl; +void (X86APIP sys_wrb) (u32 addr, u8 val) = wrb; +void (X86APIP sys_wrw) (u32 addr, u16 val) = wrw; +void (X86APIP sys_wrl) (u32 addr, u32 val) = wrl; + +u8(X86APIP sys_inb) (X86EMU_pioAddr addr) = p_inb; +u16(X86APIP sys_inw) (X86EMU_pioAddr addr) = p_inw; +u32(X86APIP sys_inl) (X86EMU_pioAddr addr) = p_inl; +void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val) = p_outb; +void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val) = p_outw; +void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val) = p_outl; /*----------------------------- Setup -------------------------------------*/ @@ -436,8 +467,8 @@ This function is used to set the pointers to functions which access memory space, allowing the user application to override these functions and hook them out as necessary for their application. ****************************************************************************/ -void X86EMU_setupMemFuncs( - X86EMU_memFuncs *funcs) +void +X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs) { sys_rdb = funcs->rdb; sys_rdw = funcs->rdw; @@ -456,8 +487,8 @@ This function is used to set the pointers to functions which access I/O space, allowing the user application to override these functions and hook them out as necessary for their application. ****************************************************************************/ -void X86EMU_setupPioFuncs( - X86EMU_pioFuncs *funcs) +void +X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs) { sys_inb = funcs->inb; sys_inw = funcs->inw; @@ -480,17 +511,17 @@ in the emulator via the interrupt vector table. This allows the application to get control when the code being emulated executes specific software interrupts. ****************************************************************************/ -void X86EMU_setupIntrFuncs( - X86EMU_intrFuncs funcs[]) +void +X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]) { int i; - - for (i=0; i < 256; i++) - _X86EMU_intrTab[i] = NULL; - if (funcs) { - for (i = 0; i < 256; i++) - _X86EMU_intrTab[i] = funcs[i]; - } + + for (i = 0; i < 256; i++) + _X86EMU_intrTab[i] = NULL; + if (funcs) { + for (i = 0; i < 256; i++) + _X86EMU_intrTab[i] = funcs[i]; + } } /**************************************************************************** @@ -505,15 +536,15 @@ so that the code in the emulator will continue processing the software interrupt as per normal. This essentially allows system code to actively hook and handle certain software interrupts as necessary. ****************************************************************************/ -void X86EMU_prepareForInt( - int num) +void +X86EMU_prepareForInt(int num) { - push_word((u16)M.x86.R_FLG); + push_word((u16) M.x86.R_FLG); CLEAR_FLAG(F_IF); CLEAR_FLAG(F_TF); push_word(M.x86.R_CS); M.x86.R_CS = mem_access_word(num * 4 + 2); push_word(M.x86.R_IP); M.x86.R_IP = mem_access_word(num * 4); - M.x86.intr = 0; + M.x86.intr = 0; } |