|
1 | | -/* $NetBSD: locore.s,v 1.55 2026/03/18 04:15:31 thorpej Exp $ */ |
| 1 | +/* $NetBSD: locore.s,v 1.56 2026/03/18 13:56:06 thorpej Exp $ */ |
2 | 2 |
|
3 | 3 | /* |
4 | 4 | * Copyright (c) 1980, 1990, 1993 |
@@ -467,8 +467,8 @@ ENTRY_NOPROFILE(trap0) |
467 | 467 | movl %d0,%sp@- | push syscall number |
468 | 468 | jbsr _C_LABEL(syscall) | handle it |
469 | 469 | addql #4,%sp | pop syscall arg |
470 | | - tstl _C_LABEL(astpending) |
471 | | - jne Lrei2 |
| 470 | + tstl _C_LABEL(astpending) | AST pending? |
| 471 | + jne _ASM_LABEL(doast) | Yup, go deal with it. |
472 | 472 | movl %sp@(FR_SP),%a0 | grab and restore |
473 | 473 | movl %a0,%usp | user SP |
474 | 474 | moveml %sp@+,#0x7FFF | restore most registers |
@@ -611,57 +611,6 @@ ENTRY_NOPROFILE(lev7intr) /* level 7: parity errors, reset key */ |
611 | 611 | addql #8,%sp | pop SP and stack adjust |
612 | 612 | jra _ASM_LABEL(rei) | all done |
613 | 613 |
|
614 | | -/* |
615 | | - * Emulation of VAX REI instruction. |
616 | | - * |
617 | | - * This code deals with checking for and servicing ASTs |
618 | | - * (profiling, scheduling) and software interrupts (network, softclock). |
619 | | - * We check for ASTs first, just like the VAX. To avoid excess overhead |
620 | | - * the T_ASTFLT handling code will also check for software interrupts so we |
621 | | - * do not have to do it here. After identifying that we need an AST we |
622 | | - * drop the IPL to allow device interrupts. |
623 | | - * |
624 | | - * This code is complicated by the fact that sendsig may have been called |
625 | | - * necessitating a stack cleanup. |
626 | | - */ |
627 | | -ASENTRY_NOPROFILE(rei) |
628 | | - tstl _C_LABEL(astpending) | AST pending? |
629 | | - jeq Ldorte | Nope. Just return. |
630 | | -Lrei1: |
631 | | - btst #5,%sp@ | Are we returning to user mode? |
632 | | - jne Ldorte | Nope. Just return. |
633 | | - movw #PSL_LOWIPL,%sr | lower SPL |
634 | | - clrl %sp@- | stack adjust |
635 | | - moveml #0xFFFF,%sp@- | save all registers |
636 | | - movl %usp,%a1 | including |
637 | | - movl %a1,%sp@(FR_SP) | the users SP |
638 | | -Lrei2: |
639 | | - clrl %sp@- | VA == none |
640 | | - clrl %sp@- | code == none |
641 | | - movl #T_ASTFLT,%sp@- | type == async system trap |
642 | | - pea %sp@(12) | fp == address of trap frame |
643 | | - jbsr _C_LABEL(trap) | go handle it |
644 | | - lea %sp@(16),%sp | pop value args |
645 | | - movl %sp@(FR_SP),%a0 | restore user SP |
646 | | - movl %a0,%usp | from save area |
647 | | - movw %sp@(FR_ADJ),%d0 | need to adjust stack? |
648 | | - jne Laststkadj | yes, go to it |
649 | | - moveml %sp@+,#0x7FFF | no, restore most user regs |
650 | | - addql #8,%sp | toss SP and stack adjust |
651 | | - rte | and do real RTE |
652 | | -Laststkadj: |
653 | | - lea %sp@(FR_HW),%a1 | pointer to HW frame |
654 | | - addql #8,%a1 | source pointer |
655 | | - movl %a1,%a0 | source |
656 | | - addw %d0,%a0 | + hole size = dest pointer |
657 | | - movl %a1@-,%a0@- | copy |
658 | | - movl %a1@-,%a0@- | 8 bytes |
659 | | - movl %a0,%sp@(FR_SP) | new SSP |
660 | | - moveml %sp@+,#0x7FFF | restore user registers |
661 | | - movl %sp@,%sp | and our SP |
662 | | -Ldorte: |
663 | | - rte | and do real RTE |
664 | | - |
665 | 614 | /* |
666 | 615 | * Primitives |
667 | 616 | */ |
|
0 commit comments