From e4d16330a10bf15602c25b4d323df18e9f08e4a9 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 5 Jul 2018 21:30:52 +0200 Subject: [PATCH] unix port: fix compiling NO_SYS Signed-off-by: Simon Goldschmidt --- ports/unix/port/include/arch/cc.h | 2 ++ ports/unix/port/include/arch/sys_arch.h | 2 +- ports/unix/port/sys_arch.c | 14 ++++++-------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ports/unix/port/include/arch/cc.h b/ports/unix/port/include/arch/cc.h index 477da85..8b0df31 100644 --- a/ports/unix/port/include/arch/cc.h +++ b/ports/unix/port/include/arch/cc.h @@ -75,4 +75,6 @@ typedef struct sio_status_s sio_status_t; #define sio_fd_t sio_status_t* #define __sio_fd_t_defined +typedef unsigned int sys_prot_t; + #endif /* LWIP_ARCH_CC_H */ diff --git a/ports/unix/port/include/arch/sys_arch.h b/ports/unix/port/include/arch/sys_arch.h index f11ae33..c41be0b 100644 --- a/ports/unix/port/include/arch/sys_arch.h +++ b/ports/unix/port/include/arch/sys_arch.h @@ -35,7 +35,7 @@ #define SYS_MBOX_NULL NULL #define SYS_SEM_NULL NULL -typedef u32_t sys_prot_t; +/*typedef u32_t sys_prot_t;*/ struct sys_sem; typedef struct sys_sem * sys_sem_t; diff --git a/ports/unix/port/sys_arch.c b/ports/unix/port/sys_arch.c index c6f619a..3404e8d 100644 --- a/ports/unix/port/sys_arch.c +++ b/ports/unix/port/sys_arch.c @@ -84,6 +84,12 @@ get_monotonic_time(struct timespec *ts) #endif } +#if SYS_LIGHTWEIGHT_PROT +static pthread_mutex_t lwprot_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_t lwprot_thread = (pthread_t)0xDEAD; +static int lwprot_count = 0; +#endif /* SYS_LIGHTWEIGHT_PROT */ + #if !NO_SYS static struct sys_thread *threads = NULL; @@ -121,12 +127,6 @@ struct sys_thread { pthread_t pthread; }; -#if SYS_LIGHTWEIGHT_PROT -static pthread_mutex_t lwprot_mutex = PTHREAD_MUTEX_INITIALIZER; -static pthread_t lwprot_thread = (pthread_t)0xDEAD; -static int lwprot_count = 0; -#endif /* SYS_LIGHTWEIGHT_PROT */ - static struct sys_sem *sys_sem_new_internal(u8_t count); static void sys_sem_free_internal(struct sys_sem *sem); @@ -181,7 +181,6 @@ sys_thread_new(const char *name, lwip_thread_fn function, void *arg, int stacksi return st; } -#if !NO_SYS #if LWIP_TCPIP_CORE_LOCKING static pthread_t lwip_core_lock_holder_thread_id; void sys_lock_tcpip_core(void) @@ -217,7 +216,6 @@ void sys_check_core_locking(void) #endif /* LWIP_TCPIP_CORE_LOCKING */ } } -#endif /* !NO_SYS */ /*-----------------------------------------------------------------------------------*/ /* Mailbox */