03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/****************************************************************************
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Realmode X86 Emulator Library
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Copyright (C) 1996-1999 SciTech Software, Inc.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Copyright (C) David Mosberger-Tang
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Copyright (C) 1999 Egbert Eich
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* ========================================================================
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Permission to use, copy, modify, distribute, and sell this software and
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* its documentation for any purpose is hereby granted without fee,
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* provided that the above copyright notice appear in all copies and that
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* both that copyright notice and this permission notice appear in
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* supporting documentation, and that the name of the authors not be used
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* in advertising or publicity pertaining to distribution of the software
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* without specific, written prior permission. The authors makes no
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* representations about the suitability of this software for any purpose.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* It is provided "as is" without express or implied warranty.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* PERFORMANCE OF THIS SOFTWARE.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* ========================================================================
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Language: ANSI C
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Environment: Any
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Developer: Kendall Bennett
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Description: Header file for public specific functions.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* Any application linking against us should only
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync* include this header
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync****************************************************************************/
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/*---------------------- Macros and type definitions ----------------------*/
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#pragma PACK /* Don't pack structs with function pointers! */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/****************************************************************************
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncData structure containing ponters to programmed I/O functions used by the
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncemulator. This is used so that the user program can hook all programmed
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncI/O for the emulator to handled as necessary by the user program. By
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncdefault the emulator contains simple functions that do not do access the
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsynchardware in any way. To allow the emualtor access the hardware, you will
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncneed to override the programmed I/O functions using the X86EMU_setupPioFuncs
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncinb - Function to read a byte from an I/O port
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncinw - Function to read a word from an I/O port
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncinl - Function to read a dword from an I/O port
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncoutb - Function to write a byte to an I/O port
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncoutw - Function to write a word to an I/O port
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncoutl - Function to write a dword to an I/O port
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync****************************************************************************/
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsynctypedef struct {
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync void (X86APIP outw) (X86EMU_pioAddr addr, u16 val);
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync void (X86APIP outl) (X86EMU_pioAddr addr, u32 val);
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/****************************************************************************
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncData structure containing ponters to memory access functions used by the
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncemulator. This is used so that the user program can hook all memory
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncaccess functions as necessary for the emulator. By default the emulator
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsynccontains simple functions that only access the internal memory of the
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncemulator. If you need specialised functions to handle access to different
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsynctypes of memory (ie: hardware framebuffer accesses and BIOS memory access
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncetc), you will need to override this using the X86EMU_setupMemFuncs
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncrdb - Function to read a byte from an address
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncrdw - Function to read a word from an address
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncrdl - Function to read a dword from an address
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncwrb - Function to write a byte to an address
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncwrw - Function to write a word to an address
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsyncwrl - Function to write a dword to an address
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync****************************************************************************/
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsynctypedef struct {
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/****************************************************************************
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync Here are the default memory read and write
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync function in case they are needed as fallbacks.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync***************************************************************************/
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/*--------------------- type definitions -----------------------------------*/
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/*-------------------------- Function Prototypes --------------------------*/
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync void X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs);
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync void X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs);
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync printk("halt_sys: file %s, line %d\n", __FILE__, __LINE__), \
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/* Debug options */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#define DEBUG_DECODE_F 0x000001 /* print decoded instruction */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#define DEBUG_TRACE_F 0x000002 /* dump regs before/after execution */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#define DEBUG_SYSINT_F 0x000200 /* bios system interrupts. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#define DEBUG_SYS_F (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync void X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync} /* End of "C" linkage for C++ */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#endif /* __X86EMU_X86EMU_H */