summaryrefslogtreecommitdiff
path: root/nuttx/sched/sem_getvalue.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-31 17:59:22 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-31 17:59:22 +0000
commit8a99a139ba3683e981c9e71c57f7fce313d92cae (patch)
tree2dfeb694139cc0dbfcbb69bcbaae8ff6ddecbdd3 /nuttx/sched/sem_getvalue.c
parentb1fd89b2e088a49381c698ef69904124605e81dc (diff)
downloadpx4-nuttx-8a99a139ba3683e981c9e71c57f7fce313d92cae.tar.gz
px4-nuttx-8a99a139ba3683e981c9e71c57f7fce313d92cae.tar.bz2
px4-nuttx-8a99a139ba3683e981c9e71c57f7fce313d92cae.zip
Z16F integration changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@595 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sem_getvalue.c')
-rw-r--r--nuttx/sched/sem_getvalue.c69
1 files changed, 33 insertions, 36 deletions
diff --git a/nuttx/sched/sem_getvalue.c b/nuttx/sched/sem_getvalue.c
index b7dd201c7..f320f92c0 100644
--- a/nuttx/sched/sem_getvalue.c
+++ b/nuttx/sched/sem_getvalue.c
@@ -1,7 +1,7 @@
-/************************************************************
- * sem_getvalue.c
+/****************************************************************************
+ * sched/sem_getvalue.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,60 +31,58 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include <sys/types.h>
#include <semaphore.h>
#include "sem_internal.h"
-/************************************************************
+/****************************************************************************
* Compilation Switches
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Function: sem_getvalue
*
* Description:
- * This function updates the location referenced by sval
- * argument to have the value of the semaphore referenced
- * by sem without effecting the state of the semaphore.
- * The updated value represents the actual semaphore value
- * that occurred at some unspecified time during the call,
- * but may not reflect the actual value of the semaphore
- * when it is returned to the calling task.
+ * This function updates the location referenced by 'sval' argument to
+ * have the value of the semaphore referenced by 'sem' without effecting
+ * the state of the semaphore. The updated value represents the actual
+ * semaphore value that occurred at some unspecified time during the call,
+ * but may not reflect the actual value of the semaphore when it is
+ * returned to the calling task.
*
- * If sem is locked, the value return by sem_getvalue()
- * will either be zero or a negative number whose absolute
- * value represents the number of tasks waiting for the
- * semaphore.
+ * If 'sem' is locked, the value return by sem_getvalue() will either be
+ * zero or a negative number whose absolute value represents the number
+ * of tasks waiting for the semaphore.
*
* Parameters:
* sem - Semaphore descriptor
@@ -95,9 +93,9 @@
*
* Assumptions:
*
- ************************************************************/
+ ****************************************************************************/
-int sem_getvalue(sem_t *sem, int *sval)
+int sem_getvalue(FAR sem_t *sem, FAR int *sval)
{
int ret = ERROR;
@@ -109,4 +107,3 @@ int sem_getvalue(sem_t *sem, int *sval)
return ret;
}
-