Remove save/restore of r0-r31 from monitor code

Because the monitor is now only called from system_breakpoint_handler
(which already saves and restores all of the registers), it is now
unneccessary to save and restore all of the registers in the monitor.
This commit is contained in:
mebibytedraco 2023-12-22 16:34:06 -05:00
parent 57409ecb6e
commit 09c0d8c215

View File

@ -1,43 +1,11 @@
; debug monitor ; debug monitor
; only call this from system_breakpoint_handler!
invoke_monitor: invoke_monitor:
; return if we're already in the monitor ; return if we're already in the monitor
cmp [0x000003FC], monitor_vsync_handler cmp [0x000003FC], monitor_vsync_handler
ifz jmp invoke_monitor_aleady_in_monitor ifz jmp invoke_monitor_aleady_in_monitor
push r31
push r30
push r29
push r28
push r27
push r26
push r25
push r24
push r23
push r22
push r21
push r20
push r19
push r18
push r17
push r16
push r15
push r14
push r13
push r12
push r11
push r10
push r9
push r8
push r7
push r6
push r5
push r4
push r3
push r2
push r1
push r0
; set the vsync handler to our own and reenable interrupts ; set the vsync handler to our own and reenable interrupts
mov [MONITOR_OLD_VSYNC_HANDLER], [0x000003FC] mov [MONITOR_OLD_VSYNC_HANDLER], [0x000003FC]
mov [0x000003FC], monitor_vsync_handler mov [0x000003FC], monitor_vsync_handler
@ -94,39 +62,6 @@ exit_monitor:
call enable_cursor call enable_cursor
pop r0
pop r1
pop r2
pop r3
pop r4
pop r5
pop r6
pop r7
pop r8
pop r9
pop r10
pop r11
pop r12
pop r13
pop r14
pop r15
pop r16
pop r17
pop r18
pop r19
pop r20
pop r21
pop r22
pop r23
pop r24
pop r25
pop r26
pop r27
pop r28
pop r29
pop r30
pop r31
ret ret
exit_monitor_and_jump: exit_monitor_and_jump:
@ -140,39 +75,6 @@ exit_monitor_and_jump:
; save the jump address in a temporary location ; save the jump address in a temporary location
mov [MONITOR_OLD_RSP], r0 mov [MONITOR_OLD_RSP], r0
pop r0
pop r1
pop r2
pop r3
pop r4
pop r5
pop r6
pop r7
pop r8
pop r9
pop r10
pop r11
pop r12
pop r13
pop r14
pop r15
pop r16
pop r17
pop r18
pop r19
pop r20
pop r21
pop r22
pop r23
pop r24
pop r25
pop r26
pop r27
pop r28
pop r29
pop r30
pop r31
jmp [MONITOR_OLD_RSP] jmp [MONITOR_OLD_RSP]
invoke_monitor_aleady_in_monitor: invoke_monitor_aleady_in_monitor: