123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef _PT_MACHINE_H
- #define _PT_MACHINE_H 1
- #include <features.h>
- #ifndef PT_EI
- # define PT_EI __extern_always_inline
- #endif
- PT_EI long int
- testandset (int *spinlock)
- {
- char ret;
- __asm__ __volatile__(
- "sub.w %0,%0\n\t"
- "stc ccr,@-sp\n\t"
- "orc #0x80,ccr\n\t"
- "bld #0,@%2\n\t"
- "bset #0,@%2\n\t"
- "rotxl.w %0\n\t"
- "ldc @sp+,ccr\n\t"
- :"=r"(ret),"=m"(*spinlock)
- :"g"(spinlock)
- :"cc");
- return ret;
- }
- #define CURRENT_STACK_FRAME stack_pointer
- register char * stack_pointer __asm__ ("%sp");
- #endif
|