summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-24 21:34:55 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-24 21:34:55 +0000
commitcd7ab15d6faca00ad56a3cc55613a1529790aa1c (patch)
tree1b51d1401e6f912a7c2d6fafe3e29fb22ea13855 /nuttx/sched
parent1b4c92672cfd43d05dbee2db143af08ec84d90af (diff)
downloadpx4-nuttx-cd7ab15d6faca00ad56a3cc55613a1529790aa1c.tar.gz
px4-nuttx-cd7ab15d6faca00ad56a3cc55613a1529790aa1c.tar.bz2
px4-nuttx-cd7ab15d6faca00ad56a3cc55613a1529790aa1c.zip
Add a test to verify that FPU registers are properly saved and restored on context switches.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4421 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/sched_waitpid.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/nuttx/sched/sched_waitpid.c b/nuttx/sched/sched_waitpid.c
index a1af343e1..5eefba371 100644
--- a/nuttx/sched/sched_waitpid.c
+++ b/nuttx/sched/sched_waitpid.c
@@ -1,8 +1,8 @@
/*****************************************************************************
* sched/sched_waitpid.c
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -188,18 +188,18 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options)
sched_lock();
if (!tcb)
{
- err = ECHILD;
- goto errout_with_errno;
- }
+ err = ECHILD;
+ goto errout_with_errno;
+ }
/* None of the options are supported */
#ifdef CONFIG_DEBUG
if (options != 0)
{
- err = ENOSYS;
- goto errout_with_errno;
- }
+ err = ENOSYS;
+ goto errout_with_errno;
+ }
#endif
/* "If more than one thread is suspended in waitpid() awaiting termination of
@@ -210,26 +210,26 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options)
if (stat_loc != NULL && tcb->stat_loc == NULL)
{
- tcb->stat_loc = stat_loc;
- mystat = true;
- }
+ tcb->stat_loc = stat_loc;
+ mystat = true;
+ }
/* Then wait for the task to exit */
ret = sem_wait(&tcb->exitsem);
if (ret < 0)
{
- /* Unlock pre-emption and return the ERROR (sem_wait has already set
- * the errno). Handle the awkward case of whether or not we need to
- * nullify the stat_loc value.
- */
-
- if (mystat)
- {
- tcb->stat_loc = NULL;
- }
- goto errout;
- }
+ /* Unlock pre-emption and return the ERROR (sem_wait has already set
+ * the errno). Handle the awkward case of whether or not we need to
+ * nullify the stat_loc value.
+ */
+
+ if (mystat)
+ {
+ tcb->stat_loc = NULL;
+ }
+ goto errout;
+ }
/* On success, return the PID */