Revision 9ee6e8bb target-arm/op_mem.h
b/target-arm/op_mem.h | ||
---|---|---|
1 | 1 |
/* ARM memory operations. */ |
2 | 2 |
|
3 |
void helper_ld(uint32_t); |
|
3 | 4 |
/* Load from address T1 into T0. */ |
4 | 5 |
#define MEM_LD_OP(name) \ |
5 | 6 |
void OPPROTO glue(op_ld##name,MEMSUFFIX)(void) \ |
... | ... | |
49 | 50 |
|
50 | 51 |
#undef MEM_SWP_OP |
51 | 52 |
|
53 |
/* Load-locked, store exclusive. */ |
|
54 |
#define EXCLUSIVE_OP(suffix, ldsuffix) \ |
|
55 |
void OPPROTO glue(op_ld##suffix##ex,MEMSUFFIX)(void) \ |
|
56 |
{ \ |
|
57 |
cpu_lock(); \ |
|
58 |
helper_mark_exclusive(env, T1); \ |
|
59 |
T0 = glue(ld##ldsuffix,MEMSUFFIX)(T1); \ |
|
60 |
cpu_unlock(); \ |
|
61 |
FORCE_RET(); \ |
|
62 |
} \ |
|
63 |
\ |
|
64 |
void OPPROTO glue(op_st##suffix##ex,MEMSUFFIX)(void) \ |
|
65 |
{ \ |
|
66 |
int failed; \ |
|
67 |
cpu_lock(); \ |
|
68 |
failed = helper_test_exclusive(env, T1); \ |
|
69 |
/* ??? Is it safe to hold the cpu lock over a store? */ \ |
|
70 |
if (!failed) { \ |
|
71 |
glue(st##suffix,MEMSUFFIX)(T1, T0); \ |
|
72 |
} \ |
|
73 |
T0 = failed; \ |
|
74 |
cpu_unlock(); \ |
|
75 |
FORCE_RET(); \ |
|
76 |
} |
|
77 |
|
|
78 |
EXCLUSIVE_OP(b, ub) |
|
79 |
EXCLUSIVE_OP(w, uw) |
|
80 |
EXCLUSIVE_OP(l, l) |
|
81 |
|
|
82 |
#undef EXCLUSIVE_OP |
|
83 |
|
|
84 |
/* Load exclusive T0:T1 from address T1. */ |
|
85 |
void OPPROTO glue(op_ldqex,MEMSUFFIX)(void) |
|
86 |
{ |
|
87 |
cpu_lock(); |
|
88 |
helper_mark_exclusive(env, T1); |
|
89 |
T0 = glue(ldl,MEMSUFFIX)(T1); |
|
90 |
T1 = glue(ldl,MEMSUFFIX)((T1 + 4)); |
|
91 |
cpu_unlock(); |
|
92 |
FORCE_RET(); |
|
93 |
} |
|
94 |
|
|
95 |
/* Store exclusive T0:T2 to address T1. */ |
|
96 |
void OPPROTO glue(op_stqex,MEMSUFFIX)(void) |
|
97 |
{ |
|
98 |
int failed; |
|
99 |
cpu_lock(); |
|
100 |
failed = helper_test_exclusive(env, T1); |
|
101 |
/* ??? Is it safe to hold the cpu lock over a store? */ |
|
102 |
if (!failed) { |
|
103 |
glue(stl,MEMSUFFIX)(T1, T0); |
|
104 |
glue(stl,MEMSUFFIX)((T1 + 4), T2); |
|
105 |
} |
|
106 |
T0 = failed; |
|
107 |
cpu_unlock(); |
|
108 |
FORCE_RET(); |
|
109 |
} |
|
110 |
|
|
52 | 111 |
/* Floating point load/store. Address is in T1 */ |
53 | 112 |
#define VFP_MEM_OP(p, w) \ |
54 | 113 |
void OPPROTO glue(op_vfp_ld##p,MEMSUFFIX)(void) \ |
Also available in: Unified diff