Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel/cpu-6809/lowlevel-6809.s minor optimisations #1148

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Kernel/cpu-6809/lowlevel-6809.s
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,18 @@ interrupt_handler:

; switch stacks
sts istack_switched_sp
lds #istack_top-2
; FIXME: check store/dec order might not need to be -2 here!!!!
lds #istack_top

jsr map_save

ldb U_DATA__U_INSYS ; In a system call ?
bne in_kernel

; we're not in kernel mode, check for signals and fault
lda 0 ; save address 0 contents for checking
cmpa #0x7E ; JMP at 0
beq nofault
lda #0x7E ; put it back
sta 0 ; write
lda #0x7e
cmpa 0 ; JMP at 0?
beq nofault ; yes? not a fault
sta 0 ; fault - put JMP back
jsr map_kernel
ldb #11 ; SIGSEGV
jsr trap_signal ; signal the user with a fault
Expand Down Expand Up @@ -355,7 +353,7 @@ nmimsg: .ascii "[NMI]"
.db 13,10,0

nmi_handler:
lds #istack_top-2 ; We aren't coming back so this is ok
lds #istack_top ; We aren't coming back so this is ok
jsr map_kernel
ldx #nmimsg
jsr outstring
Expand Down