[TG3]: Add tagged status support.
[linux-2.6/verdex.git] / include / asm-cris / arch-v10 / system.h
blob781ca30229a84135df75a32654124ceae88b3b8e
1 #ifndef __ASM_CRIS_ARCH_SYSTEM_H
2 #define __ASM_CRIS_ARCH_SYSTEM_H
4 #include <linux/config.h>
6 /* read the CPU version register */
8 extern inline unsigned long rdvr(void) {
9 unsigned char vr;
10 __asm__ volatile ("move $vr,%0" : "=rm" (vr));
11 return vr;
14 /* read/write the user-mode stackpointer */
16 extern inline unsigned long rdusp(void) {
17 unsigned long usp;
18 __asm__ __volatile__("move $usp,%0" : "=rm" (usp));
19 return usp;
22 #define wrusp(usp) \
23 __asm__ __volatile__("move %0,$usp" : /* no outputs */ : "rm" (usp))
25 /* read the current stackpointer */
27 extern inline unsigned long rdsp(void) {
28 unsigned long sp;
29 __asm__ __volatile__("move.d $sp,%0" : "=rm" (sp));
30 return sp;
33 extern inline unsigned long _get_base(char * addr)
35 return 0;
38 #define nop() __asm__ __volatile__ ("nop");
40 #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
41 #define tas(ptr) (xchg((ptr),1))
43 struct __xchg_dummy { unsigned long a[100]; };
44 #define __xg(x) ((struct __xchg_dummy *)(x))
46 /* interrupt control.. */
47 #define local_save_flags(x) __asm__ __volatile__ ("move $ccr,%0" : "=rm" (x) : : "memory");
48 #define local_irq_restore(x) __asm__ __volatile__ ("move %0,$ccr" : : "rm" (x) : "memory");
49 #define local_irq_disable() __asm__ __volatile__ ( "di" : : :"memory");
50 #define local_irq_enable() __asm__ __volatile__ ( "ei" : : :"memory");
52 #define irqs_disabled() \
53 ({ \
54 unsigned long flags; \
55 local_save_flags(flags); \
56 !(flags & (1<<5)); \
59 /* For spinlocks etc */
60 #define local_irq_save(x) __asm__ __volatile__ ("move $ccr,%0\n\tdi" : "=rm" (x) : : "memory");
62 #endif