diff --git a/src/arch/x86_64/interrupt/handler.rs b/src/arch/x86_64/interrupt/handler.rs index 070454b6d11fcb0888adf90937a96f7c7929ec45..274d8d6e446614f98e5a9587503c8222f3b079eb 100644 --- a/src/arch/x86_64/interrupt/handler.rs +++ b/src/arch/x86_64/interrupt/handler.rs @@ -281,11 +281,13 @@ macro_rules! push_fs { push fs // Load kernel tls - // We can't load the value directly into `fs`. We also can't use `rax` - // as the temporary value, as during errors that's already used for the - // error code. - mov rbx, 0x18 - mov fs, bx + // + // NOTE: We can't load the value directly into `fs`. So we need to use a + // scratch register (as preserved registers aren't backed up by the + // interrupt! macro) to store it. We also can't use `rax` as the temporary + // value, as during errors that's already used for the error code. + mov rcx, 0x18 + mov fs, cx " }; } #[macro_export]