aboutsummaryrefslogtreecommitdiffstats
path: root/init/log.c
diff options
context:
space:
mode:
authorturret <turret@duck.com>2023-12-18 18:43:52 -0600
committerturret <turret@duck.com>2023-12-18 18:43:52 -0600
commitd04fc8f40347b8e2d1897d9ce3b261a6fe1f6f61 (patch)
tree7c6dff9dc64cd22136e5cc881d74d1bfd69be291 /init/log.c
parent7648b5a7b22ae3b3e3a3fa39fd83bce06554385d (diff)
downloaddiscord-bot-skeleton-d04fc8f40347b8e2d1897d9ce3b261a6fe1f6f61.tar.gz
discord-bot-skeleton-d04fc8f40347b8e2d1897d9ce3b261a6fe1f6f61.tar.bz2
discord-bot-skeleton-d04fc8f40347b8e2d1897d9ce3b261a6fe1f6f61.zip
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
Diffstat (limited to 'init/log.c')
-rw-r--r--init/log.c2
1 files changed, 1 insertions, 1 deletions
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;