1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef _PT_MACHINE_H
- #define _PT_MACHINE_H 1
- #ifndef PT_EI
- # define PT_EI __extern_always_inline
- #endif
- extern long int testandset (int *spinlock);
- extern int __compare_and_swap (long int *p, long int oldval, long int newval);
- PT_EI long int
- testandset (int *spinlock)
- {
- int ret;
- __asm__ __volatile__("ldstub %1,%0"
- : "=r"(ret), "=m"(*spinlock)
- : "m"(*spinlock));
- return ret;
- }
- #define MEMORY_BARRIER() __asm__ __volatile__("stbar" : : : "memory")
- #define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
- register char *stack_pointer __asm__("%sp");
- struct _pthread_descr_struct;
- register struct _pthread_descr_struct *__thread_self __asm__("%g7");
- #define THREAD_SELF __thread_self
- #define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
- #define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
- #define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
- #define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
- #define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
- #define FLOATING_STACKS 1
- #define ARCH_STACK_MAX_SIZE 8*1024*1024
- #endif /* pt-machine.h */
|