2 * This file contains sequences of code that will be copied to a
3 * fixed location, defined in <asm/fixed_code.h>. The interrupt
4 * handlers ensure that these sequences appear to be atomic when
5 * executed from userspace.
6 * These are aligned to 16 bytes, so that we have some space to replace
7 * these sequences with something else (e.g. kernel traps if we ever do
10 #include <linux/linkage.h>
11 #include <linux/init.h>
12 #include <linux/unistd.h>
13 #include <asm/entry.h>
17 ENTRY(_fixed_code_start)
20 ENTRY(_sigreturn_stub)
21 P0 = __NR_rt_sigreturn;
23 /* Speculative execution paranoia. */
25 ENDPROC (_sigreturn_stub)
30 * Inputs: P0: memory address to use
32 * Output: R0: old contents of the memory address, zero extended.
38 ENDPROC (_atomic_xchg32)
42 * Compare and swap, 32 bit.
43 * Inputs: P0: memory address to use
45 * R2: new value to store
46 * The new value is stored if the contents of the memory
47 * address is equal to the compare value.
48 * Output: R0: old contents of the memory address.
57 ENDPROC (_atomic_cas32)
62 * Inputs: P0: memory address to use
64 * Outputs: R0: new contents of the memory address.
65 * R1: previous contents of the memory address.
72 ENDPROC (_atomic_add32)
77 * Inputs: P0: memory address to use
78 * R0: value to subtract
79 * Outputs: R0: new contents of the memory address.
80 * R1: previous contents of the memory address.
87 ENDPROC (_atomic_sub32)
92 * Inputs: P0: memory address to use
94 * Outputs: R0: new contents of the memory address.
95 * R1: previous contents of the memory address.
102 ENDPROC (_atomic_ior32)
106 * Atomic and, 32 bit.
107 * Inputs: P0: memory address to use
109 * Outputs: R0: new contents of the memory address.
110 * R1: previous contents of the memory address.
117 ENDPROC (_atomic_and32)
121 * Atomic xor, 32 bit.
122 * Inputs: P0: memory address to use
124 * Outputs: R0: new contents of the memory address.
125 * R1: previous contents of the memory address.
132 ENDPROC (_atomic_xor32)
136 * safe_user_instruction
137 * Four NOPS are enough to allow the pipeline to speculativily load
138 * execute anything it wants. After that, things have gone bad, and
139 * we are stuck - so panic. Since we might be in user space, we can't
140 * call panic, so just cause a unhandled exception, this should cause
141 * a dump of the trace buffer so we can tell were we are, and a reboot
143 ENTRY(_safe_user_instruction)
146 ENDPROC(_safe_user_instruction)
148 ENTRY(_fixed_code_end)