Browse Source

Make the Skeleton PAL buildable again

woachk 5 years ago
parent
commit
044de051e9

+ 1 - 1
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;
 }

+ 1 - 1
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 */
 }

+ 1 - 1
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;
 }

+ 3 - 3
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;
 }

+ 1 - 1
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;

+ 4 - 0
Pal/src/host/Skeleton/db_rtld.c

@@ -36,7 +36,11 @@
 
 #include <sysdeps/generic/ldsodefs.h>
 #include <elf/elf.h>
+#ifdef __APPLE__
+#include <dlfcn.h>
+#else
 #include <bits/dlfcn.h>
+#endif 
 
 void _DkDebugAddMap (struct link_map * map)
 {

+ 1 - 1
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;
 }

+ 4 - 0
Pal/src/host/Skeleton/host_endian.h

@@ -1,2 +1,6 @@
 /* include proper endian.h */
+#ifdef __APPLE__
+#include <machine/endian.h>
+#else
 #include <endian.h>
+#endif