From 557108c7011c211dddd4920457f950c9e6d33d4f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 28 Dec 2013 12:04:39 -0600 Subject: Add sem_timedwait to syscalls --- nuttx/ChangeLog | 1 + nuttx/include/sys/syscall.h | 19 ++++++++++--------- nuttx/libnx/nxmu/nx_redrawreq.c | 7 ++++++- nuttx/syscall/syscall.csv | 1 + nuttx/syscall/syscall_lookup.h | 3 ++- nuttx/syscall/syscall_stublookup.c | 1 + 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index d9edffaf7..75e8cbe78 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -6330,4 +6330,5 @@ graphics is not properly a part of libc (2013-12-28). * Move graphics/nxfonts to libnx/nxfonts (2013-12-28). * Move graphics/nxtk to libnx/nxtk (2013-12-28). + * syscalls: Need to add sem_timedwait() (2013-12-28) diff --git a/nuttx/include/sys/syscall.h b/nuttx/include/sys/syscall.h index 58ed508bf..142c583ac 100644 --- a/nuttx/include/sys/syscall.h +++ b/nuttx/include/sys/syscall.h @@ -86,15 +86,16 @@ #define SYS_sem_destroy (CONFIG_SYS_RESERVED+14) #define SYS_sem_open (CONFIG_SYS_RESERVED+15) #define SYS_sem_post (CONFIG_SYS_RESERVED+16) -#define SYS_sem_trywait (CONFIG_SYS_RESERVED+17) -#define SYS_sem_unlink (CONFIG_SYS_RESERVED+18) -#define SYS_sem_wait (CONFIG_SYS_RESERVED+19) -#define SYS_set_errno (CONFIG_SYS_RESERVED+20) -#define SYS_task_create (CONFIG_SYS_RESERVED+21) -#define SYS_task_delete (CONFIG_SYS_RESERVED+22) -#define SYS_task_restart (CONFIG_SYS_RESERVED+23) -#define SYS_up_assert (CONFIG_SYS_RESERVED+24) -#define __SYS_vfork (CONFIG_SYS_RESERVED+25) +#define SYS_sem_timedwait (CONFIG_SYS_RESERVED+17) +#define SYS_sem_trywait (CONFIG_SYS_RESERVED+18) +#define SYS_sem_unlink (CONFIG_SYS_RESERVED+19) +#define SYS_sem_wait (CONFIG_SYS_RESERVED+20) +#define SYS_set_errno (CONFIG_SYS_RESERVED+21) +#define SYS_task_create (CONFIG_SYS_RESERVED+22) +#define SYS_task_delete (CONFIG_SYS_RESERVED+23) +#define SYS_task_restart (CONFIG_SYS_RESERVED+24) +#define SYS_up_assert (CONFIG_SYS_RESERVED+25) +#define __SYS_vfork (CONFIG_SYS_RESERVED+26) /* The following can be individually enabled */ diff --git a/nuttx/libnx/nxmu/nx_redrawreq.c b/nuttx/libnx/nxmu/nx_redrawreq.c index 05ef8d071..6621bb8a1 100644 --- a/nuttx/libnx/nxmu/nx_redrawreq.c +++ b/nuttx/libnx/nxmu/nx_redrawreq.c @@ -92,6 +92,7 @@ void nx_redrawreq(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect) { FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd; struct nxsvrmsg_redrawreq_s outmsg; + int ret; #ifdef CONFIG_DEBUG if (!wnd || !rect) @@ -107,5 +108,9 @@ void nx_redrawreq(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect) outmsg.wnd = wnd; nxgl_rectcopy(&outmsg.rect, rect); - return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_redrawreq_s)); + ret = nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_redrawreq_s)); + if (ret < 0) + { + gdbg("ERROR: nxmu_sendwindow failed: %d\n", errno); + } } diff --git a/nuttx/syscall/syscall.csv b/nuttx/syscall/syscall.csv index 3ae366a39..088103f45 100644 --- a/nuttx/syscall/syscall.csv +++ b/nuttx/syscall/syscall.csv @@ -103,6 +103,7 @@ "sem_destroy","semaphore.h","","int","FAR sem_t*" "sem_open","semaphore.h","","FAR sem_t*","FAR const char*","int","..." "sem_post","semaphore.h","","int","FAR sem_t*" +"sem_timedwait","semaphore.h","","int","FAR sem_t*","FAR const struct timespec *" "sem_trywait","semaphore.h","","int","FAR sem_t*" "sem_unlink","semaphore.h","","int","FAR const char*" "sem_wait","semaphore.h","","int","FAR sem_t*" diff --git a/nuttx/syscall/syscall_lookup.h b/nuttx/syscall/syscall_lookup.h index 7f6da78ab..4962474c5 100644 --- a/nuttx/syscall/syscall_lookup.h +++ b/nuttx/syscall/syscall_lookup.h @@ -1,7 +1,7 @@ /**************************************************************************** * syscall/syscall_lookup.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -60,6 +60,7 @@ SYSCALL_LOOKUP(sem_close, 1, STUB_sem_close) SYSCALL_LOOKUP(sem_destroy, 2, STUB_sem_destroy) SYSCALL_LOOKUP(sem_open, 6, STUB_sem_open) SYSCALL_LOOKUP(sem_post, 1, STUB_sem_post) +SYSCALL_LOOKUP(sem_timedwait, 2, STUB_sem_timedwait) SYSCALL_LOOKUP(sem_trywait, 1, STUB_sem_trywait) SYSCALL_LOOKUP(sem_unlink, 1, STUB_sem_unlink) SYSCALL_LOOKUP(sem_wait, 1, STUB_sem_wait) diff --git a/nuttx/syscall/syscall_stublookup.c b/nuttx/syscall/syscall_stublookup.c index 50e302e59..19059370c 100644 --- a/nuttx/syscall/syscall_stublookup.c +++ b/nuttx/syscall/syscall_stublookup.c @@ -80,6 +80,7 @@ uintptr_t STUB_sem_destroy(int nbr, uintptr_t parm1); uintptr_t STUB_sem_open(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t parm3, uintptr_t parm4, uintptr_t parm5, uintptr_t parm6); uintptr_t STUB_sem_post(int nbr, uintptr_t parm1); +uintptr_t STUB_sem_timedwait(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_sem_trywait(int nbr, uintptr_t parm1); uintptr_t STUB_sem_unlink(int nbr, uintptr_t parm1); uintptr_t STUB_sem_wait(int nbr, uintptr_t parm1); -- cgit v1.2.3