From 1294ef3e2b6f43c8daff4ce3dc4254d335428ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Mon, 13 May 2024 11:11:07 +0200 Subject: [PATCH] feat(sys): add `sys_available_parallelism` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- src/syscalls/processor.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/syscalls/processor.rs b/src/syscalls/processor.rs index c15e8ad527..3eeb2a0b78 100644 --- a/src/syscalls/processor.rs +++ b/src/syscalls/processor.rs @@ -6,6 +6,11 @@ pub extern "C" fn sys_get_processor_count() -> usize { get_processor_count().try_into().unwrap() } +#[hermit_macro::system] +pub extern "C" fn sys_available_parallelism() -> usize { + get_processor_count().try_into().unwrap() +} + /// Returns the processor frequency in MHz. #[hermit_macro::system] pub extern "C" fn sys_get_processor_frequency() -> u16 {