Revision 8984bd2e target-arm/op_mem.h

b/target-arm/op_mem.h
1 1
/* ARM memory operations.  */
2 2

  
3
/* Swap T0 with memory at address T1.  */
4
/* ??? Is this exception safe?  */
5
#define MEM_SWP_OP(name, lname) \
6
void OPPROTO glue(op_swp##name,MEMSUFFIX)(void) \
7
{ \
8
    uint32_t tmp; \
9
    cpu_lock(); \
10
    tmp = glue(ld##lname,MEMSUFFIX)(T1); \
11
    glue(st##name,MEMSUFFIX)(T1, T0); \
12
    T0 = tmp; \
13
    cpu_unlock(); \
14
    FORCE_RET(); \
15
}
16

  
17
MEM_SWP_OP(b, ub)
18
MEM_SWP_OP(l, l)
19

  
20
#undef MEM_SWP_OP
21

  
22 3
/* Load-locked, store exclusive.  */
23 4
#define EXCLUSIVE_OP(suffix, ldsuffix) \
24 5
void OPPROTO glue(op_ld##suffix##ex,MEMSUFFIX)(void) \

Also available in: Unified diff