forked from ntddk/temu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TEMU_mem_def.h
133 lines (111 loc) · 2.61 KB
/
TEMU_mem_def.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
TEMU is Copyright (C) 2006-2010, BitBlaze Team.
TEMU is based on QEMU, a whole-system emulator. You can redistribute
and modify it under the terms of the GNU LGPL, version 2.1 or later,
but it is made available WITHOUT ANY WARRANTY.
*/
#include "TEMU_physaddr_info.h"
#define TC_ldub_raw(a, t) \
( \
taintcheck_reg_clean2(t, 4), \
taintcheck_mem2reg(laddr((a)), 1, t), \
ldub_raw(a) \
)
#define TC_ldsb_raw(a, t) \
( \
taintcheck_reg_clean2(t, 4), \
taintcheck_mem2reg(laddr((a)), 1, t), \
ldsb_raw(a) \
)
#define TC_lduw_raw(a, t) \
( \
taintcheck_reg_clean2(t, 4), \
taintcheck_mem2reg(laddr((a)), 2, t), \
lduw_raw(a) \
)
#define TC_ldsw_raw(a, t) \
( \
taintcheck_reg_clean2(t, 4), \
taintcheck_mem2reg(laddr((a)), 2, t), \
ldsw_raw(a) \
)
#define TC_ldl_raw(a, t) \
( \
taintcheck_mem2reg(laddr((a)), 4, t), \
ldl_raw(a) \
)
#define TC_ldq_raw(a, t) \
( \
taintcheck_reg_clean2(t, 4), \
ldq_raw(a) \
)
#define TC_stb_raw(a, s, t) \
do { \
taintcheck_reg2mem(t, 1, laddr((a)));\
stb_raw(a, s); \
}while(0);
#define TC_stw_raw(a, s, t) \
do { \
taintcheck_reg2mem(t, 2, laddr((a))); \
stw_raw(a, s); \
}while(0);
#define TC_stl_raw(a, s, t) \
do { \
taintcheck_reg2mem(t, 4, laddr((a))); \
stl_raw(a, s); \
}while(0);
#define TC_stq_raw(a, s, t) \
do { \
stq_raw(a, s); \
taintcheck_mem_clean(a, 8); \
}while(0);
#define TD_ldub_raw(p) \
( \
dump_physaddr_info(1, laddr((p))), \
ldub_raw(p) \
)
#define TD_ldsb_raw(p) \
( \
dump_physaddr_info(1, laddr((p))), \
ldsb_raw(p) \
)
#define TD_lduw_raw(p) \
( \
dump_physaddr_info(2, laddr((p))), \
lduw_raw(p) \
)
#define TD_ldsw_raw(p) \
( \
dump_physaddr_info(2, laddr((p))), \
ldsw_raw(p) \
)
#define TD_ldl_raw(p) \
( \
dump_physaddr_info(4, laddr((p))), \
ldl_raw(p) \
)
#define TD_ldq_raw(p) \
( \
dump_physaddr_info(8, laddr((p))), \
ldq_raw(p) \
)
#define TD_stb_raw(p, v) \
do { \
stb_raw(saddr((p)), v); \
dump_physaddr_info(1, laddr((p))); \
}while(0);
#define TD_stw_raw(p, v) \
do { \
stw_raw(p, v); \
dump_physaddr_info(2, laddr((p))); \
}while(0);
#define TD_stl_raw(p, v) \
do { \
stl_raw(p, v); \
dump_physaddr_info(4, laddr((p))); \
}while(0);
#define TD_stq_raw(p, v) \
do { \
stq_raw(p, v); \
dump_physaddr_info(8, laddr((p))); \
}while(0);