123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #ifndef _PT_MACHINE_H
- #define _PT_MACHINE_H 1
- #include <features.h>
- #ifndef __ASSEMBLER__
- #ifndef PT_EI
- # define PT_EI __extern_always_inline
- #endif
- extern long int testandset (int *spinlock);
- PT_EI long int
- testandset (int *spinlock)
- {
- int ret;
- __asm__ __volatile__(
- "tas.b @%1\n\t"
- "movt %0"
- : "=r" (ret)
- : "r" (spinlock)
- : "memory", "cc");
- return (ret == 0);
- }
- #define FLOATING_STACKS 1
- #define ARCH_STACK_MAX_SIZE 32*1024*1024
- #define CURRENT_STACK_FRAME stack_pointer
- register char * stack_pointer __asm__ ("r15");
- struct _pthread_descr_struct;
- #define THREAD_SELF \
- ({ struct _pthread_descr_struct *self; \
- __asm__("stc gbr,%0" : "=r" (self)); self;})
- #define INIT_THREAD_SELF(descr, nr) \
- ({ __asm__ __volatile__("ldc %0,gbr" : : "r" (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))
- #endif /* __ASSEMBLER__ */
- #endif /* pt-machine.h */
|