diff options
author | Jesper Nilsson <jespern@axis.com> | 2014-01-09 05:16:37 -0500 |
---|---|---|
committer | Jesper Nilsson <jespern@axis.com> | 2014-01-09 06:48:17 -0500 |
commit | bb1d2a945344e2a5100f5c7f8bb6e3e4ae03a2ab (patch) | |
tree | 682bb1a60bb752a7101e25bbd694380b9c0c3e11 /arch/cris | |
parent | 329fddd7b60cf6aed53cdb6fdc8e64117b8e8bc6 (diff) |
CRIS: Add missing syscalls
Complete list of syscalls for CRISv10 and CRISv32.
Clean up some whitespace at the same time.
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/arch-v10/kernel/entry.S | 180 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/entry.S | 34 | ||||
-rw-r--r-- | arch/cris/include/asm/unistd.h | 2 | ||||
-rw-r--r-- | arch/cris/include/uapi/asm/unistd.h | 16 |
4 files changed, 140 insertions, 92 deletions
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index 897bba67bf7a..def0a530e9d4 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S | |||
@@ -13,8 +13,8 @@ | |||
13 | * after a timer-interrupt and after each system call. | 13 | * after a timer-interrupt and after each system call. |
14 | * | 14 | * |
15 | * Stack layout in 'ret_from_system_call': | 15 | * Stack layout in 'ret_from_system_call': |
16 | * ptrace needs to have all regs on the stack. | 16 | * ptrace needs to have all regs on the stack. |
17 | * if the order here is changed, it needs to be | 17 | * if the order here is changed, it needs to be |
18 | * updated in fork.c:copy_process, signal.c:do_signal, | 18 | * updated in fork.c:copy_process, signal.c:do_signal, |
19 | * ptrace.c and ptrace.h | 19 | * ptrace.c and ptrace.h |
20 | * | 20 | * |
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/pgtable.h> | 31 | #include <asm/pgtable.h> |
32 | 32 | ||
33 | ;; functions exported from this file | 33 | ;; functions exported from this file |
34 | 34 | ||
35 | .globl system_call | 35 | .globl system_call |
36 | .globl ret_from_intr | 36 | .globl ret_from_intr |
37 | .globl ret_from_fork | 37 | .globl ret_from_fork |
@@ -46,10 +46,10 @@ | |||
46 | .globl do_sigtrap | 46 | .globl do_sigtrap |
47 | .globl gdb_handle_breakpoint | 47 | .globl gdb_handle_breakpoint |
48 | .globl sys_call_table | 48 | .globl sys_call_table |
49 | 49 | ||
50 | ;; below are various parts of system_call which are not in the fast-path | 50 | ;; below are various parts of system_call which are not in the fast-path |
51 | 51 | ||
52 | #ifdef CONFIG_PREEMPT | 52 | #ifdef CONFIG_PREEMPT |
53 | ; Check if preemptive kernel scheduling should be done | 53 | ; Check if preemptive kernel scheduling should be done |
54 | _resume_kernel: | 54 | _resume_kernel: |
55 | di | 55 | di |
@@ -74,7 +74,7 @@ _need_resched: | |||
74 | nop | 74 | nop |
75 | #else | 75 | #else |
76 | #define _resume_kernel _Rexit | 76 | #define _resume_kernel _Rexit |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | ; Called at exit from fork. schedule_tail must be called to drop | 79 | ; Called at exit from fork. schedule_tail must be called to drop |
80 | ; spinlock if CONFIG_PREEMPT | 80 | ; spinlock if CONFIG_PREEMPT |
@@ -91,16 +91,16 @@ ret_from_kernel_thread: | |||
91 | ba ret_from_sys_call | 91 | ba ret_from_sys_call |
92 | 92 | ||
93 | ret_from_intr: | 93 | ret_from_intr: |
94 | ;; check for resched if preemptive kernel or if we're going back to user-mode | 94 | ;; check for resched if preemptive kernel or if we're going back to user-mode |
95 | ;; this test matches the user_regs(regs) macro | 95 | ;; this test matches the user_regs(regs) macro |
96 | ;; we cannot simply test $dccr, because that does not necessarily | 96 | ;; we cannot simply test $dccr, because that does not necessarily |
97 | ;; reflect what mode we'll return into. | 97 | ;; reflect what mode we'll return into. |
98 | 98 | ||
99 | move.d [$sp + PT_dccr], $r0; regs->dccr | 99 | move.d [$sp + PT_dccr], $r0; regs->dccr |
100 | btstq 8, $r0 ; U-flag | 100 | btstq 8, $r0 ; U-flag |
101 | bpl _resume_kernel | 101 | bpl _resume_kernel |
102 | ; Note that di below is in delay slot | 102 | ; Note that di below is in delay slot |
103 | 103 | ||
104 | _resume_userspace: | 104 | _resume_userspace: |
105 | di ; so need_resched and sigpending don't change | 105 | di ; so need_resched and sigpending don't change |
106 | 106 | ||
@@ -113,7 +113,7 @@ _resume_userspace: | |||
113 | nop | 113 | nop |
114 | ba _Rexit | 114 | ba _Rexit |
115 | nop | 115 | nop |
116 | 116 | ||
117 | ;; The system_call is called by a BREAK instruction, which works like | 117 | ;; The system_call is called by a BREAK instruction, which works like |
118 | ;; an interrupt call but it stores the return PC in BRP instead of IRP. | 118 | ;; an interrupt call but it stores the return PC in BRP instead of IRP. |
119 | ;; Since we dont really want to have two epilogues (one for system calls | 119 | ;; Since we dont really want to have two epilogues (one for system calls |
@@ -123,7 +123,7 @@ _resume_userspace: | |||
123 | ;; | 123 | ;; |
124 | ;; Since we can't have system calls inside interrupts, it should not matter | 124 | ;; Since we can't have system calls inside interrupts, it should not matter |
125 | ;; that we don't stack IRP. | 125 | ;; that we don't stack IRP. |
126 | ;; | 126 | ;; |
127 | ;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12,r13,mof,srp | 127 | ;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12,r13,mof,srp |
128 | ;; | 128 | ;; |
129 | ;; This function looks on the _surface_ like spaghetti programming, but it's | 129 | ;; This function looks on the _surface_ like spaghetti programming, but it's |
@@ -140,7 +140,7 @@ system_call: | |||
140 | movem $r13, [$sp] ; push r0-r13 | 140 | movem $r13, [$sp] ; push r0-r13 |
141 | push $r10 ; push orig_r10 | 141 | push $r10 ; push orig_r10 |
142 | clear.d [$sp=$sp-4] ; frametype == 0, normal stackframe | 142 | clear.d [$sp=$sp-4] ; frametype == 0, normal stackframe |
143 | 143 | ||
144 | movs.w -ENOSYS, $r0 | 144 | movs.w -ENOSYS, $r0 |
145 | move.d $r0, [$sp+PT_r10] ; put the default return value in r10 in the frame | 145 | move.d $r0, [$sp+PT_r10] ; put the default return value in r10 in the frame |
146 | 146 | ||
@@ -148,17 +148,17 @@ system_call: | |||
148 | 148 | ||
149 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 | 149 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 |
150 | and.d $sp, $r0 | 150 | and.d $sp, $r0 |
151 | 151 | ||
152 | move.d [$r0+TI_flags], $r0 | 152 | move.d [$r0+TI_flags], $r0 |
153 | btstq TIF_SYSCALL_TRACE, $r0 | 153 | btstq TIF_SYSCALL_TRACE, $r0 |
154 | bmi _syscall_trace_entry | 154 | bmi _syscall_trace_entry |
155 | nop | 155 | nop |
156 | 156 | ||
157 | _syscall_traced: | 157 | _syscall_traced: |
158 | 158 | ||
159 | ;; check for sanity in the requested syscall number | 159 | ;; check for sanity in the requested syscall number |
160 | 160 | ||
161 | cmpu.w NR_syscalls, $r9 | 161 | cmpu.w NR_syscalls, $r9 |
162 | bcc ret_from_sys_call | 162 | bcc ret_from_sys_call |
163 | lslq 2, $r9 ; multiply by 4, in the delay slot | 163 | lslq 2, $r9 ; multiply by 4, in the delay slot |
164 | 164 | ||
@@ -166,28 +166,28 @@ _syscall_traced: | |||
166 | ;; of the register structure itself. some syscalls need this. | 166 | ;; of the register structure itself. some syscalls need this. |
167 | 167 | ||
168 | push $sp | 168 | push $sp |
169 | 169 | ||
170 | ;; the parameter carrying registers r10, r11, r12 and 13 are intact. | 170 | ;; the parameter carrying registers r10, r11, r12 and 13 are intact. |
171 | ;; the fifth and sixth parameters (if any) was in mof and srp | 171 | ;; the fifth and sixth parameters (if any) was in mof and srp |
172 | ;; respectively, and we need to put them on the stack. | 172 | ;; respectively, and we need to put them on the stack. |
173 | 173 | ||
174 | push $srp | 174 | push $srp |
175 | push $mof | 175 | push $mof |
176 | 176 | ||
177 | jsr [$r9+sys_call_table] ; actually do the system call | 177 | jsr [$r9+sys_call_table] ; actually do the system call |
178 | addq 3*4, $sp ; pop the mof, srp and regs parameters | 178 | addq 3*4, $sp ; pop the mof, srp and regs parameters |
179 | move.d $r10, [$sp+PT_r10] ; save the return value | 179 | move.d $r10, [$sp+PT_r10] ; save the return value |
180 | 180 | ||
181 | moveq 1, $r9 ; "parameter" to ret_from_sys_call to show it was a sys call | 181 | moveq 1, $r9 ; "parameter" to ret_from_sys_call to show it was a sys call |
182 | 182 | ||
183 | ;; fall through into ret_from_sys_call to return | 183 | ;; fall through into ret_from_sys_call to return |
184 | 184 | ||
185 | ret_from_sys_call: | 185 | ret_from_sys_call: |
186 | ;; r9 is a parameter - if >=1 we came from a syscall, if 0, from an irq | 186 | ;; r9 is a parameter - if >=1 we came from a syscall, if 0, from an irq |
187 | 187 | ||
188 | ;; get the current task-struct pointer (see top for defs) | 188 | ;; get the current task-struct pointer (see top for defs) |
189 | 189 | ||
190 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 | 190 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 |
191 | and.d $sp, $r0 | 191 | and.d $sp, $r0 |
192 | 192 | ||
193 | di ; make sure need_resched and sigpending don't change | 193 | di ; make sure need_resched and sigpending don't change |
@@ -202,7 +202,7 @@ _Rexit: | |||
202 | bne _RBFexit ; was not CRIS_FRAME_NORMAL, handle otherwise | 202 | bne _RBFexit ; was not CRIS_FRAME_NORMAL, handle otherwise |
203 | addq 4, $sp ; skip orig_r10, in delayslot | 203 | addq 4, $sp ; skip orig_r10, in delayslot |
204 | movem [$sp+], $r13 ; registers r0-r13 | 204 | movem [$sp+], $r13 ; registers r0-r13 |
205 | pop $mof ; multiply overflow register | 205 | pop $mof ; multiply overflow register |
206 | pop $dccr ; condition codes | 206 | pop $dccr ; condition codes |
207 | pop $srp ; subroutine return pointer | 207 | pop $srp ; subroutine return pointer |
208 | ;; now we have a 4-word SBFS frame which we do not want to restore | 208 | ;; now we have a 4-word SBFS frame which we do not want to restore |
@@ -216,14 +216,14 @@ _Rexit: | |||
216 | 216 | ||
217 | _RBFexit: | 217 | _RBFexit: |
218 | movem [$sp+], $r13 ; registers r0-r13, in delay slot | 218 | movem [$sp+], $r13 ; registers r0-r13, in delay slot |
219 | pop $mof ; multiply overflow register | 219 | pop $mof ; multiply overflow register |
220 | pop $dccr ; condition codes | 220 | pop $dccr ; condition codes |
221 | pop $srp ; subroutine return pointer | 221 | pop $srp ; subroutine return pointer |
222 | rbf [$sp+] ; return by popping the CPU status | 222 | rbf [$sp+] ; return by popping the CPU status |
223 | 223 | ||
224 | ;; We get here after doing a syscall if extra work might need to be done | 224 | ;; We get here after doing a syscall if extra work might need to be done |
225 | ;; perform syscall exit tracing if needed | 225 | ;; perform syscall exit tracing if needed |
226 | 226 | ||
227 | _syscall_exit_work: | 227 | _syscall_exit_work: |
228 | ;; $r0 contains current at this point and irq's are disabled | 228 | ;; $r0 contains current at this point and irq's are disabled |
229 | 229 | ||
@@ -231,22 +231,22 @@ _syscall_exit_work: | |||
231 | btstq TIF_SYSCALL_TRACE, $r1 | 231 | btstq TIF_SYSCALL_TRACE, $r1 |
232 | bpl _work_pending | 232 | bpl _work_pending |
233 | nop | 233 | nop |
234 | 234 | ||
235 | ei | 235 | ei |
236 | 236 | ||
237 | move.d $r9, $r1 ; preserve r9 | 237 | move.d $r9, $r1 ; preserve r9 |
238 | jsr do_syscall_trace | 238 | jsr do_syscall_trace |
239 | move.d $r1, $r9 | 239 | move.d $r1, $r9 |
240 | 240 | ||
241 | ba _resume_userspace | 241 | ba _resume_userspace |
242 | nop | 242 | nop |
243 | 243 | ||
244 | _work_pending: | 244 | _work_pending: |
245 | move.d [$r0+TI_flags], $r1 | 245 | move.d [$r0+TI_flags], $r1 |
246 | btstq TIF_NEED_RESCHED, $r1 | 246 | btstq TIF_NEED_RESCHED, $r1 |
247 | bpl _work_notifysig ; was neither trace nor sched, must be signal/notify | 247 | bpl _work_notifysig ; was neither trace nor sched, must be signal/notify |
248 | nop | 248 | nop |
249 | 249 | ||
250 | _work_resched: | 250 | _work_resched: |
251 | move.d $r9, $r1 ; preserve r9 | 251 | move.d $r9, $r1 ; preserve r9 |
252 | jsr schedule | 252 | jsr schedule |
@@ -268,17 +268,17 @@ _work_notifysig: | |||
268 | move.d $sp, $r11 ; the regs param | 268 | move.d $sp, $r11 ; the regs param |
269 | move.d $r1, $r12 ; the thread_info_flags parameter | 269 | move.d $r1, $r12 ; the thread_info_flags parameter |
270 | jsr do_notify_resume | 270 | jsr do_notify_resume |
271 | 271 | ||
272 | ba _Rexit | 272 | ba _Rexit |
273 | nop | 273 | nop |
274 | 274 | ||
275 | ;; We get here as a sidetrack when we've entered a syscall with the | 275 | ;; We get here as a sidetrack when we've entered a syscall with the |
276 | ;; trace-bit set. We need to call do_syscall_trace and then continue | 276 | ;; trace-bit set. We need to call do_syscall_trace and then continue |
277 | ;; with the call. | 277 | ;; with the call. |
278 | 278 | ||
279 | _syscall_trace_entry: | 279 | _syscall_trace_entry: |
280 | ;; PT_r10 in the frame contains -ENOSYS as required, at this point | 280 | ;; PT_r10 in the frame contains -ENOSYS as required, at this point |
281 | 281 | ||
282 | jsr do_syscall_trace | 282 | jsr do_syscall_trace |
283 | 283 | ||
284 | ;; now re-enter the syscall code to do the syscall itself | 284 | ;; now re-enter the syscall code to do the syscall itself |
@@ -292,10 +292,10 @@ _syscall_trace_entry: | |||
292 | move.d [$sp+PT_r13], $r13 | 292 | move.d [$sp+PT_r13], $r13 |
293 | move [$sp+PT_mof], $mof | 293 | move [$sp+PT_mof], $mof |
294 | move [$sp+PT_srp], $srp | 294 | move [$sp+PT_srp], $srp |
295 | 295 | ||
296 | ba _syscall_traced | 296 | ba _syscall_traced |
297 | nop | 297 | nop |
298 | 298 | ||
299 | ;; resume performs the actual task-switching, by switching stack pointers | 299 | ;; resume performs the actual task-switching, by switching stack pointers |
300 | ;; input arguments: r10 = prev, r11 = next, r12 = thread offset in task struct | 300 | ;; input arguments: r10 = prev, r11 = next, r12 = thread offset in task struct |
301 | ;; returns old current in r10 | 301 | ;; returns old current in r10 |
@@ -303,29 +303,29 @@ _syscall_trace_entry: | |||
303 | ;; TODO: see the i386 version. The switch_to which calls resume in our version | 303 | ;; TODO: see the i386 version. The switch_to which calls resume in our version |
304 | ;; could really be an inline asm of this. | 304 | ;; could really be an inline asm of this. |
305 | 305 | ||
306 | resume: | 306 | resume: |
307 | push $srp ; we keep the old/new PC on the stack | 307 | push $srp ; we keep the old/new PC on the stack |
308 | add.d $r12, $r10 ; r10 = current tasks tss | 308 | add.d $r12, $r10 ; r10 = current tasks tss |
309 | move $dccr, [$r10+THREAD_dccr]; save irq enable state | 309 | move $dccr, [$r10+THREAD_dccr]; save irq enable state |
310 | di | 310 | di |
311 | 311 | ||
312 | move $usp, [$r10+ THREAD_usp] ; save user-mode stackpointer | 312 | move $usp, [$r10+ THREAD_usp] ; save user-mode stackpointer |
313 | 313 | ||
314 | ;; See copy_thread for the reason why register R9 is saved. | 314 | ;; See copy_thread for the reason why register R9 is saved. |
315 | subq 10*4, $sp | 315 | subq 10*4, $sp |
316 | movem $r9, [$sp] ; save non-scratch registers and R9. | 316 | movem $r9, [$sp] ; save non-scratch registers and R9. |
317 | 317 | ||
318 | move.d $sp, [$r10+THREAD_ksp] ; save the kernel stack pointer for the old task | 318 | move.d $sp, [$r10+THREAD_ksp] ; save the kernel stack pointer for the old task |
319 | move.d $sp, $r10 ; return last running task in r10 | 319 | move.d $sp, $r10 ; return last running task in r10 |
320 | and.d -8192, $r10 ; get thread_info from stackpointer | 320 | and.d -8192, $r10 ; get thread_info from stackpointer |
321 | move.d [$r10+TI_task], $r10 ; get task | 321 | move.d [$r10+TI_task], $r10 ; get task |
322 | add.d $r12, $r11 ; find the new tasks tss | 322 | add.d $r12, $r11 ; find the new tasks tss |
323 | move.d [$r11+THREAD_ksp], $sp ; switch into the new stackframe by restoring kernel sp | 323 | move.d [$r11+THREAD_ksp], $sp ; switch into the new stackframe by restoring kernel sp |
324 | 324 | ||
325 | movem [$sp+], $r9 ; restore non-scratch registers and R9. | 325 | movem [$sp+], $r9 ; restore non-scratch registers and R9. |
326 | 326 | ||
327 | move [$r11+THREAD_usp], $usp ; restore user-mode stackpointer | 327 | move [$r11+THREAD_usp], $usp ; restore user-mode stackpointer |
328 | 328 | ||
329 | move [$r11+THREAD_dccr], $dccr ; restore irq enable status | 329 | move [$r11+THREAD_dccr], $dccr ; restore irq enable status |
330 | jump [$sp+] ; restore PC | 330 | jump [$sp+] ; restore PC |
331 | 331 | ||
@@ -401,7 +401,7 @@ mmu_bus_fault: | |||
401 | push $r10 ; frametype == 1, BUSFAULT frame type | 401 | push $r10 ; frametype == 1, BUSFAULT frame type |
402 | 402 | ||
403 | move.d $sp, $r10 ; pt_regs argument to handle_mmu_bus_fault | 403 | move.d $sp, $r10 ; pt_regs argument to handle_mmu_bus_fault |
404 | 404 | ||
405 | jsr handle_mmu_bus_fault ; in arch/cris/arch-v10/mm/fault.c | 405 | jsr handle_mmu_bus_fault ; in arch/cris/arch-v10/mm/fault.c |
406 | 406 | ||
407 | ;; now we need to return through the normal path, we cannot just | 407 | ;; now we need to return through the normal path, we cannot just |
@@ -410,10 +410,10 @@ mmu_bus_fault: | |||
410 | ;; whatever. | 410 | ;; whatever. |
411 | 411 | ||
412 | moveq 0, $r9 ; busfault is equivalent to an irq | 412 | moveq 0, $r9 ; busfault is equivalent to an irq |
413 | 413 | ||
414 | ba ret_from_intr | 414 | ba ret_from_intr |
415 | nop | 415 | nop |
416 | 416 | ||
417 | ;; special handlers for breakpoint and NMI | 417 | ;; special handlers for breakpoint and NMI |
418 | hwbreakpoint: | 418 | hwbreakpoint: |
419 | push $dccr | 419 | push $dccr |
@@ -429,7 +429,7 @@ hwbreakpoint: | |||
429 | pop $dccr | 429 | pop $dccr |
430 | retb | 430 | retb |
431 | nop | 431 | nop |
432 | 432 | ||
433 | IRQ1_interrupt: | 433 | IRQ1_interrupt: |
434 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! | 434 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! |
435 | move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame | 435 | move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame |
@@ -500,7 +500,7 @@ Watchdog_bite: | |||
500 | move.d $r10, [$r11] | 500 | move.d $r10, [$r11] |
501 | 501 | ||
502 | #endif | 502 | #endif |
503 | 503 | ||
504 | ;; Note that we don't do "setf m" here (or after two necessary NOPs), | 504 | ;; Note that we don't do "setf m" here (or after two necessary NOPs), |
505 | ;; since *not* doing that saves us from re-entrancy checks. We don't want | 505 | ;; since *not* doing that saves us from re-entrancy checks. We don't want |
506 | ;; to get here again due to possible subsequent NMIs; we want the watchdog | 506 | ;; to get here again due to possible subsequent NMIs; we want the watchdog |
@@ -525,14 +525,14 @@ _watchdogmsg: | |||
525 | 525 | ||
526 | #endif /* CONFIG_ETRAX_WATCHDOG and not CONFIG_SVINTO_SIM */ | 526 | #endif /* CONFIG_ETRAX_WATCHDOG and not CONFIG_SVINTO_SIM */ |
527 | 527 | ||
528 | spurious_interrupt: | 528 | spurious_interrupt: |
529 | di | 529 | di |
530 | jump hard_reset_now | 530 | jump hard_reset_now |
531 | 531 | ||
532 | ;; this handles the case when multiple interrupts arrive at the same time | 532 | ;; this handles the case when multiple interrupts arrive at the same time |
533 | ;; we jump to the first set interrupt bit in a priority fashion | 533 | ;; we jump to the first set interrupt bit in a priority fashion |
534 | ;; the hardware will call the unserved interrupts after the handler finishes | 534 | ;; the hardware will call the unserved interrupts after the handler finishes |
535 | 535 | ||
536 | multiple_interrupt: | 536 | multiple_interrupt: |
537 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! | 537 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! |
538 | move $irp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame | 538 | move $irp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame |
@@ -551,7 +551,7 @@ multiple_interrupt: | |||
551 | jump ret_from_intr | 551 | jump ret_from_intr |
552 | 552 | ||
553 | do_sigtrap: | 553 | do_sigtrap: |
554 | ;; | 554 | ;; |
555 | ;; SIGTRAP the process that executed the break instruction. | 555 | ;; SIGTRAP the process that executed the break instruction. |
556 | ;; Make a frame that Rexit in entry.S expects. | 556 | ;; Make a frame that Rexit in entry.S expects. |
557 | ;; | 557 | ;; |
@@ -568,30 +568,30 @@ do_sigtrap: | |||
568 | movs.w -8192,$r9 ; THREAD_SIZE == 8192 | 568 | movs.w -8192,$r9 ; THREAD_SIZE == 8192 |
569 | and.d $sp, $r9 | 569 | and.d $sp, $r9 |
570 | move.d [$r9+TI_task], $r10 | 570 | move.d [$r9+TI_task], $r10 |
571 | move.d [$r10+TASK_pid], $r10 ; current->pid as arg1. | 571 | move.d [$r10+TASK_pid], $r10 ; current->pid as arg1. |
572 | moveq 5, $r11 ; SIGTRAP as arg2. | 572 | moveq 5, $r11 ; SIGTRAP as arg2. |
573 | jsr sys_kill | 573 | jsr sys_kill |
574 | jump ret_from_intr ; Use the return routine for interrupts. | 574 | jump ret_from_intr ; Use the return routine for interrupts. |
575 | 575 | ||
576 | gdb_handle_breakpoint: | 576 | gdb_handle_breakpoint: |
577 | push $dccr | 577 | push $dccr |
578 | push $r0 | 578 | push $r0 |
579 | #ifdef CONFIG_ETRAX_KGDB | 579 | #ifdef CONFIG_ETRAX_KGDB |
580 | move $dccr, $r0 ; U-flag not affected by previous insns. | 580 | move $dccr, $r0 ; U-flag not affected by previous insns. |
581 | btstq 8, $r0 ; Test the U-flag. | 581 | btstq 8, $r0 ; Test the U-flag. |
582 | bmi _ugdb_handle_breakpoint ; Go to user mode debugging. | 582 | bmi _ugdb_handle_breakpoint ; Go to user mode debugging. |
583 | nop ; Empty delay slot (cannot pop r0 here). | 583 | nop ; Empty delay slot (cannot pop r0 here). |
584 | pop $r0 ; Restore r0. | 584 | pop $r0 ; Restore r0. |
585 | ba kgdb_handle_breakpoint ; Go to kernel debugging. | 585 | ba kgdb_handle_breakpoint ; Go to kernel debugging. |
586 | pop $dccr ; Restore dccr in delay slot. | 586 | pop $dccr ; Restore dccr in delay slot. |
587 | #endif | 587 | #endif |
588 | 588 | ||
589 | _ugdb_handle_breakpoint: | 589 | _ugdb_handle_breakpoint: |
590 | move $brp, $r0 ; Use r0 temporarily for calculation. | 590 | move $brp, $r0 ; Use r0 temporarily for calculation. |
591 | subq 2, $r0 ; Set to address of previous instruction. | 591 | subq 2, $r0 ; Set to address of previous instruction. |
592 | move $r0, $brp | 592 | move $r0, $brp |
593 | pop $r0 ; Restore r0. | 593 | pop $r0 ; Restore r0. |
594 | ba do_sigtrap ; SIGTRAP the offending process. | 594 | ba do_sigtrap ; SIGTRAP the offending process. |
595 | pop $dccr ; Restore dccr in delay slot. | 595 | pop $dccr ; Restore dccr in delay slot. |
596 | 596 | ||
597 | .data | 597 | .data |
@@ -602,7 +602,7 @@ hw_bp_trig_ptr: | |||
602 | .dword hw_bp_trigs | 602 | .dword hw_bp_trigs |
603 | 603 | ||
604 | .section .rodata,"a" | 604 | .section .rodata,"a" |
605 | sys_call_table: | 605 | sys_call_table: |
606 | .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ | 606 | .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ |
607 | .long sys_exit | 607 | .long sys_exit |
608 | .long sys_fork | 608 | .long sys_fork |
@@ -713,7 +713,7 @@ sys_call_table: | |||
713 | .long sys_newlstat | 713 | .long sys_newlstat |
714 | .long sys_newfstat | 714 | .long sys_newfstat |
715 | .long sys_ni_syscall /* old sys_uname holder */ | 715 | .long sys_ni_syscall /* old sys_uname holder */ |
716 | .long sys_ni_syscall /* sys_iopl in i386 */ | 716 | .long sys_ni_syscall /* 110 */ /* sys_iopl in i386 */ |
717 | .long sys_vhangup | 717 | .long sys_vhangup |
718 | .long sys_ni_syscall /* old "idle" system call */ | 718 | .long sys_ni_syscall /* old "idle" system call */ |
719 | .long sys_ni_syscall /* vm86old in i386 */ | 719 | .long sys_ni_syscall /* vm86old in i386 */ |
@@ -730,7 +730,7 @@ sys_call_table: | |||
730 | .long sys_adjtimex | 730 | .long sys_adjtimex |
731 | .long sys_mprotect /* 125 */ | 731 | .long sys_mprotect /* 125 */ |
732 | .long sys_sigprocmask | 732 | .long sys_sigprocmask |
733 | .long sys_ni_syscall /* old "create_module" */ | 733 | .long sys_ni_syscall /* old "create_module" */ |
734 | .long sys_init_module | 734 | .long sys_init_module |
735 | .long sys_delete_module | 735 | .long sys_delete_module |
736 | .long sys_ni_syscall /* 130: old "get_kernel_syms" */ | 736 | .long sys_ni_syscall /* 130: old "get_kernel_syms" */ |
@@ -795,7 +795,7 @@ sys_call_table: | |||
795 | .long sys_ni_syscall /* streams2 */ | 795 | .long sys_ni_syscall /* streams2 */ |
796 | .long sys_vfork /* 190 */ | 796 | .long sys_vfork /* 190 */ |
797 | .long sys_getrlimit | 797 | .long sys_getrlimit |
798 | .long sys_mmap2 | 798 | .long sys_mmap2 /* mmap_pgoff */ |
799 | .long sys_truncate64 | 799 | .long sys_truncate64 |
800 | .long sys_ftruncate64 | 800 | .long sys_ftruncate64 |
801 | .long sys_stat64 /* 195 */ | 801 | .long sys_stat64 /* 195 */ |
@@ -861,21 +861,21 @@ sys_call_table: | |||
861 | .long sys_epoll_ctl /* 255 */ | 861 | .long sys_epoll_ctl /* 255 */ |
862 | .long sys_epoll_wait | 862 | .long sys_epoll_wait |
863 | .long sys_remap_file_pages | 863 | .long sys_remap_file_pages |
864 | .long sys_set_tid_address | 864 | .long sys_set_tid_address |
865 | .long sys_timer_create | 865 | .long sys_timer_create |
866 | .long sys_timer_settime /* 260 */ | 866 | .long sys_timer_settime /* 260 */ |
867 | .long sys_timer_gettime | 867 | .long sys_timer_gettime |
868 | .long sys_timer_getoverrun | 868 | .long sys_timer_getoverrun |
869 | .long sys_timer_delete | 869 | .long sys_timer_delete |
870 | .long sys_clock_settime | 870 | .long sys_clock_settime |
871 | .long sys_clock_gettime /* 265 */ | 871 | .long sys_clock_gettime /* 265 */ |
872 | .long sys_clock_getres | 872 | .long sys_clock_getres |
873 | .long sys_clock_nanosleep | 873 | .long sys_clock_nanosleep |
874 | .long sys_statfs64 | 874 | .long sys_statfs64 |
875 | .long sys_fstatfs64 | 875 | .long sys_fstatfs64 |
876 | .long sys_tgkill /* 270 */ | 876 | .long sys_tgkill /* 270 */ |
877 | .long sys_utimes | 877 | .long sys_utimes |
878 | .long sys_fadvise64_64 | 878 | .long sys_fadvise64_64 |
879 | .long sys_ni_syscall /* sys_vserver */ | 879 | .long sys_ni_syscall /* sys_vserver */ |
880 | .long sys_ni_syscall /* sys_mbind */ | 880 | .long sys_ni_syscall /* sys_mbind */ |
881 | .long sys_ni_syscall /* 275 sys_get_mempolicy */ | 881 | .long sys_ni_syscall /* 275 sys_get_mempolicy */ |
@@ -886,7 +886,7 @@ sys_call_table: | |||
886 | .long sys_mq_timedreceive /* 280 */ | 886 | .long sys_mq_timedreceive /* 280 */ |
887 | .long sys_mq_notify | 887 | .long sys_mq_notify |
888 | .long sys_mq_getsetattr | 888 | .long sys_mq_getsetattr |
889 | .long sys_ni_syscall /* reserved for kexec */ | 889 | .long sys_ni_syscall |
890 | .long sys_waitid | 890 | .long sys_waitid |
891 | .long sys_ni_syscall /* 285 */ /* available */ | 891 | .long sys_ni_syscall /* 285 */ /* available */ |
892 | .long sys_add_key | 892 | .long sys_add_key |
@@ -939,6 +939,22 @@ sys_call_table: | |||
939 | .long sys_preadv | 939 | .long sys_preadv |
940 | .long sys_pwritev | 940 | .long sys_pwritev |
941 | .long sys_setns /* 335 */ | 941 | .long sys_setns /* 335 */ |
942 | .long sys_name_to_handle_at | ||
943 | .long sys_open_by_handle_at | ||
944 | .long sys_rt_tgsigqueueinfo | ||
945 | .long sys_perf_event_open | ||
946 | .long sys_recvmmsg /* 340 */ | ||
947 | .long sys_accept4 | ||
948 | .long sys_fanotify_init | ||
949 | .long sys_fanotify_mark | ||
950 | .long sys_prlimit64 | ||
951 | .long sys_clock_adjtime /* 345 */ | ||
952 | .long sys_syncfs | ||
953 | .long sys_sendmmsg | ||
954 | .long sys_process_vm_readv | ||
955 | .long sys_process_vm_writev | ||
956 | .long sys_kcmp /* 350 */ | ||
957 | .long sys_finit_module | ||
942 | 958 | ||
943 | /* | 959 | /* |
944 | * NOTE!! This doesn't have to be exact - we just have | 960 | * NOTE!! This doesn't have to be exact - we just have |
@@ -950,4 +966,4 @@ sys_call_table: | |||
950 | .rept NR_syscalls-(.-sys_call_table)/4 | 966 | .rept NR_syscalls-(.-sys_call_table)/4 |
951 | .long sys_ni_syscall | 967 | .long sys_ni_syscall |
952 | .endr | 968 | .endr |
953 | 969 | ||
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S index faa644111feb..2f19ac6217aa 100644 --- a/arch/cris/arch-v32/kernel/entry.S +++ b/arch/cris/arch-v32/kernel/entry.S | |||
@@ -424,7 +424,7 @@ nmi_interrupt: | |||
424 | bpl 1f | 424 | bpl 1f |
425 | nop | 425 | nop |
426 | jsr handle_watchdog_bite ; In time.c. | 426 | jsr handle_watchdog_bite ; In time.c. |
427 | move.d $sp, $r10 ; Pointer to registers | 427 | move.d $sp, $r10 ; Pointer to registers |
428 | 1: btstq REG_BIT(intr_vect, r_nmi, ext), $r0 | 428 | 1: btstq REG_BIT(intr_vect, r_nmi, ext), $r0 |
429 | bpl 1f | 429 | bpl 1f |
430 | nop | 430 | nop |
@@ -452,7 +452,7 @@ spurious_interrupt: | |||
452 | nop | 452 | nop |
453 | 453 | ||
454 | ;; This handles the case when multiple interrupts arrive at the same | 454 | ;; This handles the case when multiple interrupts arrive at the same |
455 | ;; time. Jump to the first set interrupt bit in a priotiry fashion. The | 455 | ;; time. Jump to the first set interrupt bit in a priority fashion. The |
456 | ;; hardware will call the unserved interrupts after the handler | 456 | ;; hardware will call the unserved interrupts after the handler |
457 | ;; finishes. | 457 | ;; finishes. |
458 | .type multiple_interrupt, @function | 458 | .type multiple_interrupt, @function |
@@ -885,13 +885,29 @@ sys_call_table: | |||
885 | .long sys_preadv | 885 | .long sys_preadv |
886 | .long sys_pwritev | 886 | .long sys_pwritev |
887 | .long sys_setns /* 335 */ | 887 | .long sys_setns /* 335 */ |
888 | 888 | .long sys_name_to_handle_at | |
889 | /* | 889 | .long sys_open_by_handle_at |
890 | * NOTE!! This doesn't have to be exact - we just have | 890 | .long sys_rt_tgsigqueueinfo |
891 | * to make sure we have _enough_ of the "sys_ni_syscall" | 891 | .long sys_perf_event_open |
892 | * entries. Don't panic if you notice that this hasn't | 892 | .long sys_recvmmsg /* 340 */ |
893 | * been shrunk every time we add a new system call. | 893 | .long sys_accept4 |
894 | */ | 894 | .long sys_fanotify_init |
895 | .long sys_fanotify_mark | ||
896 | .long sys_prlimit64 | ||
897 | .long sys_clock_adjtime /* 345 */ | ||
898 | .long sys_syncfs | ||
899 | .long sys_sendmmsg | ||
900 | .long sys_process_vm_readv | ||
901 | .long sys_process_vm_writev | ||
902 | .long sys_kcmp /* 350 */ | ||
903 | .long sys_finit_module | ||
904 | |||
905 | /* | ||
906 | * NOTE!! This doesn't have to be exact - we just have | ||
907 | * to make sure we have _enough_ of the "sys_ni_syscall" | ||
908 | * entries. Don't panic if you notice that this hasn't | ||
909 | * been shrunk every time we add a new system call. | ||
910 | */ | ||
895 | 911 | ||
896 | .rept NR_syscalls - (.-sys_call_table) / 4 | 912 | .rept NR_syscalls - (.-sys_call_table) / 4 |
897 | .long sys_ni_syscall | 913 | .long sys_ni_syscall |
diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h index 0ff3f6889842..5cc7d1991e48 100644 --- a/arch/cris/include/asm/unistd.h +++ b/arch/cris/include/asm/unistd.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <uapi/asm/unistd.h> | 4 | #include <uapi/asm/unistd.h> |
5 | 5 | ||
6 | 6 | ||
7 | #define NR_syscalls 336 | 7 | #define NR_syscalls 360 |
8 | 8 | ||
9 | #include <arch/unistd.h> | 9 | #include <arch/unistd.h> |
10 | 10 | ||
diff --git a/arch/cris/include/uapi/asm/unistd.h b/arch/cris/include/uapi/asm/unistd.h index 48842896f6c2..f3287face443 100644 --- a/arch/cris/include/uapi/asm/unistd.h +++ b/arch/cris/include/uapi/asm/unistd.h | |||
@@ -340,5 +340,21 @@ | |||
340 | #define __NR_preadv 333 | 340 | #define __NR_preadv 333 |
341 | #define __NR_pwritev 334 | 341 | #define __NR_pwritev 334 |
342 | #define __NR_setns 335 | 342 | #define __NR_setns 335 |
343 | #define __NR_name_to_handle_at 336 | ||
344 | #define __NR_open_by_handle_at 337 | ||
345 | #define __NR_rt_tgsigqueueinfo 338 | ||
346 | #define __NR_perf_event_open 339 | ||
347 | #define __NR_recvmmsg 340 | ||
348 | #define __NR_accept4 341 | ||
349 | #define __NR_fanotify_init 342 | ||
350 | #define __NR_fanotify_mark 343 | ||
351 | #define __NR_prlimit64 344 | ||
352 | #define __NR_clock_adjtime 345 | ||
353 | #define __NR_syncfs 346 | ||
354 | #define __NR_sendmmsg 347 | ||
355 | #define __NR_process_vm_readv 348 | ||
356 | #define __NR_process_vm_writev 349 | ||
357 | #define __NR_kcmp 350 | ||
358 | #define __NR_finit_module 351 | ||
343 | 359 | ||
344 | #endif /* _UAPI_ASM_CRIS_UNISTD_H_ */ | 360 | #endif /* _UAPI_ASM_CRIS_UNISTD_H_ */ |