sem_getprotocol() can be in C library

This commit is contained in:
Gregory Nutt 2016-11-02 09:29:16 -06:00
parent 1598d3d050
commit b738a646ad
7 changed files with 10 additions and 13 deletions

View file

@ -92,9 +92,8 @@
#define SYS_sem_wait (CONFIG_SYS_RESERVED+19)
#ifdef CONFIG_PRIORITY_INHERITANCE
# define SYS_sem_getprotocol (CONFIG_SYS_RESERVED+20)
# define SYS_sem_setprotocol (CONFIG_SYS_RESERVED+21)
# define __SYS_named_sem (CONFIG_SYS_RESERVED+22)
# define SYS_sem_setprotocol (CONFIG_SYS_RESERVED+20)
# define __SYS_named_sem (CONFIG_SYS_RESERVED+21)
#else
# define __SYS_named_sem (CONFIG_SYS_RESERVED+20)
#endif

View file

@ -1,7 +1,7 @@
############################################################################
# libc/semaphore/Make.defs
#
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -37,6 +37,10 @@
CSRCS += sem_init.c sem_getvalue.c
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
CSRCS += sem_getprotocol.c
endif
# Add the semaphore directory to the build
DEPPATH += --dep-path semaphore

View file

@ -1,5 +1,5 @@
/****************************************************************************
* sched/semaphore/sem_getprotocol.c
* libc/semaphore/sem_getprotocol.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -42,8 +42,6 @@
#include <semaphore.h>
#include <assert.h>
#include "semaphore/semaphore.h"
#ifdef CONFIG_PRIORITY_INHERITANCE
/****************************************************************************
@ -70,7 +68,7 @@
int sem_getprotocol(FAR sem_t *sem, FAR int *protocol)
{
DEBUGASSERT(sem != NULL);
DEBUGASSERT(sem != NULL && protocol != NULL);
if ((sem->flags & PRIOINHERIT_FLAGS_DISABLE) != 0)
{

View file

@ -40,8 +40,7 @@ CSRCS += sem_timedwait.c sem_timeout.c sem_post.c sem_recover.c
CSRCS += sem_reset.c sem_waitirq.c
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
CSRCS += sem_initialize.c sem_holder.c
CSRCS += sem_setprotocol.c sem_getprotocol.c
CSRCS += sem_initialize.c sem_holder.c sem_setprotocol.c
endif
ifeq ($(CONFIG_SPINLOCK),y)

View file

@ -117,7 +117,6 @@
"sem_close","semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR sem_t*"
"sem_destroy","semaphore.h","","int","FAR sem_t*"
"sem_open","semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","FAR sem_t*","FAR const char*","int","..."
"sem_getprotocol","semaphore.h","defined(CONFIG_PRIORITY_INHERITANCE)","int","FAR sem_t*","FAR int*"
"sem_post","semaphore.h","","int","FAR sem_t*"
"sem_setprotocol","semaphore.h","defined(CONFIG_PRIORITY_INHERITANCE)","int","FAR sem_t*","int"
"sem_timedwait","semaphore.h","","int","FAR sem_t*","FAR const struct timespec *"

Can't render this file because it has a wrong number of fields in line 2.

View file

@ -68,7 +68,6 @@ SYSCALL_LOOKUP(sem_trywait, 1, STUB_sem_trywait)
SYSCALL_LOOKUP(sem_wait, 1, STUB_sem_wait)
#ifdef CONFIG_PRIORITY_INHERITANCE
SYSCALL_LOOKUP(sem_getprotocol, 2, STUB_sem_getprotocol)
SYSCALL_LOOKUP(sem_setprotocol, 2, STUB_sem_setprotocol)
#endif

View file

@ -82,7 +82,6 @@ uintptr_t STUB_uname(int nbr, uintptr_t parm1);
uintptr_t STUB_sem_close(int nbr, uintptr_t parm1);
uintptr_t STUB_sem_destroy(int nbr, uintptr_t parm1);
uintptr_t STUB_sem_getprotocol(int nbr, uintptr_t parm1, uintptr_t parm2);
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);