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
This commit is contained in:
parent
1e52a8f36a
commit
ac37ac75e0
@ -314,4 +314,6 @@
|
|||||||
|
|
||||||
* Added a test case to verify the Pascal P-Code interpreter
|
* Added a test case to verify the Pascal P-Code interpreter
|
||||||
* Added /dev/zero
|
* Added /dev/zero
|
||||||
|
* 'errno' is now defined to be *get_errno_ptr() with no name conflicts
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<tr align="center" bgcolor="#e4e4e4">
|
<tr align="center" bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||||
<p>Last Updated: January 31, 2008</p>
|
<p>Last Updated: February 1, 2008</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -964,6 +964,7 @@ Other memory:
|
|||||||
|
|
||||||
* Added a test case to verify the Pascal P-Code interpreter
|
* Added a test case to verify the Pascal P-Code interpreter
|
||||||
* Added /dev/zero
|
* Added /dev/zero
|
||||||
|
* 'errno' is now defined to be *get_errno_ptr() with no name conflicts
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/************************************************************
|
/****************************************************************************
|
||||||
* common/up_sigdeliver.c
|
* common/up_sigdeliver.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* 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
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
@ -31,11 +31,11 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -47,23 +47,23 @@
|
|||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Public Funtions
|
* Public Funtions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Name: up_sigdeliver
|
* Name: up_sigdeliver
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@ -72,7 +72,7 @@
|
|||||||
* with and forced to branch to this location with interrupts
|
* with and forced to branch to this location with interrupts
|
||||||
* disabled.
|
* disabled.
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_sigdeliver(void)
|
void up_sigdeliver(void)
|
||||||
{
|
{
|
||||||
@ -86,7 +86,7 @@ void up_sigdeliver(void)
|
|||||||
* the correct errno value (probably EINTR).
|
* the correct errno value (probably EINTR).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int saved_errno = rtcb->errno;
|
int saved_errno = rtcb->pterrno;
|
||||||
|
|
||||||
up_ledon(LED_SIGNAL);
|
up_ledon(LED_SIGNAL);
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ void up_sigdeliver(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
dbg("Resuming\n");
|
dbg("Resuming\n");
|
||||||
rtcb->errno = saved_errno;
|
rtcb->pterrno = saved_errno;
|
||||||
|
|
||||||
/* Then restore the correct state for this thread of
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -91,7 +91,7 @@ void up_sigdeliver(void)
|
|||||||
* EINTR).
|
* EINTR).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int saved_errno = rtcb->errno;
|
int saved_errno = rtcb->pterrno;
|
||||||
|
|
||||||
up_ledon(LED_SIGNAL);
|
up_ledon(LED_SIGNAL);
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ void up_sigdeliver(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
dbg("Resuming\n");
|
dbg("Resuming\n");
|
||||||
rtcb->errno = saved_errno;
|
rtcb->pterrno = saved_errno;
|
||||||
|
|
||||||
/* Then restore the correct state for this thread of
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -90,7 +90,7 @@ void up_sigdeliver(void)
|
|||||||
* EINTR).
|
* EINTR).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int saved_errno = rtcb->errno;
|
int saved_errno = rtcb->pterrno;
|
||||||
|
|
||||||
up_ledon(LED_SIGNAL);
|
up_ledon(LED_SIGNAL);
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ void up_sigdeliver(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
dbg("Resuming\n");
|
dbg("Resuming\n");
|
||||||
rtcb->errno = saved_errno;
|
rtcb->pterrno = saved_errno;
|
||||||
|
|
||||||
/* Then restore the correct state for this thread of
|
/* Then restore the correct state for this thread of
|
||||||
* execution.
|
* execution.
|
||||||
|
@ -65,10 +65,6 @@
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Get errno using a pointer */
|
|
||||||
|
|
||||||
# define errno *get_errno_ptr()
|
|
||||||
|
|
||||||
/* Used lib_rawprintf() so that there is not confusion from buffered IO */
|
/* Used lib_rawprintf() so that there is not confusion from buffered IO */
|
||||||
|
|
||||||
# define message(...) lib_rawprintf(__VA_ARGS__)
|
# define message(...) lib_rawprintf(__VA_ARGS__)
|
||||||
|
@ -52,8 +52,6 @@
|
|||||||
|
|
||||||
#define NSH_MAX_ARGUMENTS 6
|
#define NSH_MAX_ARGUMENTS 6
|
||||||
|
|
||||||
#define errno (*get_errno_ptr())
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -44,8 +44,6 @@
|
|||||||
* Definitions
|
* Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define errno *get_errno_ptr()
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/udp/udp-internal.h
|
* examples/udp/udp-internal.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* 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
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
@ -63,10 +63,6 @@
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Get errno using a pointer */
|
|
||||||
|
|
||||||
# define errno *get_errno_ptr()
|
|
||||||
|
|
||||||
/* If debug is enabled, use the synchronous lib_lowprintf so that the
|
/* If debug is enabled, use the synchronous lib_lowprintf so that the
|
||||||
* program output does not get disassociated in the debug output.
|
* program output does not get disassociated in the debug output.
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/************************************************************************
|
/************************************************************************
|
||||||
* errno.h
|
* include/errno.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* 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
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
@ -44,6 +44,10 @@
|
|||||||
* Definitions
|
* Definitions
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
|
/* Convenience/compatibility definition */
|
||||||
|
|
||||||
|
#define errno *get_errno_ptr()
|
||||||
|
|
||||||
/* Definitions of error numbers and the string that would be
|
/* Definitions of error numbers and the string that would be
|
||||||
* returned by strerror().
|
* returned by strerror().
|
||||||
*/
|
*/
|
||||||
|
@ -238,7 +238,7 @@ struct _TCB
|
|||||||
|
|
||||||
/* Library related fields *****************************************************/
|
/* Library related fields *****************************************************/
|
||||||
|
|
||||||
int errno; /* Current per-thread errno */
|
int pterrno; /* Current per-thread errno */
|
||||||
|
|
||||||
/* File system support ********************************************************/
|
/* File system support ********************************************************/
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* netutils/dhcpd/dhcpd.c
|
* netutils/dhcpd/dhcpd.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* 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
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
@ -55,7 +55,6 @@ typedef unsigned char boolean;
|
|||||||
# include <nuttx/config.h>
|
# include <nuttx/config.h>
|
||||||
# include <debug.h>
|
# include <debug.h>
|
||||||
# include <net/uip/dhcpd.h>
|
# include <net/uip/dhcpd.h>
|
||||||
# define errno *get_errno_ptr()
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -53,8 +53,6 @@
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define errno *get_errno_ptr()
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* netutils/webserver/httpd.c
|
* netutils/webserver/httpd.c
|
||||||
* httpd Web server
|
* httpd Web server
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* This is a leverage of similar logic from uIP:
|
* This is a leverage of similar logic from uIP:
|
||||||
@ -76,8 +76,6 @@
|
|||||||
#define ISO_slash 0x2f
|
#define ISO_slash 0x2f
|
||||||
#define ISO_colon 0x3a
|
#define ISO_colon 0x3a
|
||||||
|
|
||||||
#define errno *get_errno_ptr()
|
|
||||||
|
|
||||||
#undef CONFIG_NETUTILS_HTTPD_DUMPBUFFER
|
#undef CONFIG_NETUTILS_HTTPD_DUMPBUFFER
|
||||||
#undef CONFIG_NETUTILS_HTTPD_DUMPPSTATE
|
#undef CONFIG_NETUTILS_HTTPD_DUMPPSTATE
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* get_errno_ptr.c
|
* sched/get_errno_ptr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
@ -44,6 +44,7 @@
|
|||||||
#include "os_internal.h"
|
#include "os_internal.h"
|
||||||
|
|
||||||
#undef get_errno_ptr
|
#undef get_errno_ptr
|
||||||
|
#undef errno
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
@ -93,7 +94,7 @@ FAR int *get_errno_ptr(void)
|
|||||||
* thread-private errno in the TCB of the running task.
|
* thread-private errno in the TCB of the running task.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return &rtcb->errno;
|
return &rtcb->pterrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ static void mq_rcvtimeout(int argc, uint32 pid)
|
|||||||
{
|
{
|
||||||
/* Mark the errno value for the thread. */
|
/* Mark the errno value for the thread. */
|
||||||
|
|
||||||
wtcb->errno = ETIMEDOUT;
|
wtcb->pterrno = ETIMEDOUT;
|
||||||
|
|
||||||
/* Restart the the task. */
|
/* Restart the the task. */
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ static void mq_sndtimeout(int argc, uint32 pid)
|
|||||||
{
|
{
|
||||||
/* Mark the errno value for the thread. */
|
/* Mark the errno value for the thread. */
|
||||||
|
|
||||||
wtcb->errno = ETIMEDOUT;
|
wtcb->pterrno = ETIMEDOUT;
|
||||||
|
|
||||||
/* Restart the the task. */
|
/* Restart the the task. */
|
||||||
|
|
||||||
|
@ -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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* 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
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
@ -31,11 +31,11 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
@ -43,35 +43,35 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include "sem_internal.h"
|
#include "sem_internal.h"
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Compilation Switches
|
* Compilation Switches
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Type Declarations
|
* Private Type Declarations
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Global Variables
|
* Global Variables
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Variables
|
* Private Variables
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Function: sem_waitirq
|
* Function: sem_waitirq
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@ -89,7 +89,7 @@
|
|||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void mq_waitirq(FAR _TCB *wtcb)
|
void mq_waitirq(FAR _TCB *wtcb)
|
||||||
{
|
{
|
||||||
@ -111,7 +111,7 @@ void mq_waitirq(FAR _TCB *wtcb)
|
|||||||
{
|
{
|
||||||
/* Mark the errno value for the thread. */
|
/* Mark the errno value for the thread. */
|
||||||
|
|
||||||
wtcb->errno = EINTR;
|
wtcb->pterrno = EINTR;
|
||||||
|
|
||||||
/* Restart the the task. */
|
/* Restart the the task. */
|
||||||
|
|
||||||
|
@ -105,10 +105,10 @@ enum os_crash_codes_e
|
|||||||
/* A more efficient ways to access the errno */
|
/* A more efficient ways to access the errno */
|
||||||
|
|
||||||
#define SET_ERRNO(e) \
|
#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) \
|
#define _SET_TCB_ERRNO(t,e) \
|
||||||
{ (t)->errno = (e); }
|
{ (t)->pterrno = (e); }
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Type Definitions
|
* Public Type Definitions
|
||||||
|
@ -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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* 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
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
@ -31,11 +31,11 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
@ -43,35 +43,35 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include "sem_internal.h"
|
#include "sem_internal.h"
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Compilation Switches
|
* Compilation Switches
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Type Declarations
|
* Private Type Declarations
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Global Variables
|
* Global Variables
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Variables
|
* Private Variables
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Function: sem_waitirq
|
* Function: sem_waitirq
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@ -90,7 +90,7 @@
|
|||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void sem_waitirq(FAR _TCB *wtcb)
|
void sem_waitirq(FAR _TCB *wtcb)
|
||||||
{
|
{
|
||||||
@ -115,7 +115,7 @@ void sem_waitirq(FAR _TCB *wtcb)
|
|||||||
|
|
||||||
/* Mark the errno value for the thread. */
|
/* Mark the errno value for the thread. */
|
||||||
|
|
||||||
wtcb->errno = EINTR;
|
wtcb->pterrno = EINTR;
|
||||||
|
|
||||||
/* Restart the the task. */
|
/* Restart the the task. */
|
||||||
|
|
||||||
|
@ -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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* 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
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
@ -31,11 +31,13 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -43,35 +45,36 @@
|
|||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
|
|
||||||
#include "os_internal.h"
|
#include "os_internal.h"
|
||||||
#include "sem_internal.h"
|
#include "sem_internal.h"
|
||||||
#include "sig_internal.h"
|
#include "sig_internal.h"
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Type Declarations
|
* Private Type Declarations
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Global Variables
|
* Global Variables
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Variables
|
* Private Variables
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/****************************************************************************
|
||||||
* Function: sig_deliver
|
* Function: sig_deliver
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@ -79,7 +82,7 @@
|
|||||||
* the signal receiving task. It processes all queued
|
* the signal receiving task. It processes all queued
|
||||||
* signals then returns.
|
* signals then returns.
|
||||||
*
|
*
|
||||||
************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void sig_deliver(FAR _TCB *stcb)
|
void sig_deliver(FAR _TCB *stcb)
|
||||||
{
|
{
|
||||||
@ -99,7 +102,7 @@ void sig_deliver(FAR _TCB *stcb)
|
|||||||
* was reawakened by a signal must be retained.
|
* 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)
|
for (sigq = (FAR sigq_t*)stcb->sigpendactionq.head; (sigq); sigq = next)
|
||||||
{
|
{
|
||||||
next = sigq->flink;
|
next = sigq->flink;
|
||||||
@ -158,7 +161,7 @@ void sig_deliver(FAR _TCB *stcb)
|
|||||||
sig_releasependingsigaction(sigq);
|
sig_releasependingsigaction(sigq);
|
||||||
}
|
}
|
||||||
|
|
||||||
stcb->errno = saved_errno;
|
stcb->pterrno = saved_errno;
|
||||||
sched_unlock();
|
sched_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user