diff options
author | dweller <dweller@cabin.digital> | 2025-04-04 00:00:52 +0300 |
---|---|---|
committer | dweller <dweller@cabin.digital> | 2025-04-04 00:00:52 +0300 |
commit | 0533b005901b976e3e6d11d7ec5078118bbe5a2f (patch) | |
tree | a74846c72ca4f30bff5a3bae03bfffcac7bbac29 /sources/plat.c | |
parent | 9c2842629f2e5f17c6949b5ff37c972f7dd62d4a (diff) |
fix DRW instruction, add arena to iui so I don't need to manage label buffers
Diffstat (limited to 'sources/plat.c')
-rw-r--r-- | sources/plat.c | 24 |
1 files changed, 24 insertions, 0 deletions
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 <dweller@cabin.digital> + * + * 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; +} + |