Skip to content

Commit

Permalink
Merge pull request #229 from VisorFolks/bugfix/akashkollipara/228-avr…
Browse files Browse the repository at this point in the history
…-irq-hndlr

<AVR8> SP computation fixed in ISR
  • Loading branch information
pranjalchanda08 authored Feb 11, 2023
2 parents 430bd42 + 774f9db commit 07faeae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/arch/avr/8/common_5x_6/terravisor/asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ function arch_panic_handler
push r26
push r27
push r30
push r31
.endm

/**
* CONTEXT_RESTORE - A macro that defines the context restore operation
*/
.macro CONTEXT_RESTORE
pop r31
pop r30
pop r27
pop r26
Expand Down Expand Up @@ -106,11 +104,17 @@ function int_\id
*/
function isr
CONTEXT_SAVE
push r24
in r22, IO_SPL
in r23, IO_SPH
pop r24
/*
* SP at this location needs to be captured
* and passed to interrupt_handler as SP post
* decrements which results in SP pointing to
* incorrect stack frame.
*/
push r31
call interrupt_handler
pop r31
CONTEXT_RESTORE
pop r24
reti
Expand Down

0 comments on commit 07faeae

Please sign in to comment.