1 /* 1 /* 2 * linux/arch/nios2/kernel/entry.S !! 2 * linux/arch/i386/entry.S 3 * 3 * 4 * Copyright (C) 2013-2014 Altera Corporation !! 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 * Copyright (C) 2009, Wind River Systems Inc !! 5 */ >> 6 >> 7 /* >> 8 * entry.S contains the system-call and fault low-level handling routines. >> 9 * This also contains the timer-interrupt handler, as well as all interrupts >> 10 * and faults that can result in a task-switch. 6 * 11 * 7 * Implemented by fredrik.markstrom@gmail.com !! 12 * NOTE: This code handles signal-recognition, which happens every time >> 13 * after a timer-interrupt and after each system call. 8 * 14 * 9 * Copyright (C) 1999-2002, Greg Ungerer (ger !! 15 * I changed all the .align's to 4 (16 byte alignment), as that's faster 10 * Copyright (C) 1998 D. Jeff Dionne <jeff@li !! 16 * on a 486. 11 * Kenneth Albanowski <kja << 12 * Copyright (C) 2000 Lineo Inc. (www.lineo. << 13 * Copyright (C) 2004 Microtronix Datacom Lt << 14 * 17 * 15 * This file is subject to the terms and condi !! 18 * Stack layout in 'ret_from_system_call': 16 * License. See the file "COPYING" in the mai !! 19 * ptrace needs to have all regs on the stack. 17 * for more details. !! 20 * if the order here is changed, it needs to be >> 21 * updated in fork.c:copy_process, signal.c:do_signal, >> 22 * ptrace.c and ptrace.h 18 * 23 * 19 * Linux/m68k support by Hamish Macdonald !! 24 * 0(%esp) - %ebx >> 25 * 4(%esp) - %ecx >> 26 * 8(%esp) - %edx >> 27 * C(%esp) - %esi >> 28 * 10(%esp) - %edi >> 29 * 14(%esp) - %ebp >> 30 * 18(%esp) - %eax >> 31 * 1C(%esp) - %ds >> 32 * 20(%esp) - %es >> 33 * 24(%esp) - orig_eax >> 34 * 28(%esp) - %eip >> 35 * 2C(%esp) - %cs >> 36 * 30(%esp) - %eflags >> 37 * 34(%esp) - %oldesp >> 38 * 38(%esp) - %oldss 20 * 39 * 21 * 68060 fixes by Jesper Skov !! 40 * "current" is in register %ebx during any slow entries. 22 * ColdFire support by Greg Ungerer (gerg@snap << 23 * 5307 fixes by David W. Miller << 24 * linux 2.4 support David McCullough <davidm@s << 25 */ 41 */ 26 42 >> 43 #include <linux/config.h> 27 #include <linux/sys.h> 44 #include <linux/sys.h> 28 #include <linux/linkage.h> 45 #include <linux/linkage.h> 29 #include <asm/asm-offsets.h> !! 46 #include <asm/segment.h> 30 #include <asm/asm-macros.h> !! 47 #include <asm/smp.h> 31 #include <asm/thread_info.h> << 32 #include <asm/errno.h> << 33 #include <asm/setup.h> << 34 #include <asm/entry.h> << 35 #include <asm/unistd.h> << 36 #include <asm/processor.h> << 37 << 38 .macro GET_THREAD_INFO reg << 39 .if THREAD_SIZE & 0xffff0000 << 40 andhi \reg, sp, %hi(~(THREAD_SIZE-1) << 41 .else << 42 addi \reg, r0, %lo(~(THREAD_SIZE-1) << 43 and \reg, \reg, sp << 44 .endif << 45 .endm << 46 << 47 .macro kuser_cmpxchg_check << 48 /* << 49 * Make sure our user space atomic hel << 50 * interrupted in a critical region. << 51 * ea-4 = address of interrupted insn << 52 * sp = saved regs. << 53 * cmpxchg_ldw = first critical insn, << 54 * If ea <= cmpxchg_stw and ea > cmpxc << 55 * cmpxchg_ldw + 4. << 56 */ << 57 /* et = cmpxchg_stw + 4 */ << 58 movui et, (KUSER_BASE + 4 + (cmpxchg << 59 bgtu ea, et, 1f << 60 << 61 subi et, et, (cmpxchg_stw - cmpxchg << 62 bltu ea, et, 1f << 63 stw et, PT_EA(sp) /* fix up EA * << 64 mov ea, et << 65 1: << 66 .endm << 67 << 68 .section .rodata << 69 .align 4 << 70 exception_table: << 71 .word unhandled_exception /* 0 - << 72 .word unhandled_exception /* 1 - << 73 .word external_interrupt /* 2 - << 74 .word handle_trap /* 3 - << 75 << 76 .word instruction_trap /* 4 - << 77 .word handle_illegal /* 5 - << 78 .word handle_unaligned /* 6 - << 79 .word handle_unaligned /* 7 - << 80 << 81 .word handle_diverror /* 8 - << 82 .word protection_exception_ba /* 9 - << 83 .word protection_exception_instr /* 10 << 84 .word protection_exception_ba /* 11 << 85 << 86 .word unhandled_exception /* 12 << 87 .word protection_exception_pte /* 13 << 88 .word protection_exception_pte /* 14 << 89 .word protection_exception_pte /* 15 << 90 << 91 .word unhandled_exception /* 16 << 92 << 93 trap_table: << 94 .word handle_system_call /* 0 << 95 .word handle_trap_1 /* 1 << 96 .word handle_trap_2 /* 2 << 97 .word handle_trap_3 /* 3 << 98 .word handle_trap_reserved /* 4 << 99 .word handle_trap_reserved /* 5 << 100 .word handle_trap_reserved /* 6 << 101 .word handle_trap_reserved /* 7 << 102 .word handle_trap_reserved /* 8 << 103 .word handle_trap_reserved /* 9 << 104 .word handle_trap_reserved /* 10 << 105 .word handle_trap_reserved /* 11 << 106 .word handle_trap_reserved /* 12 << 107 .word handle_trap_reserved /* 13 << 108 .word handle_trap_reserved /* 14 << 109 .word handle_trap_reserved /* 15 << 110 .word handle_trap_reserved /* 16 << 111 .word handle_trap_reserved /* 17 << 112 .word handle_trap_reserved /* 18 << 113 .word handle_trap_reserved /* 19 << 114 .word handle_trap_reserved /* 20 << 115 .word handle_trap_reserved /* 21 << 116 .word handle_trap_reserved /* 22 << 117 .word handle_trap_reserved /* 23 << 118 .word handle_trap_reserved /* 24 << 119 .word handle_trap_reserved /* 25 << 120 .word handle_trap_reserved /* 26 << 121 .word handle_trap_reserved /* 27 << 122 .word handle_trap_reserved /* 28 << 123 .word handle_trap_reserved /* 29 << 124 #ifdef CONFIG_KGDB << 125 .word handle_kgdb_breakpoint /* 30 << 126 #else << 127 .word instruction_trap << 128 #endif << 129 .word handle_breakpoint /* 31 << 130 << 131 .text << 132 .set noat << 133 .set nobreak << 134 << 135 ENTRY(inthandler) << 136 SAVE_ALL << 137 48 138 kuser_cmpxchg_check !! 49 EBX = 0x00 >> 50 ECX = 0x04 >> 51 EDX = 0x08 >> 52 ESI = 0x0C >> 53 EDI = 0x10 >> 54 EBP = 0x14 >> 55 EAX = 0x18 >> 56 DS = 0x1C >> 57 ES = 0x20 >> 58 ORIG_EAX = 0x24 >> 59 EIP = 0x28 >> 60 CS = 0x2C >> 61 EFLAGS = 0x30 >> 62 OLDESP = 0x34 >> 63 OLDSS = 0x38 >> 64 >> 65 CF_MASK = 0x00000001 >> 66 TF_MASK = 0x00000100 >> 67 IF_MASK = 0x00000200 >> 68 DF_MASK = 0x00000400 >> 69 NT_MASK = 0x00004000 >> 70 VM_MASK = 0x00020000 139 71 140 /* Clear EH bit before we get a new ex !! 72 /* 141 * and after we have saved it to the e !! 73 * these are offsets into the task-struct. 142 * whether it's trap, tlb-miss or inte << 143 * estatus is not updated the next exc << 144 */ << 145 rdctl r24, status << 146 movi r9, %lo(~STATUS_EH) << 147 and r24, r24, r9 << 148 wrctl status, r24 << 149 << 150 /* Read cause and vector and branch to << 151 mov r4, sp << 152 rdctl r5, exception << 153 movia r9, exception_table << 154 add r24, r9, r5 << 155 ldw r24, 0(r24) << 156 jmp r24 << 157 << 158 << 159 /********************************************* << 160 * Handle traps << 161 ********************************************* << 162 */ << 163 ENTRY(handle_trap) << 164 ldwio r24, -4(ea) /* instruction << 165 srli r24, r24, 4 << 166 andi r24, r24, 0x7c << 167 movia r9,trap_table << 168 add r24, r24, r9 << 169 ldw r24, 0(r24) << 170 jmp r24 << 171 << 172 << 173 /********************************************* << 174 * Handle system calls << 175 ********************************************* << 176 */ 74 */ 177 ENTRY(handle_system_call) !! 75 state = 0 178 /* Enable interrupts */ !! 76 flags = 4 179 rdctl r10, status !! 77 sigpending = 8 180 ori r10, r10, STATUS_PIE !! 78 addr_limit = 12 181 wrctl status, r10 !! 79 exec_domain = 16 182 !! 80 need_resched = 20 183 /* Reload registers destroyed by commo !! 81 tsk_ptrace = 24 184 ldw r4, PT_R4(sp) !! 82 processor = 52 185 ldw r5, PT_R5(sp) !! 83 186 !! 84 ENOSYS = 38 187 local_restart: !! 85 188 stw r2, PT_ORIG_R2(sp) !! 86 189 /* Check that the requested system cal !! 87 #define SAVE_ALL \ 190 movui r1, __NR_syscalls !! 88 cld; \ 191 bgeu r2, r1, ret_invsyscall !! 89 pushl %es; \ 192 slli r1, r2, 2 !! 90 pushl %ds; \ 193 movhi r11, %hiadj(sys_call_table) !! 91 pushl %eax; \ 194 add r1, r1, r11 !! 92 pushl %ebp; \ 195 ldw r1, %lo(sys_call_table)(r1) !! 93 pushl %edi; \ 196 !! 94 pushl %esi; \ 197 /* Check if we are being traced */ !! 95 pushl %edx; \ 198 GET_THREAD_INFO r11 !! 96 pushl %ecx; \ 199 ldw r11,TI_FLAGS(r11) !! 97 pushl %ebx; \ 200 BTBNZ r11,r11,TIF_SYSCALL_TRACE,trac !! 98 movl $(__KERNEL_DS),%edx; \ 201 !! 99 movl %edx,%ds; \ 202 /* Execute the system call */ !! 100 movl %edx,%es; 203 callr r1 !! 101 204 !! 102 #define RESTORE_ALL \ 205 /* If the syscall returns a negative r !! 103 popl %ebx; \ 206 * Set r7 to 1 to indicate error, !! 104 popl %ecx; \ 207 * Negate r2 to get a positive error !! 105 popl %edx; \ 208 * If the syscall returns zero or a po !! 106 popl %esi; \ 209 * Set r7 to 0. !! 107 popl %edi; \ 210 * The sigreturn system calls will ski !! 108 popl %ebp; \ 211 * adding to register ra. To avoid des !! 109 popl %eax; \ 212 */ !! 110 1: popl %ds; \ 213 translate_rc_and_ret: !! 111 2: popl %es; \ 214 movi r1, 0 !! 112 addl $4,%esp; \ 215 bge r2, zero, 3f !! 113 3: iret; \ 216 ldw r1, PT_ORIG_R2(sp) !! 114 .section .fixup,"ax"; \ 217 addi r1, r1, 1 !! 115 4: movl $0,(%esp); \ 218 beq r1, zero, 3f !! 116 jmp 1b; \ 219 sub r2, zero, r2 !! 117 5: movl $0,(%esp); \ 220 movi r1, 1 !! 118 jmp 2b; \ 221 3: !! 119 6: pushl %ss; \ 222 stw r2, PT_R2(sp) !! 120 popl %ds; \ 223 stw r1, PT_R7(sp) !! 121 pushl %ss; \ 224 end_translate_rc_and_ret: !! 122 popl %es; \ 225 !! 123 pushl $11; \ 226 ret_from_exception: !! 124 call do_exit; \ 227 ldw r1, PT_ESTATUS(sp) !! 125 .previous; \ 228 /* if so, skip resched, signals */ !! 126 .section __ex_table,"a";\ 229 TSTBNZ r1, r1, ESTATUS_EU, Luser_retu !! 127 .align 4; \ >> 128 .long 1b,4b; \ >> 129 .long 2b,5b; \ >> 130 .long 3b,6b; \ >> 131 .previous >> 132 >> 133 #define GET_CURRENT(reg) \ >> 134 movl $-8192, reg; \ >> 135 andl %esp, reg >> 136 >> 137 ENTRY(lcall7) >> 138 pushfl # We get a different stack layout with call gates, >> 139 pushl %eax # which has to be cleaned up later.. >> 140 SAVE_ALL >> 141 movl EIP(%esp),%eax # due to call gates, this is eflags, not eip.. >> 142 movl CS(%esp),%edx # this is eip.. >> 143 movl EFLAGS(%esp),%ecx # and this is cs.. >> 144 movl %eax,EFLAGS(%esp) # >> 145 andl $~(NT_MASK|TF_MASK|DF_MASK), %eax >> 146 pushl %eax >> 147 popfl >> 148 movl %edx,EIP(%esp) # Now we move them to their "normal" places >> 149 movl %ecx,CS(%esp) # >> 150 movl %esp,%ebx >> 151 pushl %ebx >> 152 andl $-8192,%ebx # GET_CURRENT >> 153 movl exec_domain(%ebx),%edx # Get the execution domain >> 154 movl 4(%edx),%edx # Get the lcall7 handler for the domain >> 155 pushl $0x7 >> 156 call *%edx >> 157 addl $4, %esp >> 158 popl %eax >> 159 jmp ret_from_sys_call >> 160 >> 161 ENTRY(lcall27) >> 162 pushfl # We get a different stack layout with call gates, >> 163 pushl %eax # which has to be cleaned up later.. >> 164 SAVE_ALL >> 165 movl EIP(%esp),%eax # due to call gates, this is eflags, not eip.. >> 166 movl CS(%esp),%edx # this is eip.. >> 167 movl EFLAGS(%esp),%ecx # and this is cs.. >> 168 movl %eax,EFLAGS(%esp) # >> 169 andl $~(NT_MASK|TF_MASK|DF_MASK), %eax >> 170 pushl %eax >> 171 popfl >> 172 movl %edx,EIP(%esp) # Now we move them to their "normal" places >> 173 movl %ecx,CS(%esp) # >> 174 movl %esp,%ebx >> 175 pushl %ebx >> 176 andl $-8192,%ebx # GET_CURRENT >> 177 movl exec_domain(%ebx),%edx # Get the execution domain >> 178 movl 4(%edx),%edx # Get the lcall7 handler for the domain >> 179 pushl $0x27 >> 180 call *%edx >> 181 addl $4, %esp >> 182 popl %eax >> 183 jmp ret_from_sys_call 230 184 231 restore_all: << 232 rdctl r10, status << 233 andi r10, r10, %lo(~STATUS_PIE) << 234 wrctl status, r10 << 235 RESTORE_ALL << 236 eret << 237 185 238 /* If the syscall number was invalid r !! 186 ENTRY(ret_from_fork) 239 ret_invsyscall: !! 187 pushl %ebx 240 movi r2, -ENOSYS !! 188 call SYMBOL_NAME(schedule_tail) 241 br translate_rc_and_ret !! 189 addl $4, %esp 242 !! 190 GET_CURRENT(%ebx) 243 /* This implements the same as above, !! 191 testb $0x02,tsk_ptrace(%ebx) # PT_TRACESYS 244 * do_syscall_trace_enter and do_sysca !! 192 jne tracesys_exit 245 * syscall in order for utilities like !! 193 jmp ret_from_sys_call 246 */ << 247 traced_system_call: << 248 SAVE_SWITCH_STACK << 249 call do_syscall_trace_enter << 250 RESTORE_SWITCH_STACK << 251 << 252 /* Create system call register argumen << 253 arguments on stack are already in p << 254 of pt_regs. */ << 255 ldw r2, PT_R2(sp) << 256 ldw r4, PT_R4(sp) << 257 ldw r5, PT_R5(sp) << 258 ldw r6, PT_R6(sp) << 259 ldw r7, PT_R7(sp) << 260 << 261 /* Fetch the syscall function. */ << 262 movui r1, __NR_syscalls << 263 bgeu r2, r1, traced_invsyscall << 264 slli r1, r2, 2 << 265 movhi r11,%hiadj(sys_call_table) << 266 add r1, r1, r11 << 267 ldw r1, %lo(sys_call_table)(r1) << 268 << 269 callr r1 << 270 << 271 /* If the syscall returns a negative r << 272 * Set r7 to 1 to indicate error, << 273 * Negate r2 to get a positive error << 274 * If the syscall returns zero or a po << 275 * Set r7 to 0. << 276 * The sigreturn system calls will ski << 277 * adding to register ra. To avoid des << 278 */ << 279 translate_rc_and_ret2: << 280 movi r1, 0 << 281 bge r2, zero, 4f << 282 ldw r1, PT_ORIG_R2(sp) << 283 addi r1, r1, 1 << 284 beq r1, zero, 4f << 285 sub r2, zero, r2 << 286 movi r1, 1 << 287 4: << 288 stw r2, PT_R2(sp) << 289 stw r1, PT_R7(sp) << 290 end_translate_rc_and_ret2: << 291 SAVE_SWITCH_STACK << 292 call do_syscall_trace_exit << 293 RESTORE_SWITCH_STACK << 294 br ret_from_exception << 295 << 296 /* If the syscall number was invalid r << 297 traced_invsyscall: << 298 movi r2, -ENOSYS << 299 br translate_rc_and_ret2 << 300 << 301 Luser_return: << 302 GET_THREAD_INFO r11 << 303 ldw r10, TI_FLAGS(r11) << 304 ANDI32 r11, r10, _TIF_WORK_MASK << 305 beq r11, r0, restore_all << 306 BTBZ r1, r10, TIF_NEED_RESCHED, Lsi << 307 << 308 /* Reschedule work */ << 309 call schedule << 310 br ret_from_exception << 311 << 312 Lsignal_return: << 313 ANDI32 r1, r10, _TIF_SIGPENDING | _TI << 314 beq r1, r0, restore_all << 315 mov r4, sp /* pt_ << 316 SAVE_SWITCH_STACK << 317 call do_notify_resume << 318 beq r2, r0, no_work_pending << 319 RESTORE_SWITCH_STACK << 320 /* prepare restart syscall here withou << 321 ldw r2, PT_R2(sp) /* reload sysc << 322 ldw r4, PT_R4(sp) /* reload sysc << 323 ldw r5, PT_R5(sp) << 324 ldw r6, PT_R6(sp) << 325 ldw r7, PT_R7(sp) << 326 ldw r8, PT_R8(sp) << 327 ldw r9, PT_R9(sp) << 328 br local_restart /* restart sys << 329 << 330 no_work_pending: << 331 RESTORE_SWITCH_STACK << 332 br ret_from_exception << 333 << 334 /********************************************* << 335 * Handle external interrupts. << 336 ********************************************* << 337 */ << 338 /* << 339 * This is the generic interrupt handler (for << 340 * sources). It figures out the vector number << 341 * interrupt service routine directly. << 342 */ << 343 external_interrupt: << 344 rdctl r12, ipending << 345 rdctl r9, ienable << 346 and r12, r12, r9 << 347 /* skip if no interrupt is pending */ << 348 beq r12, r0, ret_from_interrupt << 349 << 350 /* << 351 * Process an external hardware interr << 352 */ << 353 << 354 addi ea, ea, -4 /* re-issue th << 355 stw ea, PT_EA(sp) << 356 2: movi r4, %lo(-1) /* Start from << 357 highes << 358 /* This is the << 359 1: andi r10, r12, 1 /* Isolate bit << 360 srli r12, r12, 1 /* shift count << 361 multip << 362 addi r4, r4, 1 << 363 beq r10, r0, 1b << 364 mov r5, sp /* Setup pt_re << 365 call do_IRQ << 366 rdctl r12, ipending /* check again << 367 rdctl r9, ienable /* Isolate pos << 368 and r12, r12, r9 << 369 bne r12, r0, 2b << 370 /* br ret_from_interrupt */ /* fall << 371 << 372 ENTRY(ret_from_interrupt) << 373 ldw r1, PT_ESTATUS(sp) /* che << 374 TSTBNZ r1, r1, ESTATUS_EU, Luser_retu << 375 << 376 #ifdef CONFIG_PREEMPTION << 377 GET_THREAD_INFO r1 << 378 ldw r4, TI_PREEMPT_COUNT(r1) << 379 bne r4, r0, restore_all << 380 ldw r4, TI_FLAGS(r1) << 381 BTBZ r10, r4, TIF_NEED_RESCHED, res << 382 ldw r4, PT_ESTATUS(sp) /* ? I << 383 andi r10, r4, ESTATUS_EPIE << 384 beq r10, r0, restore_all << 385 call preempt_schedule_irq << 386 #endif << 387 br restore_all << 388 << 389 /********************************************* << 390 * A few syscall wrappers << 391 ********************************************* << 392 */ << 393 /* << 394 * int clone(unsigned long clone_flags, unsign << 395 * int __user * parent_tidptr, in << 396 * int tls_val) << 397 */ << 398 ENTRY(sys_clone) << 399 SAVE_SWITCH_STACK << 400 subi sp, sp, 4 /* make space for tl << 401 stw r8, 0(sp) /* pass tls pointer << 402 call nios2_clone << 403 addi sp, sp, 4 << 404 RESTORE_SWITCH_STACK << 405 ret << 406 << 407 ENTRY(sys_rt_sigreturn) << 408 SAVE_SWITCH_STACK << 409 mov r4, sp << 410 call do_rt_sigreturn << 411 RESTORE_SWITCH_STACK << 412 addi ra, ra, (end_translate_rc_and_ << 413 ret << 414 << 415 /********************************************* << 416 * A few other wrappers and stubs << 417 ********************************************* << 418 */ << 419 protection_exception_pte: << 420 rdctl r6, pteaddr << 421 slli r6, r6, 10 << 422 call do_page_fault << 423 br ret_from_exception << 424 << 425 protection_exception_ba: << 426 rdctl r6, badaddr << 427 call do_page_fault << 428 br ret_from_exception << 429 << 430 protection_exception_instr: << 431 call handle_supervisor_instr << 432 br ret_from_exception << 433 << 434 handle_breakpoint: << 435 call breakpoint_c << 436 br ret_from_exception << 437 << 438 #ifdef CONFIG_NIOS2_ALIGNMENT_TRAP << 439 handle_unaligned: << 440 SAVE_SWITCH_STACK << 441 call handle_unaligned_c << 442 RESTORE_SWITCH_STACK << 443 br ret_from_exception << 444 #else << 445 handle_unaligned: << 446 call handle_unaligned_c << 447 br ret_from_exception << 448 #endif << 449 << 450 handle_illegal: << 451 call handle_illegal_c << 452 br ret_from_exception << 453 << 454 handle_diverror: << 455 call handle_diverror_c << 456 br ret_from_exception << 457 << 458 #ifdef CONFIG_KGDB << 459 handle_kgdb_breakpoint: << 460 call kgdb_breakpoint_c << 461 br ret_from_exception << 462 #endif << 463 << 464 handle_trap_1: << 465 call handle_trap_1_c << 466 br ret_from_exception << 467 << 468 handle_trap_2: << 469 call handle_trap_2_c << 470 br ret_from_exception << 471 << 472 handle_trap_3: << 473 handle_trap_reserved: << 474 call handle_trap_3_c << 475 br ret_from_exception << 476 194 477 /* 195 /* 478 * Beware - when entering resume, prev (the cu !! 196 * Return to user mode is not as complex as all this looks, 479 * in r4, next (the new task) is in r5, don't !! 197 * but we want the default path for a system call return to 480 * registers. !! 198 * go as quickly as possible which is why some of this is >> 199 * less clear than it otherwise should be. 481 */ 200 */ 482 ENTRY(resume) << 483 201 484 rdctl r7, status !! 202 ENTRY(system_call) 485 stw r7, TASK_THREAD + THREAD_KPSR( !! 203 pushl %eax # save orig_eax 486 !! 204 SAVE_ALL 487 andi r7, r7, %lo(~STATUS_PIE) !! 205 GET_CURRENT(%ebx) 488 wrctl status, r7 !! 206 testb $0x02,tsk_ptrace(%ebx) # PT_TRACESYS >> 207 jne tracesys >> 208 cmpl $(NR_syscalls),%eax >> 209 jae badsys >> 210 call *SYMBOL_NAME(sys_call_table)(,%eax,4) >> 211 movl %eax,EAX(%esp) # save the return value >> 212 ENTRY(ret_from_sys_call) >> 213 cli # need_resched and signals atomic test >> 214 cmpl $0,need_resched(%ebx) >> 215 jne reschedule >> 216 cmpl $0,sigpending(%ebx) >> 217 jne signal_return >> 218 restore_all: >> 219 RESTORE_ALL 489 220 490 SAVE_SWITCH_STACK !! 221 ALIGN 491 stw sp, TASK_THREAD + THREAD_KSP(r !! 222 signal_return: 492 ldw sp, TASK_THREAD + THREAD_KSP(r !! 223 sti # we can get here from an interrupt handler 493 movia r24, _current_thread !! 224 testl $(VM_MASK),EFLAGS(%esp) 494 GET_THREAD_INFO r1 !! 225 movl %esp,%eax 495 stw r1, 0(r24) !! 226 jne v86_signal_return 496 RESTORE_SWITCH_STACK !! 227 xorl %edx,%edx 497 !! 228 call SYMBOL_NAME(do_signal) 498 ldw r7, TASK_THREAD + THREAD_KPSR( !! 229 jmp restore_all 499 wrctl status, r7 !! 230 500 ret !! 231 ALIGN >> 232 v86_signal_return: >> 233 call SYMBOL_NAME(save_v86_state) >> 234 movl %eax,%esp >> 235 xorl %edx,%edx >> 236 call SYMBOL_NAME(do_signal) >> 237 jmp restore_all >> 238 >> 239 ALIGN >> 240 tracesys: >> 241 movl $-ENOSYS,EAX(%esp) >> 242 call SYMBOL_NAME(syscall_trace) >> 243 movl ORIG_EAX(%esp),%eax >> 244 cmpl $(NR_syscalls),%eax >> 245 jae tracesys_exit >> 246 call *SYMBOL_NAME(sys_call_table)(,%eax,4) >> 247 movl %eax,EAX(%esp) # save the return value >> 248 tracesys_exit: >> 249 call SYMBOL_NAME(syscall_trace) >> 250 jmp ret_from_sys_call >> 251 badsys: >> 252 movl $-ENOSYS,EAX(%esp) >> 253 jmp ret_from_sys_call >> 254 >> 255 ALIGN >> 256 ENTRY(ret_from_intr) >> 257 GET_CURRENT(%ebx) >> 258 ret_from_exception: >> 259 movl EFLAGS(%esp),%eax # mix EFLAGS and CS >> 260 movb CS(%esp),%al >> 261 testl $(VM_MASK | 3),%eax # return to VM86 mode or non-supervisor? >> 262 jne ret_from_sys_call >> 263 jmp restore_all >> 264 >> 265 ALIGN >> 266 reschedule: >> 267 call SYMBOL_NAME(schedule) # test >> 268 jmp ret_from_sys_call >> 269 >> 270 ENTRY(divide_error) >> 271 pushl $0 # no error code >> 272 pushl $ SYMBOL_NAME(do_divide_error) >> 273 ALIGN >> 274 error_code: >> 275 pushl %ds >> 276 pushl %eax >> 277 xorl %eax,%eax >> 278 pushl %ebp >> 279 pushl %edi >> 280 pushl %esi >> 281 pushl %edx >> 282 decl %eax # eax = -1 >> 283 pushl %ecx >> 284 pushl %ebx >> 285 cld >> 286 movl %es,%ecx >> 287 movl ORIG_EAX(%esp), %esi # get the error code >> 288 movl ES(%esp), %edi # get the function address >> 289 movl %eax, ORIG_EAX(%esp) >> 290 movl %ecx, ES(%esp) >> 291 movl %esp,%edx >> 292 pushl %esi # push the error code >> 293 pushl %edx # push the pt_regs pointer >> 294 movl $(__KERNEL_DS),%edx >> 295 movl %edx,%ds >> 296 movl %edx,%es >> 297 GET_CURRENT(%ebx) >> 298 call *%edi >> 299 addl $8,%esp >> 300 jmp ret_from_exception >> 301 >> 302 ENTRY(coprocessor_error) >> 303 pushl $0 >> 304 pushl $ SYMBOL_NAME(do_coprocessor_error) >> 305 jmp error_code >> 306 >> 307 ENTRY(simd_coprocessor_error) >> 308 pushl $0 >> 309 pushl $ SYMBOL_NAME(do_simd_coprocessor_error) >> 310 jmp error_code 501 311 502 ENTRY(ret_from_fork) !! 312 ENTRY(device_not_available) 503 call schedule_tail !! 313 pushl $-1 # mark this as an int 504 br ret_from_exception !! 314 SAVE_ALL >> 315 GET_CURRENT(%ebx) >> 316 movl %cr0,%eax >> 317 testl $0x4,%eax # EM (math emulation bit) >> 318 jne device_not_available_emulate >> 319 call SYMBOL_NAME(math_state_restore) >> 320 jmp ret_from_exception >> 321 device_not_available_emulate: >> 322 pushl $0 # temporary storage for ORIG_EIP >> 323 call SYMBOL_NAME(math_emulate) >> 324 addl $4,%esp >> 325 jmp ret_from_exception >> 326 >> 327 ENTRY(debug) >> 328 pushl $0 >> 329 pushl $ SYMBOL_NAME(do_debug) >> 330 jmp error_code 505 331 506 ENTRY(ret_from_kernel_thread) !! 332 ENTRY(nmi) 507 call schedule_tail !! 333 pushl %eax 508 mov r4,r17 /* arg */ !! 334 SAVE_ALL 509 callr r16 /* function */ !! 335 movl %esp,%edx 510 br ret_from_exception !! 336 pushl $0 >> 337 pushl %edx >> 338 call SYMBOL_NAME(do_nmi) >> 339 addl $8,%esp >> 340 RESTORE_ALL 511 341 512 /* !! 342 ENTRY(int3) 513 * Kernel user helpers. !! 343 pushl $0 514 * !! 344 pushl $ SYMBOL_NAME(do_int3) 515 * Each segment is 64-byte aligned and will be !! 345 jmp error_code 516 * New segments (if ever needed) must be added !! 346 517 * This mechanism should be used only for thin !! 347 ENTRY(overflow) 518 * justified, and not be abused freely. !! 348 pushl $0 519 * !! 349 pushl $ SYMBOL_NAME(do_overflow) 520 */ !! 350 jmp error_code >> 351 >> 352 ENTRY(bounds) >> 353 pushl $0 >> 354 pushl $ SYMBOL_NAME(do_bounds) >> 355 jmp error_code >> 356 >> 357 ENTRY(invalid_op) >> 358 pushl $0 >> 359 pushl $ SYMBOL_NAME(do_invalid_op) >> 360 jmp error_code >> 361 >> 362 ENTRY(coprocessor_segment_overrun) >> 363 pushl $0 >> 364 pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun) >> 365 jmp error_code >> 366 >> 367 ENTRY(double_fault) >> 368 pushl $ SYMBOL_NAME(do_double_fault) >> 369 jmp error_code >> 370 >> 371 ENTRY(invalid_TSS) >> 372 pushl $ SYMBOL_NAME(do_invalid_TSS) >> 373 jmp error_code >> 374 >> 375 ENTRY(segment_not_present) >> 376 pushl $ SYMBOL_NAME(do_segment_not_present) >> 377 jmp error_code >> 378 >> 379 ENTRY(stack_segment) >> 380 pushl $ SYMBOL_NAME(do_stack_segment) >> 381 jmp error_code >> 382 >> 383 ENTRY(general_protection) >> 384 pushl $ SYMBOL_NAME(do_general_protection) >> 385 jmp error_code >> 386 >> 387 ENTRY(alignment_check) >> 388 pushl $ SYMBOL_NAME(do_alignment_check) >> 389 jmp error_code >> 390 >> 391 ENTRY(page_fault) >> 392 pushl $ SYMBOL_NAME(do_page_fault) >> 393 jmp error_code >> 394 >> 395 ENTRY(machine_check) >> 396 pushl $0 >> 397 pushl $ SYMBOL_NAME(do_machine_check) >> 398 jmp error_code >> 399 >> 400 ENTRY(spurious_interrupt_bug) >> 401 pushl $0 >> 402 pushl $ SYMBOL_NAME(do_spurious_interrupt_bug) >> 403 jmp error_code >> 404 >> 405 .data >> 406 ENTRY(sys_call_table) >> 407 .long SYMBOL_NAME(sys_ni_syscall) /* 0 - old "setup()" system call*/ >> 408 .long SYMBOL_NAME(sys_exit) >> 409 .long SYMBOL_NAME(sys_fork) >> 410 .long SYMBOL_NAME(sys_read) >> 411 .long SYMBOL_NAME(sys_write) >> 412 .long SYMBOL_NAME(sys_open) /* 5 */ >> 413 .long SYMBOL_NAME(sys_close) >> 414 .long SYMBOL_NAME(sys_waitpid) >> 415 .long SYMBOL_NAME(sys_creat) >> 416 .long SYMBOL_NAME(sys_link) >> 417 .long SYMBOL_NAME(sys_unlink) /* 10 */ >> 418 .long SYMBOL_NAME(sys_execve) >> 419 .long SYMBOL_NAME(sys_chdir) >> 420 .long SYMBOL_NAME(sys_time) >> 421 .long SYMBOL_NAME(sys_mknod) >> 422 .long SYMBOL_NAME(sys_chmod) /* 15 */ >> 423 .long SYMBOL_NAME(sys_lchown16) >> 424 .long SYMBOL_NAME(sys_ni_syscall) /* old break syscall holder */ >> 425 .long SYMBOL_NAME(sys_stat) >> 426 .long SYMBOL_NAME(sys_lseek) >> 427 .long SYMBOL_NAME(sys_getpid) /* 20 */ >> 428 .long SYMBOL_NAME(sys_mount) >> 429 .long SYMBOL_NAME(sys_oldumount) >> 430 .long SYMBOL_NAME(sys_setuid16) >> 431 .long SYMBOL_NAME(sys_getuid16) >> 432 .long SYMBOL_NAME(sys_stime) /* 25 */ >> 433 .long SYMBOL_NAME(sys_ptrace) >> 434 .long SYMBOL_NAME(sys_alarm) >> 435 .long SYMBOL_NAME(sys_fstat) >> 436 .long SYMBOL_NAME(sys_pause) >> 437 .long SYMBOL_NAME(sys_utime) /* 30 */ >> 438 .long SYMBOL_NAME(sys_ni_syscall) /* old stty syscall holder */ >> 439 .long SYMBOL_NAME(sys_ni_syscall) /* old gtty syscall holder */ >> 440 .long SYMBOL_NAME(sys_access) >> 441 .long SYMBOL_NAME(sys_nice) >> 442 .long SYMBOL_NAME(sys_ni_syscall) /* 35 */ /* old ftime syscall holder */ >> 443 .long SYMBOL_NAME(sys_sync) >> 444 .long SYMBOL_NAME(sys_kill) >> 445 .long SYMBOL_NAME(sys_rename) >> 446 .long SYMBOL_NAME(sys_mkdir) >> 447 .long SYMBOL_NAME(sys_rmdir) /* 40 */ >> 448 .long SYMBOL_NAME(sys_dup) >> 449 .long SYMBOL_NAME(sys_pipe) >> 450 .long SYMBOL_NAME(sys_times) >> 451 .long SYMBOL_NAME(sys_ni_syscall) /* old prof syscall holder */ >> 452 .long SYMBOL_NAME(sys_brk) /* 45 */ >> 453 .long SYMBOL_NAME(sys_setgid16) >> 454 .long SYMBOL_NAME(sys_getgid16) >> 455 .long SYMBOL_NAME(sys_signal) >> 456 .long SYMBOL_NAME(sys_geteuid16) >> 457 .long SYMBOL_NAME(sys_getegid16) /* 50 */ >> 458 .long SYMBOL_NAME(sys_acct) >> 459 .long SYMBOL_NAME(sys_umount) /* recycled never used phys() */ >> 460 .long SYMBOL_NAME(sys_ni_syscall) /* old lock syscall holder */ >> 461 .long SYMBOL_NAME(sys_ioctl) >> 462 .long SYMBOL_NAME(sys_fcntl) /* 55 */ >> 463 .long SYMBOL_NAME(sys_ni_syscall) /* old mpx syscall holder */ >> 464 .long SYMBOL_NAME(sys_setpgid) >> 465 .long SYMBOL_NAME(sys_ni_syscall) /* old ulimit syscall holder */ >> 466 .long SYMBOL_NAME(sys_olduname) >> 467 .long SYMBOL_NAME(sys_umask) /* 60 */ >> 468 .long SYMBOL_NAME(sys_chroot) >> 469 .long SYMBOL_NAME(sys_ustat) >> 470 .long SYMBOL_NAME(sys_dup2) >> 471 .long SYMBOL_NAME(sys_getppid) >> 472 .long SYMBOL_NAME(sys_getpgrp) /* 65 */ >> 473 .long SYMBOL_NAME(sys_setsid) >> 474 .long SYMBOL_NAME(sys_sigaction) >> 475 .long SYMBOL_NAME(sys_sgetmask) >> 476 .long SYMBOL_NAME(sys_ssetmask) >> 477 .long SYMBOL_NAME(sys_setreuid16) /* 70 */ >> 478 .long SYMBOL_NAME(sys_setregid16) >> 479 .long SYMBOL_NAME(sys_sigsuspend) >> 480 .long SYMBOL_NAME(sys_sigpending) >> 481 .long SYMBOL_NAME(sys_sethostname) >> 482 .long SYMBOL_NAME(sys_setrlimit) /* 75 */ >> 483 .long SYMBOL_NAME(sys_old_getrlimit) >> 484 .long SYMBOL_NAME(sys_getrusage) >> 485 .long SYMBOL_NAME(sys_gettimeofday) >> 486 .long SYMBOL_NAME(sys_settimeofday) >> 487 .long SYMBOL_NAME(sys_getgroups16) /* 80 */ >> 488 .long SYMBOL_NAME(sys_setgroups16) >> 489 .long SYMBOL_NAME(old_select) >> 490 .long SYMBOL_NAME(sys_symlink) >> 491 .long SYMBOL_NAME(sys_lstat) >> 492 .long SYMBOL_NAME(sys_readlink) /* 85 */ >> 493 .long SYMBOL_NAME(sys_uselib) >> 494 .long SYMBOL_NAME(sys_swapon) >> 495 .long SYMBOL_NAME(sys_reboot) >> 496 .long SYMBOL_NAME(old_readdir) >> 497 .long SYMBOL_NAME(old_mmap) /* 90 */ >> 498 .long SYMBOL_NAME(sys_munmap) >> 499 .long SYMBOL_NAME(sys_truncate) >> 500 .long SYMBOL_NAME(sys_ftruncate) >> 501 .long SYMBOL_NAME(sys_fchmod) >> 502 .long SYMBOL_NAME(sys_fchown16) /* 95 */ >> 503 .long SYMBOL_NAME(sys_getpriority) >> 504 .long SYMBOL_NAME(sys_setpriority) >> 505 .long SYMBOL_NAME(sys_ni_syscall) /* old profil syscall holder */ >> 506 .long SYMBOL_NAME(sys_statfs) >> 507 .long SYMBOL_NAME(sys_fstatfs) /* 100 */ >> 508 .long SYMBOL_NAME(sys_ioperm) >> 509 .long SYMBOL_NAME(sys_socketcall) >> 510 .long SYMBOL_NAME(sys_syslog) >> 511 .long SYMBOL_NAME(sys_setitimer) >> 512 .long SYMBOL_NAME(sys_getitimer) /* 105 */ >> 513 .long SYMBOL_NAME(sys_newstat) >> 514 .long SYMBOL_NAME(sys_newlstat) >> 515 .long SYMBOL_NAME(sys_newfstat) >> 516 .long SYMBOL_NAME(sys_uname) >> 517 .long SYMBOL_NAME(sys_iopl) /* 110 */ >> 518 .long SYMBOL_NAME(sys_vhangup) >> 519 .long SYMBOL_NAME(sys_ni_syscall) /* old "idle" system call */ >> 520 .long SYMBOL_NAME(sys_vm86old) >> 521 .long SYMBOL_NAME(sys_wait4) >> 522 .long SYMBOL_NAME(sys_swapoff) /* 115 */ >> 523 .long SYMBOL_NAME(sys_sysinfo) >> 524 .long SYMBOL_NAME(sys_ipc) >> 525 .long SYMBOL_NAME(sys_fsync) >> 526 .long SYMBOL_NAME(sys_sigreturn) >> 527 .long SYMBOL_NAME(sys_clone) /* 120 */ >> 528 .long SYMBOL_NAME(sys_setdomainname) >> 529 .long SYMBOL_NAME(sys_newuname) >> 530 .long SYMBOL_NAME(sys_modify_ldt) >> 531 .long SYMBOL_NAME(sys_adjtimex) >> 532 .long SYMBOL_NAME(sys_mprotect) /* 125 */ >> 533 .long SYMBOL_NAME(sys_sigprocmask) >> 534 .long SYMBOL_NAME(sys_create_module) >> 535 .long SYMBOL_NAME(sys_init_module) >> 536 .long SYMBOL_NAME(sys_delete_module) >> 537 .long SYMBOL_NAME(sys_get_kernel_syms) /* 130 */ >> 538 .long SYMBOL_NAME(sys_quotactl) >> 539 .long SYMBOL_NAME(sys_getpgid) >> 540 .long SYMBOL_NAME(sys_fchdir) >> 541 .long SYMBOL_NAME(sys_bdflush) >> 542 .long SYMBOL_NAME(sys_sysfs) /* 135 */ >> 543 .long SYMBOL_NAME(sys_personality) >> 544 .long SYMBOL_NAME(sys_ni_syscall) /* for afs_syscall */ >> 545 .long SYMBOL_NAME(sys_setfsuid16) >> 546 .long SYMBOL_NAME(sys_setfsgid16) >> 547 .long SYMBOL_NAME(sys_llseek) /* 140 */ >> 548 .long SYMBOL_NAME(sys_getdents) >> 549 .long SYMBOL_NAME(sys_select) >> 550 .long SYMBOL_NAME(sys_flock) >> 551 .long SYMBOL_NAME(sys_msync) >> 552 .long SYMBOL_NAME(sys_readv) /* 145 */ >> 553 .long SYMBOL_NAME(sys_writev) >> 554 .long SYMBOL_NAME(sys_getsid) >> 555 .long SYMBOL_NAME(sys_fdatasync) >> 556 .long SYMBOL_NAME(sys_sysctl) >> 557 .long SYMBOL_NAME(sys_mlock) /* 150 */ >> 558 .long SYMBOL_NAME(sys_munlock) >> 559 .long SYMBOL_NAME(sys_mlockall) >> 560 .long SYMBOL_NAME(sys_munlockall) >> 561 .long SYMBOL_NAME(sys_sched_setparam) >> 562 .long SYMBOL_NAME(sys_sched_getparam) /* 155 */ >> 563 .long SYMBOL_NAME(sys_sched_setscheduler) >> 564 .long SYMBOL_NAME(sys_sched_getscheduler) >> 565 .long SYMBOL_NAME(sys_sched_yield) >> 566 .long SYMBOL_NAME(sys_sched_get_priority_max) >> 567 .long SYMBOL_NAME(sys_sched_get_priority_min) /* 160 */ >> 568 .long SYMBOL_NAME(sys_sched_rr_get_interval) >> 569 .long SYMBOL_NAME(sys_nanosleep) >> 570 .long SYMBOL_NAME(sys_mremap) >> 571 .long SYMBOL_NAME(sys_setresuid16) >> 572 .long SYMBOL_NAME(sys_getresuid16) /* 165 */ >> 573 .long SYMBOL_NAME(sys_vm86) >> 574 .long SYMBOL_NAME(sys_query_module) >> 575 .long SYMBOL_NAME(sys_poll) >> 576 .long SYMBOL_NAME(sys_nfsservctl) >> 577 .long SYMBOL_NAME(sys_setresgid16) /* 170 */ >> 578 .long SYMBOL_NAME(sys_getresgid16) >> 579 .long SYMBOL_NAME(sys_prctl) >> 580 .long SYMBOL_NAME(sys_rt_sigreturn) >> 581 .long SYMBOL_NAME(sys_rt_sigaction) >> 582 .long SYMBOL_NAME(sys_rt_sigprocmask) /* 175 */ >> 583 .long SYMBOL_NAME(sys_rt_sigpending) >> 584 .long SYMBOL_NAME(sys_rt_sigtimedwait) >> 585 .long SYMBOL_NAME(sys_rt_sigqueueinfo) >> 586 .long SYMBOL_NAME(sys_rt_sigsuspend) >> 587 .long SYMBOL_NAME(sys_pread) /* 180 */ >> 588 .long SYMBOL_NAME(sys_pwrite) >> 589 .long SYMBOL_NAME(sys_chown16) >> 590 .long SYMBOL_NAME(sys_getcwd) >> 591 .long SYMBOL_NAME(sys_capget) >> 592 .long SYMBOL_NAME(sys_capset) /* 185 */ >> 593 .long SYMBOL_NAME(sys_sigaltstack) >> 594 .long SYMBOL_NAME(sys_sendfile) >> 595 .long SYMBOL_NAME(sys_ni_syscall) /* streams1 */ >> 596 .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */ >> 597 .long SYMBOL_NAME(sys_vfork) /* 190 */ >> 598 .long SYMBOL_NAME(sys_getrlimit) >> 599 .long SYMBOL_NAME(sys_mmap2) >> 600 .long SYMBOL_NAME(sys_truncate64) >> 601 .long SYMBOL_NAME(sys_ftruncate64) >> 602 .long SYMBOL_NAME(sys_stat64) /* 195 */ >> 603 .long SYMBOL_NAME(sys_lstat64) >> 604 .long SYMBOL_NAME(sys_fstat64) >> 605 .long SYMBOL_NAME(sys_lchown) >> 606 .long SYMBOL_NAME(sys_getuid) >> 607 .long SYMBOL_NAME(sys_getgid) /* 200 */ >> 608 .long SYMBOL_NAME(sys_geteuid) >> 609 .long SYMBOL_NAME(sys_getegid) >> 610 .long SYMBOL_NAME(sys_setreuid) >> 611 .long SYMBOL_NAME(sys_setregid) >> 612 .long SYMBOL_NAME(sys_getgroups) /* 205 */ >> 613 .long SYMBOL_NAME(sys_setgroups) >> 614 .long SYMBOL_NAME(sys_fchown) >> 615 .long SYMBOL_NAME(sys_setresuid) >> 616 .long SYMBOL_NAME(sys_getresuid) >> 617 .long SYMBOL_NAME(sys_setresgid) /* 210 */ >> 618 .long SYMBOL_NAME(sys_getresgid) >> 619 .long SYMBOL_NAME(sys_chown) >> 620 .long SYMBOL_NAME(sys_setuid) >> 621 .long SYMBOL_NAME(sys_setgid) >> 622 .long SYMBOL_NAME(sys_setfsuid) /* 215 */ >> 623 .long SYMBOL_NAME(sys_setfsgid) >> 624 .long SYMBOL_NAME(sys_pivot_root) >> 625 .long SYMBOL_NAME(sys_mincore) >> 626 .long SYMBOL_NAME(sys_madvise) >> 627 .long SYMBOL_NAME(sys_getdents64) /* 220 */ >> 628 .long SYMBOL_NAME(sys_fcntl64) >> 629 .long SYMBOL_NAME(sys_ni_syscall) /* reserved for TUX */ >> 630 .long SYMBOL_NAME(sys_ni_syscall) /* Reserved for Security */ >> 631 .long SYMBOL_NAME(sys_gettid) >> 632 .long SYMBOL_NAME(sys_readahead) /* 225 */ >> 633 .long SYMBOL_NAME(sys_setxattr) >> 634 .long SYMBOL_NAME(sys_lsetxattr) >> 635 .long SYMBOL_NAME(sys_fsetxattr) >> 636 .long SYMBOL_NAME(sys_getxattr) >> 637 .long SYMBOL_NAME(sys_lgetxattr) /* 230 */ >> 638 .long SYMBOL_NAME(sys_fgetxattr) >> 639 .long SYMBOL_NAME(sys_listxattr) >> 640 .long SYMBOL_NAME(sys_llistxattr) >> 641 .long SYMBOL_NAME(sys_flistxattr) >> 642 .long SYMBOL_NAME(sys_removexattr) /* 235 */ >> 643 .long SYMBOL_NAME(sys_lremovexattr) >> 644 .long SYMBOL_NAME(sys_fremovexattr) >> 645 .long SYMBOL_NAME(sys_tkill) >> 646 .long SYMBOL_NAME(sys_sendfile64) >> 647 .long SYMBOL_NAME(sys_ni_syscall) /* 240 reserved for futex */ >> 648 .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_setaffinity */ >> 649 .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_getaffinity */ >> 650 .long SYMBOL_NAME(sys_ni_syscall) /* sys_set_thread_area */ >> 651 .long SYMBOL_NAME(sys_ni_syscall) /* sys_get_thread_area */ >> 652 .long SYMBOL_NAME(sys_ni_syscall) /* 245 sys_io_setup */ >> 653 .long SYMBOL_NAME(sys_ni_syscall) /* sys_io_destroy */ >> 654 .long SYMBOL_NAME(sys_ni_syscall) /* sys_io_getevents */ >> 655 .long SYMBOL_NAME(sys_ni_syscall) /* sys_io_submit */ >> 656 .long SYMBOL_NAME(sys_ni_syscall) /* sys_io_cancel */ >> 657 .long SYMBOL_NAME(sys_ni_syscall) /* 250 sys_alloc_hugepages */ >> 658 .long SYMBOL_NAME(sys_ni_syscall) /* sys_free_hugepages */ >> 659 .long SYMBOL_NAME(sys_ni_syscall) /* sys_exit_group */ >> 660 .long SYMBOL_NAME(sys_ni_syscall) /* sys_lookup_dcookie */ >> 661 .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_create */ >> 662 .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_ctl 255 */ >> 663 .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_wait */ >> 664 .long SYMBOL_NAME(sys_ni_syscall) /* sys_remap_file_pages */ >> 665 .long SYMBOL_NAME(sys_ni_syscall) /* sys_set_tid_address */ 521 666 522 /* Filling pads with undefined instructions. !! 667 .rept NR_syscalls-(.-sys_call_table)/4 523 .macro kuser_pad sym size !! 668 .long SYMBOL_NAME(sys_ni_syscall) 524 .if ((. - \sym) & 3) << 525 .rept (4 - (. - \sym) & 3) << 526 .byte 0 << 527 .endr << 528 .endif << 529 .rept ((\size - (. - \sym)) / 4) << 530 .word 0xdeadbeef << 531 .endr 669 .endr 532 .endm << 533 << 534 .align 6 << 535 .globl __kuser_helper_start << 536 __kuser_helper_start: << 537 << 538 __kuser_helper_version: << 539 .word ((__kuser_helper_end - __kuser << 540 << 541 __kuser_cmpxchg: << 542 /* << 543 * r4 pointer to exchange variable << 544 * r5 old value << 545 * r6 new value << 546 */ << 547 cmpxchg_ldw: << 548 ldw r2, 0(r4) << 549 sub r2, r2, r5 << 550 bne r2, zero, cmpxchg_ret << 551 << 552 /* We had a match, store the new value << 553 cmpxchg_stw: << 554 stw r6, 0(r4) << 555 cmpxchg_ret: << 556 ret << 557 << 558 kuser_pad __kuser_cmpxchg, 64 << 559 << 560 .globl __kuser_sigtramp << 561 __kuser_sigtramp: << 562 movi r2, __NR_rt_sigreturn << 563 trap << 564 << 565 kuser_pad __kuser_sigtramp, 64 << 566 << 567 .globl __kuser_helper_end << 568 __kuser_helper_end: <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.