2 * linux/include/asm-arm/proc-armo/system.h
4 * Copyright (C) 1995, 1996 Russell King
7 #ifndef __ASM_PROC_SYSTEM_H
8 #define __ASM_PROC_SYSTEM_H
10 extern const char xchg_str
[];
12 #include <asm/proc-fns.h>
14 extern __inline__
unsigned long __xchg(unsigned long x
, volatile void *ptr
, int size
)
17 case 1: return cpu_xchg_1(x
, ptr
);
18 case 2: return cpu_xchg_2(x
, ptr
);
19 case 4: return cpu_xchg_4(x
, ptr
);
20 default: arm_invalidptr(xchg_str
, size
);
26 * We need to turn the caches off before calling the reset vector - RiscOS
27 * messes up if we don't
29 #define proc_hard_reset() cpu_proc_fin()
32 * This processor does not idle
37 * A couple of speedups for the ARM
41 * Save the current interrupt enable state & disable IRQs
43 #define __save_flags_cli(x) \
46 __asm__ __volatile__( \
47 " mov %0, pc @ save_flags_cli\n" \
48 " orr %1, %0, #0x08000000\n" \
49 " and %0, %0, #0x0c000000\n" \
51 : "=r" (x), "=r" (temp) \
62 __asm__ __volatile__( \
63 " mov %0, pc @ sti\n" \
64 " bic %0, %0, #0x08000000\n" \
77 __asm__ __volatile__( \
78 " mov %0, pc @ cli\n" \
79 " orr %0, %0, #0x08000000\n" \
87 * save current IRQ & FIQ state
89 #define __save_flags(x) \
91 __asm__ __volatile__( \
92 " mov %0, pc @ save_flags\n" \
93 " and %0, %0, #0x0c000000\n" \
98 * restore saved IRQ & FIQ state
100 #define __restore_flags(x) \
102 unsigned long temp; \
103 __asm__ __volatile__( \
104 " mov %0, pc @ restore_flags\n" \
105 " bic %0, %0, #0x0c000000\n" \
106 " orr %0, %0, %1\n" \
113 /* For spinlocks etc */
114 #define local_irq_save(x) __save_flags_cli(x)
115 #define local_irq_restore(x) __restore_flags(x)
116 #define local_irq_disable() __cli()
117 #define local_irq_enable() __sti()
120 #error SMP not supported
123 #define cli() __cli()
124 #define sti() __sti()
125 #define save_flags(x) __save_flags(x)
126 #define restore_flags(x) __restore_flags(x)
127 #define save_flags_cli(x) __save_flags_cli(x)