From 0533b005901b976e3e6d11d7ec5078118bbe5a2f Mon Sep 17 00:00:00 2001 From: dweller Date: Fri, 4 Apr 2025 00:00:52 +0300 Subject: fix DRW instruction, add arena to iui so I don't need to manage label buffers --- sources/plat.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 sources/plat.c (limited to 'sources/plat.c') diff --git a/sources/plat.c b/sources/plat.c new file mode 100644 index 0000000..afa0f21 --- /dev/null +++ b/sources/plat.c @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2025 dwlr + * + * BSD 3-Clause License (BSD-3-Clause) + * See LICENSE for details + */ + + +ssize cpu_count(void) +{ + static ssize cpus = 0; + if(!cpus) cpus = sysconf(_SC_NPROCESSORS_ONLN); + + return cpus; +} + +ssize mm_pagesize(void) +{ + static ssize page_size = 0; + if(!page_size) page_size = sysconf(_SC_PAGE_SIZE); + + return page_size; +} + -- cgit v1.2.3