summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-02-01 21:23:19 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-02-01 21:23:19 +0000
commit214b5beecedc8425ae45fc8c715a0c75877458f5 (patch)
tree95288865ba7fe3559bb81a28e7337a500d2e9eaa /nuttx/sched
parent2e53693f16b113989e2050753483c7b97fb24c45 (diff)
downloadpx4-nuttx-214b5beecedc8425ae45fc8c715a0c75877458f5.tar.gz
px4-nuttx-214b5beecedc8425ae45fc8c715a0c75877458f5.tar.bz2
px4-nuttx-214b5beecedc8425ae45fc8c715a0c75877458f5.zip
errno now defined to be *get_errno_ptr()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@607 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/get_errno_ptr.c5
-rw-r--r--nuttx/sched/mq_timedreceive.c2
-rw-r--r--nuttx/sched/mq_timedsend.c2
-rw-r--r--nuttx/sched/mq_waitirq.c48
-rw-r--r--nuttx/sched/os_internal.h4
-rw-r--r--nuttx/sched/sem_waitirq.c48
-rw-r--r--nuttx/sched/sig_deliver.c49
7 files changed, 81 insertions, 77 deletions
diff --git a/nuttx/sched/get_errno_ptr.c b/nuttx/sched/get_errno_ptr.c
index 36598caae..ebf2e105c 100644
--- a/nuttx/sched/get_errno_ptr.c
+++ b/nuttx/sched/get_errno_ptr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * get_errno_ptr.c
+ * sched/get_errno_ptr.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -44,6 +44,7 @@
#include "os_internal.h"
#undef get_errno_ptr
+#undef errno
/****************************************************************************
* Private Data
@@ -93,7 +94,7 @@ FAR int *get_errno_ptr(void)
* thread-private errno in the TCB of the running task.
*/
- return &rtcb->errno;
+ return &rtcb->pterrno;
}
}
diff --git a/nuttx/sched/mq_timedreceive.c b/nuttx/sched/mq_timedreceive.c
index 6f0d93d2b..ca4b4aa85 100644
--- a/nuttx/sched/mq_timedreceive.c
+++ b/nuttx/sched/mq_timedreceive.c
@@ -112,7 +112,7 @@ static void mq_rcvtimeout(int argc, uint32 pid)
{
/* Mark the errno value for the thread. */
- wtcb->errno = ETIMEDOUT;
+ wtcb->pterrno = ETIMEDOUT;
/* Restart the the task. */
diff --git a/nuttx/sched/mq_timedsend.c b/nuttx/sched/mq_timedsend.c
index 76e3fda5d..012bd2ab0 100644
--- a/nuttx/sched/mq_timedsend.c
+++ b/nuttx/sched/mq_timedsend.c
@@ -113,7 +113,7 @@ static void mq_sndtimeout(int argc, uint32 pid)
{
/* Mark the errno value for the thread. */
- wtcb->errno = ETIMEDOUT;
+ wtcb->pterrno = ETIMEDOUT;
/* Restart the the task. */
diff --git a/nuttx/sched/mq_waitirq.c b/nuttx/sched/mq_waitirq.c
index be23e5b90..75ecbb08f 100644
--- a/nuttx/sched/mq_waitirq.c
+++ b/nuttx/sched/mq_waitirq.c
@@ -1,7 +1,7 @@
-/************************************************************
- * mq_waitirq.c
+/****************************************************************************
+ * sched/mq_waitirq.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,11 +31,11 @@
* 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 <sched.h>
@@ -43,35 +43,35 @@
#include <nuttx/arch.h>
#include "sem_internal.h"
-/************************************************************
+/****************************************************************************
* Compilation Switches
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Function: sem_waitirq
*
* Description:
@@ -89,7 +89,7 @@
*
* Assumptions:
*
- ************************************************************/
+ ****************************************************************************/
void mq_waitirq(FAR _TCB *wtcb)
{
@@ -111,7 +111,7 @@ void mq_waitirq(FAR _TCB *wtcb)
{
/* Mark the errno value for the thread. */
- wtcb->errno = EINTR;
+ wtcb->pterrno = EINTR;
/* Restart the the task. */
diff --git a/nuttx/sched/os_internal.h b/nuttx/sched/os_internal.h
index e3dffb207..665d05e74 100644
--- a/nuttx/sched/os_internal.h
+++ b/nuttx/sched/os_internal.h
@@ -105,10 +105,10 @@ enum os_crash_codes_e
/* A more efficient ways to access the errno */
#define SET_ERRNO(e) \
- { _TCB *rtcb = _TCB*)g_readytorun.head; rtcb->errno = (e); }
+ { _TCB *rtcb = _TCB*)g_readytorun.head; rtcb->pterrno = (e); }
#define _SET_TCB_ERRNO(t,e) \
- { (t)->errno = (e); }
+ { (t)->pterrno = (e); }
/****************************************************************************
* Public Type Definitions
diff --git a/nuttx/sched/sem_waitirq.c b/nuttx/sched/sem_waitirq.c
index b7cbdce21..3aded997d 100644
--- a/nuttx/sched/sem_waitirq.c
+++ b/nuttx/sched/sem_waitirq.c
@@ -1,7 +1,7 @@
-/************************************************************
- * sem_waitirq.c
+/****************************************************************************
+ * sched/sem_waitirq.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,11 +31,11 @@
* 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 <sched.h>
@@ -43,35 +43,35 @@
#include <nuttx/arch.h>
#include "sem_internal.h"
-/************************************************************
+/****************************************************************************
* Compilation Switches
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Function: sem_waitirq
*
* Description:
@@ -90,7 +90,7 @@
*
* Assumptions:
*
- ************************************************************/
+ ****************************************************************************/
void sem_waitirq(FAR _TCB *wtcb)
{
@@ -115,7 +115,7 @@ void sem_waitirq(FAR _TCB *wtcb)
/* Mark the errno value for the thread. */
- wtcb->errno = EINTR;
+ wtcb->pterrno = EINTR;
/* Restart the the task. */
diff --git a/nuttx/sched/sig_deliver.c b/nuttx/sched/sig_deliver.c
index 0a900c73d..2244ca2fe 100644
--- a/nuttx/sched/sig_deliver.c
+++ b/nuttx/sched/sig_deliver.c
@@ -1,7 +1,7 @@
-/************************************************************
- * sig_deliver.c
+/****************************************************************************
+ * sched/sig_deliver.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,11 +31,13 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
+
+#include <nuttx/config.h>
#include <sys/types.h>
#include <signal.h>
@@ -43,35 +45,36 @@
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
+
#include "os_internal.h"
#include "sem_internal.h"
#include "sig_internal.h"
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Function: sig_deliver
*
* Description:
@@ -79,7 +82,7 @@
* the signal receiving task. It processes all queued
* signals then returns.
*
- ************************************************************/
+ ****************************************************************************/
void sig_deliver(FAR _TCB *stcb)
{
@@ -99,7 +102,7 @@ void sig_deliver(FAR _TCB *stcb)
* was reawakened by a signal must be retained.
*/
- saved_errno = stcb->errno;
+ saved_errno = stcb->pterrno;
for (sigq = (FAR sigq_t*)stcb->sigpendactionq.head; (sigq); sigq = next)
{
next = sigq->flink;
@@ -158,7 +161,7 @@ void sig_deliver(FAR _TCB *stcb)
sig_releasependingsigaction(sigq);
}
- stcb->errno = saved_errno;
+ stcb->pterrno = saved_errno;
sched_unlock();
}