Fix random userspace page faults

I was an idiot and forgot rbx wasn't always backed up. As a result, we
should never ever write to it
This commit is contained in:
jD91mZM2
2020-07-16 16:32:48 +02:00
parent acebd1a8d1
commit 4fbe86a9ce

View File

@@ -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]