From d04fc8f40347b8e2d1897d9ce3b261a6fe1f6f61 Mon Sep 17 00:00:00 2001 From: turret Date: Mon, 18 Dec 2023 18:43:52 -0600 Subject: log: edit inline assembly just read the note on osdev wiki that stated that input operands shouldn't be changed, so we move both rax and the console lock to the output operands so the compiler knows we are modifying them for our lovely optimisation --- init/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'init/log.c') diff --git a/init/log.c b/init/log.c index 2df6d82..4fe748e 100644 --- a/init/log.c +++ b/init/log.c @@ -42,7 +42,7 @@ retry: ; asm("mov %0, 1\n\t" - "xchg %0, %1" : "=r" (rax) : "m" (console_lock)); + "xchg %0, %1" : "=r" (rax), "=m" (console_lock)); if(rax) goto retry; -- cgit v1.2.3