From 642b5fb0007b64c77d186fcb018d571152ee1d47 Mon Sep 17 00:00:00 2001
From: dzwdz
Date: Mon, 14 Aug 2023 18:51:07 +0200
Subject: reorganization: first steps

---
 src/libc/elfload.S | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 src/libc/elfload.S

(limited to 'src/libc/elfload.S')

diff --git a/src/libc/elfload.S b/src/libc/elfload.S
new file mode 100644
index 0000000..78d5b3c
--- /dev/null
+++ b/src/libc/elfload.S
@@ -0,0 +1,20 @@
+#define ASM_FILE 1
+#include <camellia/syscalls.h>
+
+.section .text
+.global _freejmp_chstack
+.type _freejmp_chstack, @function
+// void _freejmp_chstack(void *entry, void *low, size_t len, char **argv, char **envp, void *stack);
+_freejmp_chstack:
+	mov %r9, %rsp
+	jmp _freejmp
+
+.section .text
+.global execbuf_chstack
+.type execbuf_chstack, @function
+// _Noreturn void execbuf_chstack(void *stack, void __user *buf, size_t len);
+execbuf_chstack:
+	mov %rdi, %rsp
+	mov $_SYS_EXECBUF, %rdi
+	syscall
+	hlt // if execbuf failed we might as well crash
-- 
cgit v1.2.3