Fix IRQ flag handling naming
[linux-2.6/cjktty.git] / arch / cris / include / arch-v32 / arch / system.h
blob76cea99eaa6012a5e7f6335cf215e74dd1fc860c
1 #ifndef _ASM_CRIS_ARCH_SYSTEM_H
2 #define _ASM_CRIS_ARCH_SYSTEM_H
5 /* Read the CPU version register. */
6 static inline unsigned long rdvr(void)
8 unsigned char vr;
10 __asm__ __volatile__ ("move $vr, %0" : "=rm" (vr));
11 return vr;
14 #define cris_machine_name "crisv32"
16 /* Read the user-mode stack pointer. */
17 static inline unsigned long rdusp(void)
19 unsigned long usp;
21 __asm__ __volatile__ ("move $usp, %0" : "=rm" (usp));
22 return usp;
25 /* Read the current stack pointer. */
26 static inline unsigned long rdsp(void)
28 unsigned long sp;
30 __asm__ __volatile__ ("move.d $sp, %0" : "=rm" (sp));
31 return sp;
34 /* Write the user-mode stack pointer. */
35 #define wrusp(usp) __asm__ __volatile__ ("move %0, $usp" : : "rm" (usp))
37 #define nop() __asm__ __volatile__ ("nop");
39 #define xchg(ptr,x) \
40 ((__typeof__(*(ptr)))__xchg((unsigned long) (x),(ptr),sizeof(*(ptr))))
42 #define tas(ptr) (xchg((ptr),1))
44 struct __xchg_dummy { unsigned long a[100]; };
45 #define __xg(x) ((struct __xchg_dummy *)(x))
47 #endif /* _ASM_CRIS_ARCH_SYSTEM_H */