x86emui.h 3.5 KB

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