aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/kernel/entry.S')
-rw-r--r--arch/alpha/kernel/entry.S87
1 files changed, 28 insertions, 59 deletions
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index 2a359c9ee3c..a7607832dd4 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -311,7 +311,7 @@ entSys:
311 311
312 .align 4 312 .align 4
313ret_from_sys_call: 313ret_from_sys_call:
314 cmovne $26, 0, $19 /* $19 = 0 => non-restartable */ 314 cmovne $26, 0, $18 /* $18 = 0 => non-restartable */
315 ldq $0, SP_OFF($sp) 315 ldq $0, SP_OFF($sp)
316 and $0, 8, $0 316 and $0, 8, $0
317 beq $0, ret_to_kernel 317 beq $0, ret_to_kernel
@@ -320,8 +320,8 @@ ret_to_user:
320 sampling and the rti. */ 320 sampling and the rti. */
321 lda $16, 7 321 lda $16, 7
322 call_pal PAL_swpipl 322 call_pal PAL_swpipl
323 ldl $5, TI_FLAGS($8) 323 ldl $17, TI_FLAGS($8)
324 and $5, _TIF_WORK_MASK, $2 324 and $17, _TIF_WORK_MASK, $2
325 bne $2, work_pending 325 bne $2, work_pending
326restore_all: 326restore_all:
327 RESTORE_ALL 327 RESTORE_ALL
@@ -341,10 +341,10 @@ $syscall_error:
341 * frame to indicate that a negative return value wasn't an 341 * frame to indicate that a negative return value wasn't an
342 * error number.. 342 * error number..
343 */ 343 */
344 ldq $19, 0($sp) /* old syscall nr (zero if success) */ 344 ldq $18, 0($sp) /* old syscall nr (zero if success) */
345 beq $19, $ret_success 345 beq $18, $ret_success
346 346
347 ldq $20, 72($sp) /* .. and this a3 */ 347 ldq $19, 72($sp) /* .. and this a3 */
348 subq $31, $0, $0 /* with error in v0 */ 348 subq $31, $0, $0 /* with error in v0 */
349 addq $31, 1, $1 /* set a3 for errno return */ 349 addq $31, 1, $1 /* set a3 for errno return */
350 stq $0, 0($sp) 350 stq $0, 0($sp)
@@ -362,51 +362,35 @@ $ret_success:
362 * Do all cleanup when returning from all interrupts and system calls. 362 * Do all cleanup when returning from all interrupts and system calls.
363 * 363 *
364 * Arguments: 364 * Arguments:
365 * $5: TI_FLAGS.
366 * $8: current. 365 * $8: current.
367 * $19: The old syscall number, or zero if this is not a return 366 * $17: TI_FLAGS.
367 * $18: The old syscall number, or zero if this is not a return
368 * from a syscall that errored and is possibly restartable. 368 * from a syscall that errored and is possibly restartable.
369 * $20: The old a3 value 369 * $19: The old a3 value
370 */ 370 */
371 371
372 .align 4 372 .align 4
373 .ent work_pending 373 .ent work_pending
374work_pending: 374work_pending:
375 and $5, _TIF_NEED_RESCHED, $2 375 and $17, _TIF_NOTIFY_RESUME | _TIF_SIGPENDING, $2
376 beq $2, $work_notifysig 376 bne $2, $work_notifysig
377 377
378$work_resched: 378$work_resched:
379 subq $sp, 16, $sp 379 /*
380 stq $19, 0($sp) /* save syscall nr */ 380 * We can get here only if we returned from syscall without SIGPENDING
381 stq $20, 8($sp) /* and error indication (a3) */ 381 * or got through work_notifysig already. Either case means no syscall
382 * restarts for us, so let $18 and $19 burn.
383 */
382 jsr $26, schedule 384 jsr $26, schedule
383 ldq $19, 0($sp) 385 mov 0, $18
384 ldq $20, 8($sp) 386 br ret_to_user
385 addq $sp, 16, $sp
386 /* Make sure need_resched and sigpending don't change between
387 sampling and the rti. */
388 lda $16, 7
389 call_pal PAL_swpipl
390 ldl $5, TI_FLAGS($8)
391 and $5, _TIF_WORK_MASK, $2
392 beq $2, restore_all
393 and $5, _TIF_NEED_RESCHED, $2
394 bne $2, $work_resched
395 387
396$work_notifysig: 388$work_notifysig:
397 mov $sp, $16 389 mov $sp, $16
398 bsr $1, do_switch_stack 390 bsr $1, do_switch_stack
399 mov $sp, $17 391 jsr $26, do_work_pending
400 mov $5, $18
401 mov $19, $9 /* save old syscall number */
402 mov $20, $10 /* save old a3 */
403 and $5, _TIF_SIGPENDING, $2
404 cmovne $2, 0, $9 /* we don't want double syscall restarts */
405 jsr $26, do_notify_resume
406 mov $9, $19
407 mov $10, $20
408 bsr $1, undo_switch_stack 392 bsr $1, undo_switch_stack
409 br ret_to_user 393 br restore_all
410.end work_pending 394.end work_pending
411 395
412/* 396/*
@@ -454,9 +438,9 @@ $strace_success:
454 438
455 .align 3 439 .align 3
456$strace_error: 440$strace_error:
457 ldq $19, 0($sp) /* old syscall nr (zero if success) */ 441 ldq $18, 0($sp) /* old syscall nr (zero if success) */
458 beq $19, $strace_success 442 beq $18, $strace_success
459 ldq $20, 72($sp) /* .. and this a3 */ 443 ldq $19, 72($sp) /* .. and this a3 */
460 444
461 subq $31, $0, $0 /* with error in v0 */ 445 subq $31, $0, $0 /* with error in v0 */
462 addq $31, 1, $1 /* set a3 for errno return */ 446 addq $31, 1, $1 /* set a3 for errno return */
@@ -464,11 +448,11 @@ $strace_error:
464 stq $1, 72($sp) /* a3 for return */ 448 stq $1, 72($sp) /* a3 for return */
465 449
466 bsr $1, do_switch_stack 450 bsr $1, do_switch_stack
467 mov $19, $9 /* save old syscall number */ 451 mov $18, $9 /* save old syscall number */
468 mov $20, $10 /* save old a3 */ 452 mov $19, $10 /* save old a3 */
469 jsr $26, syscall_trace_leave 453 jsr $26, syscall_trace_leave
470 mov $9, $19 454 mov $9, $18
471 mov $10, $20 455 mov $10, $19
472 bsr $1, undo_switch_stack 456 bsr $1, undo_switch_stack
473 457
474 mov $31, $26 /* tell "ret_from_sys_call" we can restart */ 458 mov $31, $26 /* tell "ret_from_sys_call" we can restart */
@@ -619,24 +603,9 @@ ret_from_kernel_thread:
619 mov $9, $27 603 mov $9, $27
620 mov $10, $16 604 mov $10, $16
621 jsr $26, ($9) 605 jsr $26, ($9)
622 ldgp $gp, 0($26)
623 mov $0, $16
624 mov $31, $26
625 jmp $31, sys_exit
626.end ret_from_kernel_thread
627
628 .globl ret_from_kernel_execve
629 .align 4
630 .ent ret_from_kernel_execve
631ret_from_kernel_execve:
632 mov $16, $sp
633 /* Avoid the HAE being gratuitously wrong, to avoid restoring it. */
634 ldq $2, alpha_mv+HAE_CACHE
635 stq $2, 152($sp) /* HAE */
636 mov $31, $19 /* to disable syscall restarts */ 606 mov $31, $19 /* to disable syscall restarts */
637 br $31, ret_to_user 607 br $31, ret_to_user
638 608.end ret_from_kernel_thread
639.end ret_from_kernel_execve
640 609
641 610
642/* 611/*