diff options
| author | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-09 10:27:19 +0200 |
|---|---|---|
| committer | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-09 10:27:19 +0200 |
| commit | 04e3bbd771c8a50822aa9e75c8715349fc4ecda4 (patch) | |
| tree | fc4509cdf3738a750f93a617dd01029d1ae1d58d /dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm | |
| parent | ef71b80d3df1969a2be85eadf2d83cd85745469d (diff) | |
META: Bumping repository.
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm')
| -rw-r--r-- | dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm b/dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm index c61db220..945830e2 100644 --- a/dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm +++ b/dev/ZKA/HALKit/AMD64/HalMPContextSwitch.asm @@ -11,13 +11,18 @@ [global mp_do_user_switch] [global mp_do_context_switch_pre] +[global mp_user_switch_proc] +[global mp_user_switch_proc_end] section .text -;; Does a user mode switch, and then loads the task to be run. -;; rcx: code ptr. -;; rdx: stack ptr. +;; @brief Switch to user mode. mp_do_user_switch: + mov rbp, rsp + mov rsp, mp_user_switch_proc_end + + invlpg [0] + mov ax, 0x18 | 3 mov ds, ax mov es, ax @@ -36,8 +41,6 @@ mp_do_user_switch: mov rdx, mp_user_switch_proc push rdx - mov rsp, mp_user_switch_proc_end - o64 iret section .bss |
