From 8f79b748de5f4d6ed6c2e31bab996d441659c625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Tue, 5 Dec 2023 15:47:34 +0100 Subject: [PATCH] feat: add `sys_image_start_address` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- src/syscalls/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/syscalls/mod.rs b/src/syscalls/mod.rs index 5c090aab38..7d1c55d910 100644 --- a/src/syscalls/mod.rs +++ b/src/syscalls/mod.rs @@ -257,3 +257,12 @@ extern "C" fn __sys_dup(fd: i32) -> i32 { pub extern "C" fn sys_dup(fd: i32) -> i32 { kernel_function!(__sys_dup(fd)) } + +extern "C" fn __sys_image_start_addr() -> usize { + crate::mm::kernel_start_address().0.try_into().unwrap() +} + +#[no_mangle] +pub extern "C" fn sys_image_start_addr() -> usize { + kernel_function!(__sys_image_start_addr()) +}