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 #include <asm/proc-fns.h>
12 extern __inline__
unsigned long __xchg(unsigned long x
, volatile void *ptr
, int size
)
14 extern void __bad_xchg(volatile void *, int);
17 case 1: return cpu_xchg_1(x
, ptr
);
18 case 4: return cpu_xchg_4(x
, ptr
);
19 default: __bad_xchg(ptr
, size
);
25 * We need to turn the caches off before calling the reset vector - RiscOS
26 * messes up if we don't
28 #define proc_hard_reset() cpu_proc_fin()
31 * A couple of speedups for the ARM
35 * Save the current interrupt enable state & disable IRQs
37 #define __save_flags_cli(x) \
40 __asm__ __volatile__( \
41 " mov %0, pc @ save_flags_cli\n" \
42 " orr %1, %0, #0x08000000\n" \
43 " and %0, %0, #0x0c000000\n" \
45 : "=r" (x), "=r" (temp) \
56 __asm__ __volatile__( \
57 " mov %0, pc @ sti\n" \
58 " bic %0, %0, #0x08000000\n" \
71 __asm__ __volatile__( \
72 " mov %0, pc @ cli\n" \
73 " orr %0, %0, #0x08000000\n" \
81 * save current IRQ & FIQ state
83 #define __save_flags(x) \
85 __asm__ __volatile__( \
86 " mov %0, pc @ save_flags\n" \
87 " and %0, %0, #0x0c000000\n" \
92 * restore saved IRQ & FIQ state
94 #define __restore_flags(x) \
97 __asm__ __volatile__( \
98 " mov %0, pc @ restore_flags\n" \
99 " bic %0, %0, #0x0c000000\n" \
100 " orr %0, %0, %1\n" \