File: /usr/src/linux/include/asm-arm/system.h
1 #ifndef __ASM_ARM_SYSTEM_H
2 #define __ASM_ARM_SYSTEM_H
3
4 #ifdef __KERNEL__
5
6 #include <linux/config.h>
7 #include <linux/kernel.h>
8
9 /* information about the system we're running on */
10 extern unsigned int system_rev;
11 extern unsigned int system_serial_low;
12 extern unsigned int system_serial_high;
13 extern unsigned int mem_fclk_21285;
14
15 /*
16 * This tells us if we have an ISA bridge
17 * present in a PCI system.
18 */
19 #ifdef CONFIG_PCI
20 extern int have_isa_bridge;
21 #else
22 #define have_isa_bridge (0)
23 #endif
24
25 #include <asm/proc-fns.h>
26
27 #define xchg(ptr,x) \
28 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
29
30 #define tas(ptr) (xchg((ptr),1))
31
32 extern asmlinkage void __backtrace(void);
33
34 /*
35 * Include processor dependent parts
36 */
37 #include <asm/proc/system.h>
38
39 #define mb() __asm__ __volatile__ ("" : : : "memory")
40 #define rmb() mb()
41 #define wmb() mb()
42 #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
43
44 #define prepare_to_switch() do { } while(0)
45
46 /*
47 * switch_to(prev, next) should switch from task `prev' to `next'
48 * `prev' will never be the same as `next'.
49 * The `mb' is to tell GCC not to cache `current' across this call.
50 */
51 extern struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next);
52
53 #define switch_to(prev,next,last) \
54 do { \
55 last = __switch_to(prev,next); \
56 mb(); \
57 } while (0)
58
59 /* For spinlocks etc */
60 #define local_irq_save(x) __save_flags_cli(x)
61 #define local_irq_restore(x) __restore_flags(x)
62 #define local_irq_disable() __cli()
63 #define local_irq_enable() __sti()
64
65 #ifdef CONFIG_SMP
66 #error SMP not supported
67
68 #define smp_mb() mb()
69 #define smp_rmb() rmb()
70 #define smp_wmb() wmb()
71
72 #else
73
74 #define smp_mb() barrier()
75 #define smp_rmb() barrier()
76 #define smp_wmb() barrier()
77
78 #define cli() __cli()
79 #define sti() __sti()
80 #define clf() __clf()
81 #define stf() __stf()
82 #define save_flags(x) __save_flags(x)
83 #define restore_flags(x) __restore_flags(x)
84 #define save_flags_cli(x) __save_flags_cli(x)
85
86 #endif /* CONFIG_SMP */
87
88 #endif /* __KERNEL__ */
89
90 #endif
91