The Pedigree Project  0.1
prim_ops.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_PRIM_OPS_H
21 #define __X86EMU_PRIM_OPS_H
22 
23 #ifdef __cplusplus
24 extern "C" { /* Use "C" linkage when in C++ mode */
25 #endif
26 
27 u16 aaa_word(u16 d);
28 u16 aas_word(u16 d);
29 u16 aad_word(u16 d);
30 u16 aam_word(u8 d);
31 u8 adc_byte(u8 d, u8 s);
32 u16 adc_word(u16 d, u16 s);
33 u32 adc_long(u32 d, u32 s);
34 u8 add_byte(u8 d, u8 s);
35 u16 add_word(u16 d, u16 s);
36 u32 add_long(u32 d, u32 s);
37 u8 and_byte(u8 d, u8 s);
38 u16 and_word(u16 d, u16 s);
39 u32 and_long(u32 d, u32 s);
40 u8 cmp_byte(u8 d, u8 s);
41 u16 cmp_word(u16 d, u16 s);
42 u32 cmp_long(u32 d, u32 s);
43 u8 daa_byte(u8 d);
44 u8 das_byte(u8 d);
45 u8 dec_byte(u8 d);
46 u16 dec_word(u16 d);
47 u32 dec_long(u32 d);
48 u8 inc_byte(u8 d);
49 u16 inc_word(u16 d);
50 u32 inc_long(u32 d);
51 u8 or_byte(u8 d, u8 s);
52 u16 or_word(u16 d, u16 s);
53 u32 or_long(u32 d, u32 s);
54 u8 neg_byte(u8 s);
55 u16 neg_word(u16 s);
56 u32 neg_long(u32 s);
57 u8 not_byte(u8 s);
58 u16 not_word(u16 s);
59 u32 not_long(u32 s);
60 u8 rcl_byte(u8 d, u8 s);
61 u16 rcl_word(u16 d, u8 s);
62 u32 rcl_long(u32 d, u8 s);
63 u8 rcr_byte(u8 d, u8 s);
64 u16 rcr_word(u16 d, u8 s);
65 u32 rcr_long(u32 d, u8 s);
66 u8 rol_byte(u8 d, u8 s);
67 u16 rol_word(u16 d, u8 s);
68 u32 rol_long(u32 d, u8 s);
69 u8 ror_byte(u8 d, u8 s);
70 u16 ror_word(u16 d, u8 s);
71 u32 ror_long(u32 d, u8 s);
72 u8 shl_byte(u8 d, u8 s);
73 u16 shl_word(u16 d, u8 s);
74 u32 shl_long(u32 d, u8 s);
75 u8 shr_byte(u8 d, u8 s);
76 u16 shr_word(u16 d, u8 s);
77 u32 shr_long(u32 d, u8 s);
78 u8 sar_byte(u8 d, u8 s);
79 u16 sar_word(u16 d, u8 s);
80 u32 sar_long(u32 d, u8 s);
81 u16 shld_word(u16 d, u16 fill, u8 s);
82 u32 shld_long(u32 d, u32 fill, u8 s);
83 u16 shrd_word(u16 d, u16 fill, u8 s);
84 u32 shrd_long(u32 d, u32 fill, u8 s);
85 u8 sbb_byte(u8 d, u8 s);
86 u16 sbb_word(u16 d, u16 s);
87 u32 sbb_long(u32 d, u32 s);
88 u8 sub_byte(u8 d, u8 s);
89 u16 sub_word(u16 d, u16 s);
90 u32 sub_long(u32 d, u32 s);
91 void test_byte(u8 d, u8 s);
92 void test_word(u16 d, u16 s);
93 void test_long(u32 d, u32 s);
94 u8 xor_byte(u8 d, u8 s);
95 u16 xor_word(u16 d, u16 s);
96 u32 xor_long(u32 d, u32 s);
97 void imul_byte(u8 s);
98 void imul_word(u16 s);
99 void imul_long(u32 s);
100 void imul_long_direct(u32 *res_lo, u32 *res_hi, u32 d, u32 s);
101 void mul_byte(u8 s);
102 void mul_word(u16 s);
103 void mul_long(u32 s);
104 void idiv_byte(u8 s);
105 void idiv_word(u16 s);
106 void idiv_long(u32 s);
107 void div_byte(u8 s);
108 void div_word(u16 s);
109 void div_long(u32 s);
110 void ins(int size);
111 void outs(int size);
112 u16 mem_access_word(int addr);
113 void push_word(u16 w);
114 void push_long(u32 w);
115 u16 pop_word(void);
116 u32 pop_long(void);
117 
118 #ifdef __cplusplus
119 } /* End of "C" linkage for C++ */
120 #endif
121 
122 #endif /* __X86EMU_PRIM_OPS_H */