PAPI 7.1.0.0
Loading...
Searching...
No Matches
m68k.h File Reference
Include dependency graph for m68k.h:

Go to the source code of this file.

Macros

#define AO_HAVE_test_and_set_full
 
#define AO_HAVE_compare_and_swap_full
 
#define AO_T_IS_INT
 

Typedefs

typedef unsigned long AO_t __attribute__((__aligned__(4)))
 

Functions

AO_INLINE AO_TS_VAL_t AO_test_and_set_full (volatile AO_TS_t *addr)
 
AO_INLINE int AO_compare_and_swap_full (volatile AO_t *addr, AO_t old, AO_t new_val)
 

Macro Definition Documentation

◆ AO_HAVE_compare_and_swap_full

#define AO_HAVE_compare_and_swap_full

Definition at line 64 of file m68k.h.

◆ AO_HAVE_test_and_set_full

#define AO_HAVE_test_and_set_full

Definition at line 48 of file m68k.h.

◆ AO_T_IS_INT

#define AO_T_IS_INT

Definition at line 68 of file m68k.h.

Typedef Documentation

◆ __attribute__

int __leaf__ __attribute__

Definition at line 21 of file m68k.h.

Function Documentation

◆ AO_compare_and_swap_full()

AO_INLINE int AO_compare_and_swap_full ( volatile AO_t addr,
AO_t  old,
AO_t  new_val 
)

Definition at line 52 of file m68k.h.

54{
55 char result;
56
57 __asm__ __volatile__(
58 "cas.l %3,%4,%1; seq %0"
59 : "=d" (result), "=m" (*addr)
60 : "m" (*addr), "d" (old), "d" (new_val)
61 : "memory");
62 return -result;
63}
volatile int result

◆ AO_test_and_set_full()

AO_INLINE AO_TS_VAL_t AO_test_and_set_full ( volatile AO_TS_t addr)

Definition at line 33 of file m68k.h.

33 {
34 AO_TS_t oldval;
35
36 /* The value at addr is semi-phony. */
37 /* 'tas' sets bit 7 while the return */
38 /* value pretends all bits were set, */
39 /* which at least matches AO_TS_SET. */
40 __asm__ __volatile__(
41 "tas %1; sne %0"
42 : "=d" (oldval), "=m" (*addr)
43 : "m" (*addr)
44 : "memory");
45 /* This cast works due to the above. */
46 return (AO_TS_VAL_t)oldval;
47}
#define AO_TS_t
Definition: gcc/hppa.h:39
#define AO_TS_VAL_t
Definition: gcc/hppa.h:44