From 2fb3f208bd2e739a8968afb23d22e13b6660ca22 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Fri, 31 Jan 2025 00:48:54 +0000 Subject: spread around defs, x86 asm and bits libs --- boot/fake_syscall_entry.S | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'boot/fake_syscall_entry.S') 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 -- cgit v1.3.1-1-g115d