make oldconfig will rebuild these...
[linux-2.4.21-pre4.git] / 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_set(x)        __save_and_sti(x)
62 #define local_irq_restore(x)    __restore_flags(x)
63 #define local_irq_disable()     __cli()
64 #define local_irq_enable()      __sti()
65
66 #ifdef CONFIG_SMP
67 #error SMP not supported
68
69 #define smp_mb()                mb()
70 #define smp_rmb()               rmb()
71 #define smp_wmb()               wmb()
72
73 #else
74
75 #define smp_mb()                barrier()
76 #define smp_rmb()               barrier()
77 #define smp_wmb()               barrier()
78
79 #define cli()                   __cli()
80 #define sti()                   __sti()
81 #define clf()                   __clf()
82 #define stf()                   __stf()
83 #define save_flags(x)           __save_flags(x)
84 #define restore_flags(x)        __restore_flags(x)
85 #define save_flags_cli(x)       __save_flags_cli(x)
86 #define save_and_cli(x)         __save_flags_cli(x)
87 #define save_and_sti(x)         __save_flags_sti(x)
88
89 #endif /* CONFIG_SMP */
90
91 #endif /* __KERNEL__ */
92
93 #endif