The Pedigree Project  0.1
x86emui.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef __X86EMU_X86EMUI_H
21 #define __X86EMU_X86EMUI_H
22 #define NO_SYS_HEADERS
23 /* If we are compiling in C++ mode, we can compile some functions as
24  * inline to increase performance (however the code size increases quite
25  * dramatically in this case).
26  */
27 
28 #if defined(__cplusplus) && !defined(_NO_INLINE)
29 #define _INLINE inline
30 #else
31 #define _INLINE static
32 #endif
33 
34 /* Get rid of unused parameters in C++ compilation mode */
35 
36 #ifdef __cplusplus
37 #define X86EMU_UNUSED(v)
38 #else
39 #define X86EMU_UNUSED(v) v
40 #endif
41 
42 #include "../x86emu.h"
43 #include "../x86emu/debug.h"
44 #include "../x86emu/decode.h"
45 #include "../x86emu/fpu.h"
46 #include "../x86emu/fpu_regs.h"
47 #include "../x86emu/ops.h"
48 #include "../x86emu/prim_ops.h"
49 #include "../x86emu/regs.h"
50 
51 #ifndef NO_SYS_HEADERS
52 #include <stdio.h>
53 #include <stdlib.h>
54 #include <string.h>
55 #endif
56 /*--------------------------- Inline Functions ----------------------------*/
57 
58 #ifdef __cplusplus
59 extern "C" { /* Use "C" linkage when in C++ mode */
60 #endif
61 
62 extern u8(X86APIP sys_rdb)(u32 addr);
63 extern u16(X86APIP sys_rdw)(u32 addr);
64 extern u32(X86APIP sys_rdl)(u32 addr);
65 extern void(X86APIP sys_wrb)(u32 addr, u8 val);
66 extern void(X86APIP sys_wrw)(u32 addr, u16 val);
67 extern void(X86APIP sys_wrl)(u32 addr, u32 val);
68 
69 extern u8(X86APIP sys_inb)(X86EMU_pioAddr addr);
70 extern u16(X86APIP sys_inw)(X86EMU_pioAddr addr);
71 extern u32(X86APIP sys_inl)(X86EMU_pioAddr addr);
72 extern void(X86APIP sys_outb)(X86EMU_pioAddr addr, u8 val);
73 extern void(X86APIP sys_outw)(X86EMU_pioAddr addr, u16 val);
74 extern void(X86APIP sys_outl)(X86EMU_pioAddr addr, u32 val);
75 
76 #ifdef __cplusplus
77 } /* End of "C" linkage for C++ */
78 #endif
79 
80 #endif /* __X86EMU_X86EMUI_H */