Skip to content

Commit

Permalink
td-exception: fix interrupt handler condition
Browse files Browse the repository at this point in the history
The compiler may perform a circular right shift, resulting in incorrect
assembly code for interrupt vectors greater than 64. Unconditionally push
an error code of 0 for interrupt vectors greater than 31, as the CPU
does not save an error code for these interrupts.

Signed-off-by: Jiaqi Gao <jiaqi.gao@intel.com>
  • Loading branch information
gaojiaqi7 committed Dec 26, 2024
1 parent 369d721 commit c8067b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion td-exception/src/asm/handler.asm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ interrupt_handler_table:
i = 0
.rept 256
.align 32
.if ((EXCEPTION_ERROR_CODE_MASK >> i) & 1) == 0
.if i > 31 || ((EXCEPTION_ERROR_CODE_MASK >> i) & 1) == 0
push 0
.endif
push i
Expand Down

0 comments on commit c8067b3

Please sign in to comment.