From 044de051e9ba5aa2eb6519ad473e0529c211f99f Mon Sep 17 00:00:00 2001 From: woachk <24752637+woachk@users.noreply.github.com> Date: Thu, 18 Oct 2018 09:33:30 -0700 Subject: [PATCH] Make the Skeleton PAL buildable again --- Pal/src/host/Skeleton/db_events.c | 2 +- Pal/src/host/Skeleton/db_exception.c | 2 +- Pal/src/host/Skeleton/db_ipc.c | 2 +- Pal/src/host/Skeleton/db_memory.c | 6 +++--- Pal/src/host/Skeleton/db_object.c | 2 +- Pal/src/host/Skeleton/db_rtld.c | 4 ++++ Pal/src/host/Skeleton/db_streams.c | 2 +- Pal/src/host/Skeleton/host_endian.h | 4 ++++ 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Pal/src/host/Skeleton/db_events.c b/Pal/src/host/Skeleton/db_events.c index 70f8f55a..0bf8e194 100644 --- a/Pal/src/host/Skeleton/db_events.c +++ b/Pal/src/host/Skeleton/db_events.c @@ -44,7 +44,7 @@ int _DkEventSet (PAL_HANDLE event, int wakeup) return -PAL_ERROR_NOTIMPLEMENTED; } -int _DkEventWaitTimeout (PAL_HANDLE event, int timeout) +int _DkEventWaitTimeout (PAL_HANDLE event, uint64_t timeout) { return -PAL_ERROR_NOTIMPLEMENTED; } diff --git a/Pal/src/host/Skeleton/db_exception.c b/Pal/src/host/Skeleton/db_exception.c index 6ef5cc7c..7377f41d 100644 --- a/Pal/src/host/Skeleton/db_exception.c +++ b/Pal/src/host/Skeleton/db_exception.c @@ -49,7 +49,7 @@ void _DkRaiseFailure (int error) /* need to be implemented */ } -void _DkExceptionReturn (const void * event) +void _DkExceptionReturn (void * event) { /* need to be implemented */ } diff --git a/Pal/src/host/Skeleton/db_ipc.c b/Pal/src/host/Skeleton/db_ipc.c index fc328dbe..b5c1f42a 100644 --- a/Pal/src/host/Skeleton/db_ipc.c +++ b/Pal/src/host/Skeleton/db_ipc.c @@ -51,7 +51,7 @@ struct handle_ops gipc_ops = { .close = &gipc_close, }; -int _DkCreatePhysicalMemoryChannel (PAL_HANDLE * handle, uint64_t * key) +int _DkCreatePhysicalMemoryChannel (PAL_HANDLE * handle, unsigned long * key) { return -PAL_ERROR_NOTIMPLEMENTED; } diff --git a/Pal/src/host/Skeleton/db_memory.c b/Pal/src/host/Skeleton/db_memory.c index ac6be4e3..ba53273b 100644 --- a/Pal/src/host/Skeleton/db_memory.c +++ b/Pal/src/host/Skeleton/db_memory.c @@ -35,18 +35,18 @@ bool _DkCheckMemoryMappable (const void * addr, int size) return true; } -int _DkVirtualMemoryAlloc (void ** paddr, int size, int alloc_type, +int _DkVirtualMemoryAlloc (void ** paddr, uint64_t size, int alloc_type, int prot) { return -PAL_ERROR_NOTIMPLEMENTED; } -int _DkVirtualMemoryFree (void * addr, int size) +int _DkVirtualMemoryFree (void * addr, uint64_t size) { return -PAL_ERROR_NOTIMPLEMENTED; } -int _DkVirtualMemoryProtect (void * addr, int size, int prot) +int _DkVirtualMemoryProtect (void * addr, uint64_t size, int prot) { return -PAL_ERROR_NOTIMPLEMENTED; } diff --git a/Pal/src/host/Skeleton/db_object.c b/Pal/src/host/Skeleton/db_object.c index c9f0c937..6d13f0fe 100644 --- a/Pal/src/host/Skeleton/db_object.c +++ b/Pal/src/host/Skeleton/db_object.c @@ -32,7 +32,7 @@ /* _DkObjectsWaitAny for internal use. The function wait for any of the handle in the handle array. timeout can be set for the wait. */ -int _DkObjectsWaitAny (int count, PAL_HANDLE * handleArray, int timeout, +int _DkObjectsWaitAny (int count, PAL_HANDLE * handleArray, uint64_t timeout, PAL_HANDLE * polled) { return -PAL_ERROR_NOTIMPLEMENTED; diff --git a/Pal/src/host/Skeleton/db_rtld.c b/Pal/src/host/Skeleton/db_rtld.c index 62d7f16b..c116e118 100644 --- a/Pal/src/host/Skeleton/db_rtld.c +++ b/Pal/src/host/Skeleton/db_rtld.c @@ -36,7 +36,11 @@ #include #include +#ifdef __APPLE__ +#include +#else #include +#endif void _DkDebugAddMap (struct link_map * map) { diff --git a/Pal/src/host/Skeleton/db_streams.c b/Pal/src/host/Skeleton/db_streams.c index 61cb0632..a02fb31f 100644 --- a/Pal/src/host/Skeleton/db_streams.c +++ b/Pal/src/host/Skeleton/db_streams.c @@ -38,7 +38,7 @@ void _DkPrintConsole (const void * buf, int size) /* _DkStreamUnmap for internal use. Unmap stream at certain memory address. The memory is unmapped as a whole.*/ -int _DkStreamUnmap (void * addr, int size) +int _DkStreamUnmap (void * addr, uint64_t size) { return -PAL_ERROR_NOTIMPLEMENTED; } diff --git a/Pal/src/host/Skeleton/host_endian.h b/Pal/src/host/Skeleton/host_endian.h index 26a69813..8e477128 100644 --- a/Pal/src/host/Skeleton/host_endian.h +++ b/Pal/src/host/Skeleton/host_endian.h @@ -1,2 +1,6 @@ /* include proper endian.h */ +#ifdef __APPLE__ +#include +#else #include +#endif