diff options
Diffstat (limited to 'sys/include/arch/amd64/frameasm.h')
-rw-r--r-- | sys/include/arch/amd64/frameasm.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/include/arch/amd64/frameasm.h b/sys/include/arch/amd64/frameasm.h index 5a4210f..4dc075e 100644 --- a/sys/include/arch/amd64/frameasm.h +++ b/sys/include/arch/amd64/frameasm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Ian Marco Moffett and the Osmora Team. + * Copyright (c) 2023-2025 Ian Marco Moffett and the Osmora Team. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,6 +30,8 @@ #ifndef _MACHINE_FRAMEASM_H_ #define _MACHINE_FRAMEASM_H_ +#define ALIGN_TEXT .align 8, 0x90 + /* * If the interrupt has an error code, this macro shall * be used to create the trapframe. @@ -121,6 +123,7 @@ */ #define TRAPENTRY_EC(ENTLABEL, TRAPNO) \ ENTLABEL: ; \ + cli ; \ testq $0x3, 16(%rsp) ; \ jz 1f ; \ lfence ; \ @@ -133,7 +136,8 @@ jz 2f ; \ lfence ; \ swapgs ; \ - 2: iretq + 2: sti ; \ + iretq /* * Trap entry where no error code is on @@ -141,6 +145,7 @@ */ #define TRAPENTRY(ENTLABEL, TRAPNO) \ ENTLABEL: ; \ + cli ; \ testq $0x3, 8(%rsp) ; \ jz 1f ; \ lfence ; \ @@ -153,6 +158,7 @@ jz 2f ; \ lfence ; \ swapgs ; \ - 2: iretq + 2: sti ; \ + iretq #endif /* !_MACHINE_FRAMEASM_H_ */ |