aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-cris/arch-v32/system.h
diff options
context:
space:
mode:
authorMikael Starvik <mikael.starvik@axis.com>2005-07-27 14:44:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 19:26:01 -0400
commit51533b615e605d86154ec1b4e585c8ca1b0b15b7 (patch)
tree4a6d7d8494d2017632d83624fb71b36031e0e7e5 /include/asm-cris/arch-v32/system.h
parent5d01e6ce785884a5db5792cd2e5bb36fa82fe23c (diff)
[PATCH] CRIS update: new subarchitecture v32
New CRIS sub architecture named v32. From: Dave Jones <davej@redhat.com> Fix swapped kmalloc args Signed-off-by: Mikael Starvik <starvik@axis.com> Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-cris/arch-v32/system.h')
-rw-r--r--include/asm-cris/arch-v32/system.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/include/asm-cris/arch-v32/system.h b/include/asm-cris/arch-v32/system.h
new file mode 100644
index 000000000000..b9afbb95e0bb
--- /dev/null
+++ b/include/asm-cris/arch-v32/system.h
@@ -0,0 +1,79 @@
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. */
7extern inline unsigned long rdvr(void)
8{
9 unsigned char vr;
10
11 __asm__ __volatile__ ("move $vr, %0" : "=rm" (vr));
12 return vr;
13}
14
15#define cris_machine_name "crisv32"
16
17/* Read the user-mode stack pointer. */
18extern inline unsigned long rdusp(void)
19{
20 unsigned long usp;
21
22 __asm__ __volatile__ ("move $usp, %0" : "=rm" (usp));
23 return usp;
24}
25
26/* Read the current stack pointer. */
27extern inline unsigned long rdsp(void)
28{
29 unsigned long sp;
30
31 __asm__ __volatile__ ("move.d $sp, %0" : "=rm" (sp));
32 return sp;
33}
34
35/* Write the user-mode stack pointer. */
36#define wrusp(usp) __asm__ __volatile__ ("move %0, $usp" : : "rm" (usp))
37
38#define nop() __asm__ __volatile__ ("nop");
39
40#define xchg(ptr,x) \
41 ((__typeof__(*(ptr)))__xchg((unsigned long) (x),(ptr),sizeof(*(ptr))))
42
43#define tas(ptr) (xchg((ptr),1))
44
45struct __xchg_dummy { unsigned long a[100]; };
46#define __xg(x) ((struct __xchg_dummy *)(x))
47
48/* Used for interrupt control. */
49#define local_save_flags(x) \
50 __asm__ __volatile__ ("move $ccs, %0" : "=rm" (x) : : "memory");
51
52#define local_irq_restore(x) \
53 __asm__ __volatile__ ("move %0, $ccs" : : "rm" (x) : "memory");
54
55#define local_irq_disable() __asm__ __volatile__ ("di" : : : "memory");
56#define local_irq_enable() __asm__ __volatile__ ("ei" : : : "memory");
57
58#define irqs_disabled() \
59({ \
60 unsigned long flags; \
61 \
62 local_save_flags(flags);\
63 !(flags & (1 << I_CCS_BITNR)); \
64})
65
66/* Used for spinlocks, etc. */
67#define local_irq_save(x) \
68 __asm__ __volatile__ ("move $ccs, %0\n\tdi" : "=rm" (x) : : "memory");
69
70#ifdef CONFIG_SMP
71typedef struct {
72 volatile unsigned int lock __attribute__ ((aligned(4)));
73#ifdef CONFIG_PREEMPT
74 unsigned int break_lock;
75#endif
76} spinlock_t;
77#endif
78
79#endif /* _ASM_CRIS_ARCH_SYSTEM_H */