Use lookup table for PCI class descriptions.
[qemu/mini2440.git] / target-arm / op_mem.h
blob29fd85bc32ad111a4ca0f1906007b580df473dff
1 /* ARM memory operations. */
3 /* Load from address T1 into T0. */
4 #define MEM_LD_OP(name) \
5 void OPPROTO glue(op_ld##name,MEMSUFFIX)(void) \
6 { \
7 T0 = glue(ld##name,MEMSUFFIX)(T1); \
8 FORCE_RET(); \
11 MEM_LD_OP(ub)
12 MEM_LD_OP(sb)
13 MEM_LD_OP(uw)
14 MEM_LD_OP(sw)
15 MEM_LD_OP(l)
17 #undef MEM_LD_OP
19 /* Store T0 to address T1. */
20 #define MEM_ST_OP(name) \
21 void OPPROTO glue(op_st##name,MEMSUFFIX)(void) \
22 { \
23 glue(st##name,MEMSUFFIX)(T1, T0); \
24 FORCE_RET(); \
27 MEM_ST_OP(b)
28 MEM_ST_OP(w)
29 MEM_ST_OP(l)
31 #undef MEM_ST_OP
33 /* Swap T0 with memory at address T1. */
34 /* ??? Is this exception safe? */
35 #define MEM_SWP_OP(name, lname) \
36 void OPPROTO glue(op_swp##name,MEMSUFFIX)(void) \
37 { \
38 uint32_t tmp; \
39 cpu_lock(); \
40 tmp = glue(ld##lname,MEMSUFFIX)(T1); \
41 glue(st##name,MEMSUFFIX)(T1, T0); \
42 T0 = tmp; \
43 cpu_unlock(); \
44 FORCE_RET(); \
47 MEM_SWP_OP(b, ub)
48 MEM_SWP_OP(l, l)
50 #undef MEM_SWP_OP
52 /* Floating point load/store. Address is in T1 */
53 #define VFP_MEM_OP(p, w) \
54 void OPPROTO glue(op_vfp_ld##p,MEMSUFFIX)(void) \
55 { \
56 FT0##p = glue(ldf##w,MEMSUFFIX)(T1); \
57 FORCE_RET(); \
58 } \
59 void OPPROTO glue(op_vfp_st##p,MEMSUFFIX)(void) \
60 { \
61 glue(stf##w,MEMSUFFIX)(T1, FT0##p); \
62 FORCE_RET(); \
65 VFP_MEM_OP(s,l)
66 VFP_MEM_OP(d,q)
68 #undef VFP_MEM_OP
70 #undef MEMSUFFIX