Prevent possible UB, and use naked functions correctly.
- Feb 13, 2021
-
-
Jacob Lorentzon authored
The reason for these types of rewrites, is that more recent Rust compilers have started to deprecate naked functions that consist of more than only a single asm block, as they can trigger all sorts of UB.
-
Jacob Lorentzon authored
Previously there was a triple fault, due to a combination of reasons (e.g. rsp and rbp being ordered in the struct and in the assembly). Now, the locks will be held __all the way until the new context__ has been switched to, which completely eliminates any possibility that the "pcid fault" originates here. While I am unsure whether this will work, this could also be an opportunity to be able to remove CONTEXT_SWITCH_LOCK fully.
-
Jacob Lorentzon authored
This is due to a warning in more recent compilers, which forbid anything but a single inline assembly block, in naked functions. It does unfortunately triple fault right now, but I hope I may be able to fix it soon.
-