1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #ifndef _PT_MACHINE_H
- #define _PT_MACHINE_H 1
- #include <features.h>
- #include <bits/initspin.h>
- #ifndef PT_EI
- # define PT_EI __extern_always_inline
- #endif
- #define CURRENT_STACK_FRAME stack_pointer
- register char * stack_pointer __asm__ ("%r30");
- #define xstr(s) str(s)
- #define str(s) #s
- PT_EI long int
- testandset (int *spinlock)
- {
- int ret;
- __asm__ __volatile__(
- "ldcw 0(%2),%0"
- : "=r"(ret), "=m"(*spinlock)
- : "r"(spinlock));
- return ret == 0;
- }
- #undef str
- #undef xstr
- #endif
|