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