From c0d44802625617af6b00cb3f2ad46fd0224229f4 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 16 Jul 2024 18:06:08 -0400 Subject: kernel/amd64: trap: Fix TRAPENTRY %CS offset Signed-off-by: Ian Moffett --- sys/include/arch/amd64/frameasm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/include/arch/amd64/frameasm.h b/sys/include/arch/amd64/frameasm.h index 8983d36..41c9ebe 100644 --- a/sys/include/arch/amd64/frameasm.h +++ b/sys/include/arch/amd64/frameasm.h @@ -126,7 +126,7 @@ */ #define TRAPENTRY(ENTLABEL, TRAPNO) \ ENTLABEL: \ - testq $0x3, 8(%rsp) ; \ + testq $0x3, 16(%rsp) ; \ jz 1f ; \ lfence ; \ swapgs ; \ @@ -134,7 +134,7 @@ mov %rsp, %rdi ; \ call trap_handler ; \ pop_trapframe_ec ; \ - testq $0x3, 8(%rsp) ; \ + testq $0x3, 16(%rsp) ; \ jz 2f ; \ lfence ; \ swapgs ; \ -- cgit v1.2.3