summaryrefslogtreecommitdiff
path: root/boot/fake_syscall_entry.S
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2025-01-31 00:48:54 +0000
committerAda Christine <adachristine18@gmail.com>2025-01-31 00:48:54 +0000
commit2fb3f208bd2e739a8968afb23d22e13b6660ca22 (patch)
tree4bf02b06ed27c2726f675f752e064211df934323 /boot/fake_syscall_entry.S
parent0d2ddecc9aeb232746b76b4eebdb1381053a8951 (diff)
spread around defs, x86 asm and bits libs
Diffstat (limited to 'boot/fake_syscall_entry.S')
-rw-r--r--boot/fake_syscall_entry.S17
1 files changed, 13 insertions, 4 deletions
diff --git a/boot/fake_syscall_entry.S b/boot/fake_syscall_entry.S
index ff2428d..bc175c1 100644
--- a/boot/fake_syscall_entry.S
+++ b/boot/fake_syscall_entry.S
@@ -1,18 +1,27 @@
.section .text
+.global fake_syscall_entry
+.global fake_syscall_return
+
.extern fake_syscall_handler
-.global fake_syscall_entry
fake_syscall_entry:
- hlt
+ hlt;
-.global fake_syscall_return
fake_syscall_return:
cli
+fake_syscall_swap:
+ mov %cs, %rax
+ pushq %rax
+ pushq %rdx
+ mov %ds, %rax
+ pushq %rax
+ sub $16, %rsp
+ sgdt (%rsp)
+ mov %rsp, (%rsi)
mov %rdi, %rsp
lgdt (%rsp)
add $16, %rsp
-
movw (%rsp), %ds
movw (%rsp), %es
movw (%rsp), %fs