summaryrefslogtreecommitdiff
path: root/src/arch/amd64/cpu/debugger.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-02-03 14:36:26 -0500
committerFreya Murphy <freya@freyacat.org>2024-02-03 14:41:52 -0500
commit8e74123683072deed9ecd29e76037a16a47e3295 (patch)
tree2a4d6394688ed23b9360ff87c8d9861ab40da01d /src/arch/amd64/cpu/debugger.c
parentrefactor exception panic (diff)
downloadcorn-8e74123683072deed9ecd29e76037a16a47e3295.tar.gz
corn-8e74123683072deed9ecd29e76037a16a47e3295.tar.bz2
corn-8e74123683072deed9ecd29e76037a16a47e3295.zip
alloc on write paging, -O3 compile works, 'volatile' is the story of my life
Diffstat (limited to 'src/arch/amd64/cpu/debugger.c')
-rw-r--r--src/arch/amd64/cpu/debugger.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arch/amd64/cpu/debugger.c b/src/arch/amd64/cpu/debugger.c
index 4d9d3c3..0f48b84 100644
--- a/src/arch/amd64/cpu/debugger.c
+++ b/src/arch/amd64/cpu/debugger.c
@@ -376,7 +376,7 @@ static int debugger_prompt(struct isr_regs *state) {
}
}
-void debugger(struct isr_regs *state, int cause) {
+void debugger(struct isr_regs *volatile state, int cause) {
struct dr6 dr6;
__asm__ volatile ("mov %%dr6, %0" : "=r"(dr6));
@@ -398,7 +398,8 @@ void debugger(struct isr_regs *state, int cause) {
dbg_steps = 0;
dbg_continue = 0;
- ((struct rflags *)&state->rflags)->tf = 0;
+ struct rflags *rflags = (struct rflags *) &state->rflags;
+ rflags->tf = 0;
if (dr6.b0) {
state->rip += bkps[0].instr_len;