1*ece92f85SJason Jin /**************************************************************************** 2*ece92f85SJason Jin * 3*ece92f85SJason Jin * Realmode X86 Emulator Library 4*ece92f85SJason Jin * 5*ece92f85SJason Jin * Copyright (C) 1991-2004 SciTech Software, Inc. 6*ece92f85SJason Jin * Copyright (C) David Mosberger-Tang 7*ece92f85SJason Jin * Copyright (C) 1999 Egbert Eich 8*ece92f85SJason Jin * 9*ece92f85SJason Jin * ======================================================================== 10*ece92f85SJason Jin * 11*ece92f85SJason Jin * Permission to use, copy, modify, distribute, and sell this software and 12*ece92f85SJason Jin * its documentation for any purpose is hereby granted without fee, 13*ece92f85SJason Jin * provided that the above copyright notice appear in all copies and that 14*ece92f85SJason Jin * both that copyright notice and this permission notice appear in 15*ece92f85SJason Jin * supporting documentation, and that the name of the authors not be used 16*ece92f85SJason Jin * in advertising or publicity pertaining to distribution of the software 17*ece92f85SJason Jin * without specific, written prior permission. The authors makes no 18*ece92f85SJason Jin * representations about the suitability of this software for any purpose. 19*ece92f85SJason Jin * It is provided "as is" without express or implied warranty. 20*ece92f85SJason Jin * 21*ece92f85SJason Jin * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 22*ece92f85SJason Jin * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 23*ece92f85SJason Jin * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 24*ece92f85SJason Jin * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 25*ece92f85SJason Jin * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 26*ece92f85SJason Jin * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 27*ece92f85SJason Jin * PERFORMANCE OF THIS SOFTWARE. 28*ece92f85SJason Jin * 29*ece92f85SJason Jin * ======================================================================== 30*ece92f85SJason Jin * 31*ece92f85SJason Jin * Language: ANSI C 32*ece92f85SJason Jin * Environment: Any 33*ece92f85SJason Jin * Developer: Kendall Bennett 34*ece92f85SJason Jin * 35*ece92f85SJason Jin * Description: Header file for system specific functions. These functions 36*ece92f85SJason Jin * are always compiled and linked in the OS depedent libraries, 37*ece92f85SJason Jin * and never in a binary portable driver. 38*ece92f85SJason Jin * 39*ece92f85SJason Jin ****************************************************************************/ 40*ece92f85SJason Jin 41*ece92f85SJason Jin #ifndef __X86EMU_X86EMUI_H 42*ece92f85SJason Jin #define __X86EMU_X86EMUI_H 43*ece92f85SJason Jin 44*ece92f85SJason Jin /* If we are compiling in C++ mode, we can compile some functions as 45*ece92f85SJason Jin * inline to increase performance (however the code size increases quite 46*ece92f85SJason Jin * dramatically in this case). 47*ece92f85SJason Jin */ 48*ece92f85SJason Jin 49*ece92f85SJason Jin #if defined(__cplusplus) && !defined(_NO_INLINE) 50*ece92f85SJason Jin #define _INLINE inline 51*ece92f85SJason Jin #else 52*ece92f85SJason Jin #define _INLINE static 53*ece92f85SJason Jin #endif 54*ece92f85SJason Jin 55*ece92f85SJason Jin /* Get rid of unused parameters in C++ compilation mode */ 56*ece92f85SJason Jin 57*ece92f85SJason Jin #ifdef __cplusplus 58*ece92f85SJason Jin #define X86EMU_UNUSED(v) 59*ece92f85SJason Jin #else 60*ece92f85SJason Jin #define X86EMU_UNUSED(v) v 61*ece92f85SJason Jin #endif 62*ece92f85SJason Jin 63*ece92f85SJason Jin #include "x86emu.h" 64*ece92f85SJason Jin #include "x86emu/regs.h" 65*ece92f85SJason Jin #include "x86emu/debug.h" 66*ece92f85SJason Jin #include "x86emu/decode.h" 67*ece92f85SJason Jin #include "x86emu/ops.h" 68*ece92f85SJason Jin #include "x86emu/prim_ops.h" 69*ece92f85SJason Jin #ifndef __KERNEL__ 70*ece92f85SJason Jin #include <stdio.h> 71*ece92f85SJason Jin #include <stdlib.h> 72*ece92f85SJason Jin #include <string.h> 73*ece92f85SJason Jin #endif 74*ece92f85SJason Jin 75*ece92f85SJason Jin /*--------------------------- Inline Functions ----------------------------*/ 76*ece92f85SJason Jin 77*ece92f85SJason Jin #ifdef __cplusplus 78*ece92f85SJason Jin extern "C" { /* Use "C" linkage when in C++ mode */ 79*ece92f85SJason Jin #endif 80*ece92f85SJason Jin 81*ece92f85SJason Jin extern u8(X86APIP sys_rdb) (u32 addr); 82*ece92f85SJason Jin extern u16(X86APIP sys_rdw) (u32 addr); 83*ece92f85SJason Jin extern u32(X86APIP sys_rdl) (u32 addr); 84*ece92f85SJason Jin extern void (X86APIP sys_wrb) (u32 addr, u8 val); 85*ece92f85SJason Jin extern void (X86APIP sys_wrw) (u32 addr, u16 val); 86*ece92f85SJason Jin extern void (X86APIP sys_wrl) (u32 addr, u32 val); 87*ece92f85SJason Jin 88*ece92f85SJason Jin extern u8(X86APIP sys_inb) (X86EMU_pioAddr addr); 89*ece92f85SJason Jin extern u16(X86APIP sys_inw) (X86EMU_pioAddr addr); 90*ece92f85SJason Jin extern u32(X86APIP sys_inl) (X86EMU_pioAddr addr); 91*ece92f85SJason Jin extern void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val); 92*ece92f85SJason Jin extern void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val); 93*ece92f85SJason Jin extern void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val); 94*ece92f85SJason Jin 95*ece92f85SJason Jin #ifdef __cplusplus 96*ece92f85SJason Jin } /* End of "C" linkage for C++ */ 97*ece92f85SJason Jin #endif 98*ece92f85SJason Jin #endif /* __X86EMU_X86EMUI_H */ 99