From 56eb5d2f618177bb9fff4497c12ccc6a80bc7b5d Mon Sep 17 00:00:00 2001 From: Don Porter Date: Tue, 7 May 2019 15:28:11 -0400 Subject: [PATCH] Build fixes. --- Pal/src/host/FreeBSD/Makefile | 2 +- Pal/src/host/FreeBSD/db_ipc.c | 2 +- Pal/src/host/FreeBSD/db_main.c | 8 ++++---- Pal/src/host/FreeBSD/db_object.c | 2 +- Pal/src/host/FreeBSD/db_threading.c | 8 ++------ 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Pal/src/host/FreeBSD/Makefile b/Pal/src/host/FreeBSD/Makefile index b4dd6093..a587ff1e 100644 --- a/Pal/src/host/FreeBSD/Makefile +++ b/Pal/src/host/FreeBSD/Makefile @@ -4,7 +4,7 @@ CFLAGS += -I. -Iinclude -I../.. -I../../../include -I../../../lib -I../../../ipc -I../../../linux-kernel/graphene ASFLAGS += -I. -Iinclude -I../.. -I../../../include -host_target = libpal-FreeBSD.a ../../pal-gdb +host_target = libpal-FreeBSD.a pal-gdb defs = -DIN_PAL -DPAL_DIR="$(PAL_DIR)" objs = $(addprefix db_,files devices pipes sockets streams memory threading \ diff --git a/Pal/src/host/FreeBSD/db_ipc.c b/Pal/src/host/FreeBSD/db_ipc.c index 5664f236..09a69aec 100644 --- a/Pal/src/host/FreeBSD/db_ipc.c +++ b/Pal/src/host/FreeBSD/db_ipc.c @@ -63,7 +63,7 @@ int _DkCreatePhysicalMemoryChannel (PAL_HANDLE * handle, uint64_t * key) } int _DkPhysicalMemoryCommit (PAL_HANDLE channel, int entries, - PAL_PTR * addrs, PAL_NUM * sizes, int flags) + PAL_PTR * addrs, PAL_NUM * sizes) { return -PAL_ERROR_NOTIMPLEMENTED; } diff --git a/Pal/src/host/FreeBSD/db_main.c b/Pal/src/host/FreeBSD/db_main.c index 70a4fc86..4c413cf3 100644 --- a/Pal/src/host/FreeBSD/db_main.c +++ b/Pal/src/host/FreeBSD/db_main.c @@ -220,7 +220,7 @@ void pal_bsd_main (void * args) bsd_state.pid = INLINE_SYSCALL(getpid, 0); bsd_state.uid = uid; bsd_state.gid = gid; - + if (!bsd_state.parent_pid) bsd_state.parent_pid = bsd_state.pid; @@ -360,14 +360,14 @@ void _DkGetCPUInfo (PAL_CPU_INFO * ci) ci->cpu_model = BIT_EXTRACT_LE(words[PAL_CPUID_WORD_EAX], 4, 8); ci->cpu_stepping = BIT_EXTRACT_LE(words[PAL_CPUID_WORD_EAX], 0, 4); - /* According to SDM: EBX[15:0] is to enumerate processor topology + /* According to SDM: EBX[15:0] is to enumerate processor topology * of the system. However this value is intended for display/diagnostic * purposes. The actual number of logical processors available to - * BIOS/OS/App may be different. We use this leaf for now as it's the + * BIOS/OS/App may be different. We use this leaf for now as it's the * best option we have so far to get the cpu number */ cpuid(0xb, 1, words, 0); - ci->cpu_num = BIT_EXTRACT_LE(words[WORD_EBX], 0, 16); + ci->cpu_num = BIT_EXTRACT_LE(words[PAL_CPUID_WORD_EBX], 0, 16); int flen = 0, fmax = 80; char * flags = malloc(fmax); diff --git a/Pal/src/host/FreeBSD/db_object.c b/Pal/src/host/FreeBSD/db_object.c index 139011fa..a78d8dd3 100644 --- a/Pal/src/host/FreeBSD/db_object.c +++ b/Pal/src/host/FreeBSD/db_object.c @@ -110,7 +110,7 @@ static int _DkObjectWaitOne (PAL_HANDLE handle, int timeout) /* _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, uint64_t timeout, +int _DkObjectsWaitAny (int count, PAL_HANDLE * handleArray, int64_t timeout, PAL_HANDLE * polled) { if (count <= 0) diff --git a/Pal/src/host/FreeBSD/db_threading.c b/Pal/src/host/FreeBSD/db_threading.c index 71da3a2c..5c90ea08 100644 --- a/Pal/src/host/FreeBSD/db_threading.c +++ b/Pal/src/host/FreeBSD/db_threading.c @@ -54,16 +54,12 @@ int _DkThreadCreate (PAL_HANDLE * handle, int (*callback) (void *), PAL_PROT_READ|PAL_PROT_WRITE) < 0) return -PAL_ERROR_NOMEM; - // move child_stack to the top of stack. + // move child_stack to the top of stack. child_stack += THREAD_STACK_SIZE; - // align child_stack to 16 + // align child_stack to 16 child_stack = ALIGN_DOWN_PTR(child_stack, 16); - flags &= PAL_THREAD_MASK; - - assert(!flags); //FreeBSD does not support any more flags for rfork! - int ret = rfork_thread( RFPROC|RFNOWAIT|RFSIGSHARE|RFMEM, child_stack,