mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
util: os_misc: add Fuchsia support
v2: cleaner detect os check (robclark@) Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Eric Engestrom <eric@igalia.com> Acked-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29539>
This commit is contained in:
parent
d6096ce8c8
commit
2a3f53bd3b
1 changed files with 7 additions and 1 deletions
|
|
@ -68,6 +68,9 @@
|
|||
# include <kernel/OS.h>
|
||||
#elif DETECT_OS_WINDOWS
|
||||
# include <windows.h>
|
||||
#elif DETECT_OS_FUCHSIA
|
||||
#include <unistd.h>
|
||||
#include <zircon/syscalls.h>
|
||||
#else
|
||||
#error unexpected platform in os_sysinfo.c
|
||||
#endif
|
||||
|
|
@ -311,6 +314,9 @@ os_get_total_physical_memory(uint64_t *size)
|
|||
ret = GlobalMemoryStatusEx(&status);
|
||||
*size = status.ullTotalPhys;
|
||||
return (ret == true);
|
||||
#elif DETECT_OS_FUCHSIA
|
||||
*size = zx_system_get_physmem();
|
||||
return true;
|
||||
#else
|
||||
#error unexpected platform in os_misc.c
|
||||
return false;
|
||||
|
|
@ -381,7 +387,7 @@ os_get_available_system_memory(uint64_t *size)
|
|||
bool
|
||||
os_get_page_size(uint64_t *size)
|
||||
{
|
||||
#if DETECT_OS_POSIX && !DETECT_OS_APPLE && !DETECT_OS_HAIKU
|
||||
#if DETECT_OS_POSIX_LITE && !DETECT_OS_APPLE && !DETECT_OS_HAIKU
|
||||
const long page_size = sysconf(_SC_PAGE_SIZE);
|
||||
|
||||
if (page_size <= 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue