diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-cris/arch-v10/system.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-cris/arch-v10/system.h')
-rw-r--r-- | include/asm-cris/arch-v10/system.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/asm-cris/arch-v10/system.h b/include/asm-cris/arch-v10/system.h new file mode 100644 index 000000000000..781ca30229a8 --- /dev/null +++ b/include/asm-cris/arch-v10/system.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #ifndef __ASM_CRIS_ARCH_SYSTEM_H | ||
2 | #define __ASM_CRIS_ARCH_SYSTEM_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | /* read the CPU version register */ | ||
7 | |||
8 | extern inline unsigned long rdvr(void) { | ||
9 | unsigned char vr; | ||
10 | __asm__ volatile ("move $vr,%0" : "=rm" (vr)); | ||
11 | return vr; | ||
12 | } | ||
13 | |||
14 | /* read/write the user-mode stackpointer */ | ||
15 | |||
16 | extern inline unsigned long rdusp(void) { | ||
17 | unsigned long usp; | ||
18 | __asm__ __volatile__("move $usp,%0" : "=rm" (usp)); | ||
19 | return usp; | ||
20 | } | ||
21 | |||
22 | #define wrusp(usp) \ | ||
23 | __asm__ __volatile__("move %0,$usp" : /* no outputs */ : "rm" (usp)) | ||
24 | |||
25 | /* read the current stackpointer */ | ||
26 | |||
27 | extern inline unsigned long rdsp(void) { | ||
28 | unsigned long sp; | ||
29 | __asm__ __volatile__("move.d $sp,%0" : "=rm" (sp)); | ||
30 | return sp; | ||
31 | } | ||
32 | |||
33 | extern inline unsigned long _get_base(char * addr) | ||
34 | { | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | #define nop() __asm__ __volatile__ ("nop"); | ||
39 | |||
40 | #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | ||
41 | #define tas(ptr) (xchg((ptr),1)) | ||
42 | |||
43 | struct __xchg_dummy { unsigned long a[100]; }; | ||
44 | #define __xg(x) ((struct __xchg_dummy *)(x)) | ||
45 | |||
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"); | ||
51 | |||
52 | #define irqs_disabled() \ | ||
53 | ({ \ | ||
54 | unsigned long flags; \ | ||
55 | local_save_flags(flags); \ | ||
56 | !(flags & (1<<5)); \ | ||
57 | }) | ||
58 | |||
59 | /* For spinlocks etc */ | ||
60 | #define local_irq_save(x) __asm__ __volatile__ ("move $ccr,%0\n\tdi" : "=rm" (x) : : "memory"); | ||
61 | |||
62 | #endif | ||