diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-04-26 10:19:24 -0400 |
---|---|---|
committer | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-04-26 10:19:24 -0400 |
commit | e0f9f4a622cec66d09a5d9339f048877c665cec3 (patch) | |
tree | 475dfd298c7151380e6a5bb64ec7d7d03c33dded /arch/arm | |
parent | 925c8a1a8cb9d7a33a8e39516d7fb679030553fc (diff) |
[PATCH] ARM: Use __NR_SYSCALL_BASE and __ARM_NR_BASE in asm code
Don't define our own local constants, but use those already defined
in asm/unistd.h instead.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 20 | ||||
-rw-r--r-- | arch/arm/kernel/entry-header.S | 22 |
2 files changed, 15 insertions, 27 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 55201db0f14..65c58b34db9 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -111,7 +111,17 @@ ENTRY(ret_from_fork) | |||
111 | ENTRY(vector_swi) | 111 | ENTRY(vector_swi) |
112 | save_user_regs | 112 | save_user_regs |
113 | zero_fp | 113 | zero_fp |
114 | get_scno | 114 | |
115 | /* | ||
116 | * Get the system call number. | ||
117 | */ | ||
118 | #ifdef CONFIG_ARM_THUMB | ||
119 | tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs | ||
120 | addne scno, r7, #__NR_SYSCALL_BASE @ put OS number in | ||
121 | ldreq scno, [lr, #-4] | ||
122 | #else | ||
123 | ldr scno, [lr, #-4] @ get SWI instruction | ||
124 | #endif | ||
115 | arm710_bug_check scno, ip | 125 | arm710_bug_check scno, ip |
116 | 126 | ||
117 | #ifdef CONFIG_ALIGNMENT_TRAP | 127 | #ifdef CONFIG_ALIGNMENT_TRAP |
@@ -126,7 +136,7 @@ ENTRY(vector_swi) | |||
126 | get_thread_info tsk | 136 | get_thread_info tsk |
127 | ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing | 137 | ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing |
128 | bic scno, scno, #0xff000000 @ mask off SWI op-code | 138 | bic scno, scno, #0xff000000 @ mask off SWI op-code |
129 | eor scno, scno, #OS_NUMBER << 20 @ check OS number | 139 | eor scno, scno, #__NR_SYSCALL_BASE @ check OS number |
130 | adr tbl, sys_call_table @ load syscall table pointer | 140 | adr tbl, sys_call_table @ load syscall table pointer |
131 | tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | 141 | tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? |
132 | bne __sys_trace | 142 | bne __sys_trace |
@@ -137,8 +147,8 @@ ENTRY(vector_swi) | |||
137 | 147 | ||
138 | add r1, sp, #S_OFF | 148 | add r1, sp, #S_OFF |
139 | 2: mov why, #0 @ no longer a real syscall | 149 | 2: mov why, #0 @ no longer a real syscall |
140 | cmp scno, #ARMSWI_OFFSET | 150 | cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE) |
141 | eor r0, scno, #OS_NUMBER << 20 @ put OS number back | 151 | eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back |
142 | bcs arm_syscall | 152 | bcs arm_syscall |
143 | b sys_ni_syscall @ not private func | 153 | b sys_ni_syscall @ not private func |
144 | 154 | ||
@@ -183,7 +193,7 @@ ENTRY(sys_call_table) | |||
183 | @ r5 = syscall table | 193 | @ r5 = syscall table |
184 | .type sys_syscall, #function | 194 | .type sys_syscall, #function |
185 | sys_syscall: | 195 | sys_syscall: |
186 | eor scno, r0, #OS_NUMBER << 20 | 196 | eor scno, r0, #__NR_SYSCALL_BASE |
187 | cmp scno, #__NR_syscall - __NR_SYSCALL_BASE | 197 | cmp scno, #__NR_syscall - __NR_SYSCALL_BASE |
188 | cmpne scno, #NR_syscalls @ check range | 198 | cmpne scno, #NR_syscalls @ check range |
189 | stmloia sp, {r5, r6} @ shuffle args | 199 | stmloia sp, {r5, r6} @ shuffle args |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 9d4d286d380..0eb7fc935e2 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -31,13 +31,6 @@ | |||
31 | 31 | ||
32 | #define PT_TRACESYS 0x00000002 | 32 | #define PT_TRACESYS 0x00000002 |
33 | 33 | ||
34 | @ OS version number used in SWIs | ||
35 | @ RISC OS is 0 | ||
36 | @ RISC iX is 8 | ||
37 | @ | ||
38 | #define OS_NUMBER 9 | ||
39 | #define ARMSWI_OFFSET 0x000f0000 | ||
40 | |||
41 | @ | 34 | @ |
42 | @ Most of the stack format comes from struct pt_regs, but with | 35 | @ Most of the stack format comes from struct pt_regs, but with |
43 | @ the addition of 8 bytes for storing syscall args 5 and 6. | 36 | @ the addition of 8 bytes for storing syscall args 5 and 6. |
@@ -150,18 +143,3 @@ scno .req r7 @ syscall number | |||
150 | tbl .req r8 @ syscall table pointer | 143 | tbl .req r8 @ syscall table pointer |
151 | why .req r8 @ Linux syscall (!= 0) | 144 | why .req r8 @ Linux syscall (!= 0) |
152 | tsk .req r9 @ current thread_info | 145 | tsk .req r9 @ current thread_info |
153 | |||
154 | /* | ||
155 | * Get the system call number. | ||
156 | */ | ||
157 | .macro get_scno | ||
158 | #ifdef CONFIG_ARM_THUMB | ||
159 | tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs | ||
160 | addne scno, r7, #OS_NUMBER << 20 @ put OS number in | ||
161 | ldreq scno, [lr, #-4] | ||
162 | |||
163 | #else | ||
164 | mask_pc lr, lr | ||
165 | ldr scno, [lr, #-4] @ get SWI instruction | ||
166 | #endif | ||
167 | .endm | ||