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