summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-13 18:01:46 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-13 18:01:46 +0000
commitea45a3718fc280b291b2f45d467a2494973636fa (patch)
tree446e7ccffd35a3baa2afefa3afc05ba6fdd09427 /nuttx
parentc37fdc28c2cfdf41a549ba245c1cad85b757e53a (diff)
downloadpx4-nuttx-ea45a3718fc280b291b2f45d467a2494973636fa.tar.gz
px4-nuttx-ea45a3718fc280b291b2f45d467a2494973636fa.tar.bz2
px4-nuttx-ea45a3718fc280b291b2f45d467a2494973636fa.zip
types blkcnt_t and off_t should not depend on memory model; Remove non-standard type STATUS
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2330 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/ChangeLog5
-rw-r--r--nuttx/Documentation/NuttX.html7
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html15
-rw-r--r--nuttx/Documentation/NuttxUserGuide.html33
-rwxr-xr-xnuttx/README.txt44
-rw-r--r--nuttx/TODO21
-rw-r--r--nuttx/arch/arm/src/common/up_createstack.c4
-rw-r--r--nuttx/arch/arm/src/common/up_usestack.c2
-rwxr-xr-xnuttx/arch/hc/src/common/up_createstack.c2
-rwxr-xr-xnuttx/arch/hc/src/common/up_usestack.c2
-rw-r--r--nuttx/arch/sh/src/common/up_createstack.c4
-rw-r--r--nuttx/arch/sh/src/common/up_usestack.c4
-rw-r--r--nuttx/arch/sim/src/up_createstack.c8
-rw-r--r--nuttx/arch/sim/src/up_usestack.c6
-rw-r--r--nuttx/arch/z16/src/common/up_createstack.c6
-rw-r--r--nuttx/arch/z16/src/common/up_usestack.c6
-rw-r--r--nuttx/arch/z80/src/common/up_createstack.c6
-rw-r--r--nuttx/arch/z80/src/common/up_usestack.c6
-rwxr-xr-xnuttx/configs/demo9s12ne64/README.txt42
-rw-r--r--nuttx/fs/fs_inoderemove.c4
-rw-r--r--nuttx/fs/fs_internal.h8
-rw-r--r--nuttx/fs/fs_registerblockdriver.c6
-rw-r--r--nuttx/fs/fs_registerdriver.c4
-rw-r--r--nuttx/fs/fs_unregisterblockdriver.c6
-rw-r--r--nuttx/fs/fs_unregisterdriver.c6
-rwxr-xr-xnuttx/include/cxx/cstddef1
-rw-r--r--nuttx/include/nuttx/arch.h6
-rw-r--r--nuttx/include/nuttx/fs.h26
-rw-r--r--nuttx/include/sched.h56
-rw-r--r--nuttx/include/sys/types.h55
-rw-r--r--nuttx/include/wdog.h7
-rw-r--r--nuttx/lib/lib_fgetpos.c4
-rw-r--r--nuttx/sched/os_internal.h6
-rw-r--r--nuttx/sched/pthread_create.c2
-rw-r--r--nuttx/sched/sched_lock.c48
-rw-r--r--nuttx/sched/sched_unlock.c48
-rw-r--r--nuttx/sched/sem_post.c2
-rw-r--r--nuttx/sched/task_activate.c2
-rw-r--r--nuttx/sched/task_create.c4
-rw-r--r--nuttx/sched/task_delete.c6
-rw-r--r--nuttx/sched/task_deletecurrent.c4
-rw-r--r--nuttx/sched/task_init.c14
-rw-r--r--nuttx/sched/task_restart.c4
-rw-r--r--nuttx/sched/task_setup.c11
-rw-r--r--nuttx/sched/wd_cancel.c6
-rw-r--r--nuttx/sched/wd_delete.c6
-rw-r--r--nuttx/sched/wd_start.c2
47 files changed, 343 insertions, 234 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 0788d88da..290942b12 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -990,4 +990,9 @@
can be used with any file system. Good performance of this layer will
depend upon functioning write buffer support!
NOTE: FTL support is untested as of the initial check-in.
+ * Numerous minor changes for m68hc12 to eliminate compilation errors and
+ warnings due to the fact that it uses 16-bit integer types and for casts
+ between uint32 (32-bits) and an mc68hc12 pointer (16-bits).
+ * sys/types: Size of off_t and blkcnt_t should not depend on size of
+ int in the architecture; Removed non-standard type STATUS
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index 00b100abb..bbe8fb6b5 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
- <p>Last Updated: December 5 2009</p>
+ <p>Last Updated: December 13, 2009</p>
</td>
</tr>
</table>
@@ -1616,6 +1616,11 @@ nuttx-2010.1 2010-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
can be used with any file system. Good performance of this layer will
depend upon functioning write buffer support!
NOTE: FTL support is untested as of the initial check-in.
+ * Numerous minor changes for m68hc12 to eliminate compilation errors and
+ warnings due to the fact that it uses 16-bit integer types and for casts
+ between uint32 (32-bits) and an mc68hc12 pointer (16-bits).
+ * sys/types: Size of off_t and blkcnt_t should not depend on size of
+ int in the architecture; Removed non-standard type STATUS
pascal-2010.1 2010-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index de45bf743..a7880d8f8 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -438,8 +438,10 @@
<li><code>arch/arm/include/lpc214x</code> and <code>arch/arm/src/lpc214x</code>:
These directories provide support for NXP LPC214x family of
processors.
- STATUS: This port is in progress and should be available in the
- nuttx-0.2.5 release.
+ STATUS: This port boots and passes the OS test (examples/ostest).
+ The port is complete and verified. As of NuttX 0.3.17, the port includes:
+ timer interrupts, serial console, USB driver, and SPI-based MMC/SD card
+ support. A verified NuttShell configuration is also available.
</li>
</ul>
@@ -700,7 +702,14 @@
<li><code>configs/us7032evb1</code>:
This is a port of the Hitachi SH-1 on the Hitachi SH-1/US7032EVB1 board.
- STATUS: Work has just began on this port.
+ STATUS: This port is available as of release 0.3.18 of NuttX. The port is basically
+ complete and many examples run correctly. However, there are remaining instabilities
+ that make the port un-usable. The nature of these is not understood; the behavior is
+ that certain SH-1 instructions stop working as advertised. This could be a silicon
+ problem, some pipeline issue that is not handled properly by the gcc 3.4.5 toolchain
+ (which has very limited SH-1 support to begin with), or perhaps with the CMON debugger.
+ At any rate, I have exhausted all of the energy that I am willing to put into this cool
+ old processor for the time being.
</li>
<li><code>configs/xtrs</code>:
diff --git a/nuttx/Documentation/NuttxUserGuide.html b/nuttx/Documentation/NuttxUserGuide.html
index 3a3eafe3e..5d477c8cf 100644
--- a/nuttx/Documentation/NuttxUserGuide.html
+++ b/nuttx/Documentation/NuttxUserGuide.html
@@ -13,7 +13,7 @@
<h1><big><font color="#3c34ec"><i>NuttX Operating System<p>User's Manual</i></font></big></h1>
<p><small>by</small></p>
<p>Gregory Nutt<p>
- <p>Last Updated: May 22, 2009</p>
+ <p>Last Updated: December 13, 2009</p>
</td>
</tr>
</table>
@@ -296,8 +296,8 @@ VxWorks provides the following similar interface:
<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
- STATUS task_init(_TCB *tcb, char *name, int priority, uint32 *stack, uint32 stack_size,
- maint_t entry, const char *argv[]);
+ int task_init(_TCB *tcb, char *name, int priority, uint32 *stack, uint32 stack_size,
+ maint_t entry, const char *argv[]);
</pre>
<p>
@@ -368,7 +368,7 @@ VxWorks provides the following similar interface:
<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
- STATUS task_activate( _TCB *tcb );
+ int task_activate( _TCB *tcb );
</pre>
<p>
@@ -418,7 +418,7 @@ the pointer to the WIND_TCB cast to an integer.
<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
- STATUS task_delete( pid_t pid );
+ int task_delete( pid_t pid );
</pre>
<p>
@@ -514,7 +514,7 @@ And the UNIX interface:
<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
- STATUS task_restart( pid_t pid );
+ int task_restart( pid_t pid );
</pre>
<p>
@@ -974,7 +974,7 @@ priority of the calling task is returned.
<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
- STATUS sched_lock( void );
+ int sched_lock( void );
</pre>
<p>
@@ -994,7 +994,7 @@ number of times) or until it blocks itself.
<p>
<b>Assumptions/Limitations:</b>
<p>
-<b> POSIX Compatibility:</b> This is a NON-POSIX interface.
+<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the comparable interface:
<pre>
STATUS taskLock( void );
@@ -1006,7 +1006,7 @@ VxWorks provides the comparable interface:
<b>Function Prototype:</b>
<pre>
#include &lt;sched.h&gt;
- STATUS sched_unlock( void );
+ int sched_unlock( void );
</pre>
<p>
@@ -1027,7 +1027,7 @@ eligible to preempt the current task will execute.
<p>
<b>Assumptions/Limitations:</b>
<p>
-<b> POSIX Compatibility:</b> This is a NON-POSIX interface.
+<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the comparable interface:
<pre>
STATUS taskUnlock( void );
@@ -2296,7 +2296,7 @@ initialization time).
<b>Function Prototype:</b>
<pre>
#include &lt;wdog.h&gt;
- STATUS wd_delete (WDOG_ID wdog);
+ int wd_delete (WDOG_ID wdog);
</pre>
<p>
@@ -2321,7 +2321,7 @@ pointer to a watchdog structure.
caller to assure that the watchdog is inactive before deleting
it.
<p>
-<b> POSIX Compatibility:</b> This is a NON-POSIX interface.
+<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the following comparable interface:
<pre>
STATUS wdDelete (WDOG_ID wdog);
@@ -2340,7 +2340,7 @@ before deallocating it (i.e., never returns ERROR).
<b>Function Prototype:</b>
<pre>
#include &lt;wdog.h&gt;
- STATUS wd_start( WDOG_ID wdog, int delay, wdentry_t wdentry,
+ int wd_start( WDOG_ID wdog, int delay, wdentry_t wdentry,
intt argc, ....);
</pre>
@@ -2378,7 +2378,7 @@ wd_start() on a given watchdog ID has any effect.
context of the timer interrupt handler and is subject to all ISR
restrictions.
<p>
-<b> POSIX Compatibility:</b> This is a NON-POSIX interface.
+<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the following comparable interface:
<pre>
STATUS wdStart (WDOG_ID wdog, int delay, FUNCPTR wdentry, int parameter);
@@ -2397,7 +2397,7 @@ number of parameters is determined by
<b>Function Prototype:</b>
<pre>
#include &lt;wdog.h&gt;
- STATUS wd_cancel (WDOG_ID wdog);
+ int wd_cancel (WDOG_ID wdog);
</pre>
<p>
@@ -2419,7 +2419,7 @@ level.
<p>
<b>Assumptions/Limitations:</b>
<p>
-<b> POSIX Compatibility:</b> This is a NON-POSIX interface.
+<b>POSIX Compatibility:</b> This is a NON-POSIX interface.
VxWorks provides the following comparable interface:
<pre>
STATUS wdCancel (WDOG_ID wdog);
@@ -7392,7 +7392,6 @@ interface include:
<li>pid_t
<li>size_t
<li>sigset_t
-<li>STATUS
<li>time_t
</ul>
diff --git a/nuttx/README.txt b/nuttx/README.txt
index 0e50bfcff..56f6e5b73 100755
--- a/nuttx/README.txt
+++ b/nuttx/README.txt
@@ -9,20 +9,36 @@ README
INSTALLATION
^^^^^^^^^^^^
-Download and unpack the NuttX tarball. If you are reading this, then you
-have probably already done that. After unpacking, you will end up with a
-directory called nuttx-version (where version is the NuttX version number).
-You might want to rename that directory nuttx to match the various instructions
-in the documentation and some scripts in the source tree.
-
-That nuttx build directory should reside in a path that contains no spaces
-in the higher level directory names. For example, under Cygwin, your home
-directory might be formed from your first and last names like: "/home/First Last".
-That will cause strange errors when the make system tries to build.
-
-[Actually, that is probably not to difficult to fix. Some Makefiles probably
-just need some pathes within double quotes]
-
+Download and Unpack:
+
+ Download and unpack the NuttX tarball. If you are reading this, then
+ you have probably already done that. After unpacking, you will end
+ up with a directory called nuttx-version (where version is the NuttX
+ version number). You might want to rename that directory nuttx to
+ match the various instructions in the documentation and some scripts
+ in the source tree.
+
+ That nuttx build directory should reside in a path that contains no
+ spaces in the higher level directory names. For example, under
+ Cygwin, your home directory might be formed from your first and last
+ names like: "/home/First Last". That will cause strange errors when
+ the make system tries to build.
+
+ [Actually, that problem is probably not to difficult to fix. Some
+ Makefiles probably just need some pathes within double quotes]
+
+A Note about Header Files:
+
+ NuttX compiles without using the standard header files that are
+ distributed with your toolchain. That is correct behavior in most
+ cases because the header files bundled with your toolchain (such as
+ stdio.h) are probably not correct for use with NuttX. Certain
+ header files, such as setjmp.h, may be needed from your toolchain.
+ In that case, one solution is to copy that file from your toolchain
+ into the NuttX include directory. If you prefer to use the stdint.h
+ and stdbool.h header files from your toolchain, those could be copied
+ too. Using most other header files from your toolchain would probably
+ cause errors.
CONFIGURING NUTTX
^^^^^^^^^^^^^^^^^
diff --git a/nuttx/TODO b/nuttx/TODO
index 9fab01288..a418abf15 100644
--- a/nuttx/TODO
+++ b/nuttx/TODO
@@ -1,5 +1,5 @@
-NuttX TODO List (Last updated December 5, 2009)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+NuttX TODO List (Last updated December 13, 2009)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(5) Task/Scheduler (sched/)
(2) Memory Managment (mm/)
@@ -32,6 +32,7 @@ NuttX TODO List (Last updated December 5, 2009)
(4) Renesas M16C/26 (arch/sh/src/m16c)
(8) z80/z8/ez80 (arch/z80/)
(8) z16 (arch/z16/)
+ (0) mc68hc1x (arch/hc)
o Task/Scheduler (sched/)
^^^^^^^^^^^^^^^^^^^^^^^
@@ -734,7 +735,10 @@ o pjrc-8052 / MCS51 (arch/pjrc-8051/)
examples/ostest/barrier.c around lines 53 and 74
examples/ostest/sighand.c at 225 and 244
driver/serial.c in usleep calls around 347 and 354
- Status: Open
+ Status: Open. Update: These were reviewed during the hcs12 port. The
+ hcs12 also has 16-bit integer types (if -mshort is in the CFLAGS).
+ I believe that the warnings in most of the above have been fixed
+ but this has not been verified on this platform).
Priority: Medium
Description Global data is not being initialized. Logic like that of SDCCs
@@ -805,10 +809,11 @@ o Renesas M16C/26 (arch/sh/src/m16c)
o z80/z8/ez80 (arch/z80)
^^^^^^^^^^^^^^^^^^^^^^^
- Description: The SDCC version the same problems with interger overflow during
+ Description: The SDCC version the same problems with integer overflow during
compilation as described for pjrc-8051. At typical cause is code like
- usleep(500*1000) which exceeds the range of a 16-bit integer
- Status: See pjrc-8051
+ usleep(500*1000) which exceeds the range of a 16-bit integer.
+ Status: See pjrc-8051. These have probably been fixed but have not yet
+ been verified on these platforms.
Priority: See pjrc-8051
Description: The simulated Z80 serial console (configs/z80sim/src/z80_serial.c +
@@ -976,5 +981,5 @@ o z16 (arch/z16)
Status: Open
Priority: Low
-
-
+o mc68hc1x (arch/hc)
+ ^^^^^^^^^^^^^^^^^^
diff --git a/nuttx/arch/arm/src/common/up_createstack.c b/nuttx/arch/arm/src/common/up_createstack.c
index c3e213eb4..e76e05696 100644
--- a/nuttx/arch/arm/src/common/up_createstack.c
+++ b/nuttx/arch/arm/src/common/up_createstack.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_createstack.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -82,7 +82,7 @@
* must be allocated.
****************************************************************************/
-STATUS up_create_stack(_TCB *tcb, size_t stack_size)
+int up_create_stack(_TCB *tcb, size_t stack_size)
{
if (tcb->stack_alloc_ptr &&
tcb->adj_stack_size != stack_size)
diff --git a/nuttx/arch/arm/src/common/up_usestack.c b/nuttx/arch/arm/src/common/up_usestack.c
index c67dd6ad0..bd7411f0c 100644
--- a/nuttx/arch/arm/src/common/up_usestack.c
+++ b/nuttx/arch/arm/src/common/up_usestack.c
@@ -78,7 +78,7 @@
*
****************************************************************************/
-STATUS up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
+int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
{
size_t top_of_stack;
size_t size_of_stack;
diff --git a/nuttx/arch/hc/src/common/up_createstack.c b/nuttx/arch/hc/src/common/up_createstack.c
index 1f2cb691c..4750c463b 100755
--- a/nuttx/arch/hc/src/common/up_createstack.c
+++ b/nuttx/arch/hc/src/common/up_createstack.c
@@ -82,7 +82,7 @@
*
****************************************************************************/
-STATUS up_create_stack(_TCB *tcb, size_t stack_size)
+int up_create_stack(_TCB *tcb, size_t stack_size)
{
if (tcb->stack_alloc_ptr && tcb->adj_stack_size != stack_size)
{
diff --git a/nuttx/arch/hc/src/common/up_usestack.c b/nuttx/arch/hc/src/common/up_usestack.c
index 51b3c1622..ab7109a8c 100755
--- a/nuttx/arch/hc/src/common/up_usestack.c
+++ b/nuttx/arch/hc/src/common/up_usestack.c
@@ -77,7 +77,7 @@
*
****************************************************************************/
-STATUS up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
+int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
{
size_t top_of_stack;
size_t size_of_stack;
diff --git a/nuttx/arch/sh/src/common/up_createstack.c b/nuttx/arch/sh/src/common/up_createstack.c
index 1a1ecb8d8..853601726 100644
--- a/nuttx/arch/sh/src/common/up_createstack.c
+++ b/nuttx/arch/sh/src/common/up_createstack.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_createstack.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -82,7 +82,7 @@
* must be allocated.
****************************************************************************/
-STATUS up_create_stack(_TCB *tcb, size_t stack_size)
+int up_create_stack(_TCB *tcb, size_t stack_size)
{
if (tcb->stack_alloc_ptr &&
tcb->adj_stack_size != stack_size)
diff --git a/nuttx/arch/sh/src/common/up_usestack.c b/nuttx/arch/sh/src/common/up_usestack.c
index 5fd8acb8a..226d5f52f 100644
--- a/nuttx/arch/sh/src/common/up_usestack.c
+++ b/nuttx/arch/sh/src/common/up_usestack.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_usestack.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,7 @@
*
****************************************************************************/
-STATUS up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
+int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
{
size_t top_of_stack;
size_t size_of_stack;
diff --git a/nuttx/arch/sim/src/up_createstack.c b/nuttx/arch/sim/src/up_createstack.c
index f0aa8fdf6..4d31701a1 100644
--- a/nuttx/arch/sim/src/up_createstack.c
+++ b/nuttx/arch/sim/src/up_createstack.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * up_createstack.c
+ * arch/sim/src/up_createstack.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -81,9 +81,9 @@
*
****************************************************************************/
-STATUS up_create_stack(_TCB *tcb, size_t stack_size)
+int up_create_stack(_TCB *tcb, size_t stack_size)
{
- STATUS ret = ERROR;
+ int ret = ERROR;
/* Move up to next even word boundary if necessary */
diff --git a/nuttx/arch/sim/src/up_usestack.c b/nuttx/arch/sim/src/up_usestack.c
index e28cac312..309dc2dc4 100644
--- a/nuttx/arch/sim/src/up_usestack.c
+++ b/nuttx/arch/sim/src/up_usestack.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * up_usestack.c
+ * arch/sim/src/up_usestack.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -81,7 +81,7 @@
*
****************************************************************************/
-STATUS up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
+int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
{
/* Move up to next even word boundary if necessary */
diff --git a/nuttx/arch/z16/src/common/up_createstack.c b/nuttx/arch/z16/src/common/up_createstack.c
index 68c3da28f..166ae25e1 100644
--- a/nuttx/arch/z16/src/common/up_createstack.c
+++ b/nuttx/arch/z16/src/common/up_createstack.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * common/up_createstack.c
+ * arch/z16/common/up_createstack.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -83,7 +83,7 @@
* must be allocated.
****************************************************************************/
-STATUS up_create_stack(_TCB *tcb, size_t stack_size)
+int up_create_stack(_TCB *tcb, size_t stack_size)
{
if (tcb->stack_alloc_ptr &&
tcb->adj_stack_size != stack_size)
diff --git a/nuttx/arch/z16/src/common/up_usestack.c b/nuttx/arch/z16/src/common/up_usestack.c
index d633fa294..c65c4e4b9 100644
--- a/nuttx/arch/z16/src/common/up_usestack.c
+++ b/nuttx/arch/z16/src/common/up_usestack.c
@@ -1,7 +1,7 @@
/************************************************************
- * common/up_usestack.c
+ * arch/z16/common/up_usestack.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,7 @@
*
************************************************************/
-STATUS up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
+int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
{
size_t top_of_stack;
size_t size_of_stack;
diff --git a/nuttx/arch/z80/src/common/up_createstack.c b/nuttx/arch/z80/src/common/up_createstack.c
index dc3f715c9..1c2d08b1f 100644
--- a/nuttx/arch/z80/src/common/up_createstack.c
+++ b/nuttx/arch/z80/src/common/up_createstack.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * common/up_createstack.c
+ * arch/z80/src/common/up_createstack.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -79,7 +79,7 @@
* must be allocated.
****************************************************************************/
-STATUS up_create_stack(_TCB *tcb, size_t stack_size)
+int up_create_stack(_TCB *tcb, size_t stack_size)
{
if (tcb->stack_alloc_ptr &&
tcb->adj_stack_size != stack_size)
diff --git a/nuttx/arch/z80/src/common/up_usestack.c b/nuttx/arch/z80/src/common/up_usestack.c
index de8e7e87c..c73e99bc1 100644
--- a/nuttx/arch/z80/src/common/up_usestack.c
+++ b/nuttx/arch/z80/src/common/up_usestack.c
@@ -1,7 +1,7 @@
/************************************************************
- * common/up_usestack.c
+ * arch/z80/src/common/up_usestack.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,7 @@
*
************************************************************/
-STATUS up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
+int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
{
size_t top_of_stack;
size_t size_of_stack;
diff --git a/nuttx/configs/demo9s12ne64/README.txt b/nuttx/configs/demo9s12ne64/README.txt
index ef063b784..72b2c581d 100755
--- a/nuttx/configs/demo9s12ne64/README.txt
+++ b/nuttx/configs/demo9s12ne64/README.txt
@@ -191,6 +191,48 @@ FreeScale HCS12 Serial Monitor
therefore keep the normal (non-monitor) vector locations
(0xff80–0xfffe).
+Soft Registers
+^^^^^^^^^^^^^^
+
+ The mc68hcs12 compilation is prone to errors like the following:
+
+ CC: lib_b16sin.c
+ lib_b16sin.c: In function `b16sin':
+ lib_b16sin.c:110: error: unable to find a register to spill in class `S_REGS'
+ lib_b16sin.c:110: error: this is the insn:
+ (insn:HI 41 46 44 8 (parallel [
+ (set (subreg:SI (reg:DI 58 [ rad ]) 4)
+ (reg/v:SI 54 [ rad ]))
+ (clobber (scratch:HI))
+ ]) 20 {movsi_internal} (insn_list 46 (nil))
+ (expr_list:REG_UNUSED (scratch:HI)
+ (expr_list:REG_NO_CONFLICT (reg/v:SI 54 [ rad ])
+ (nil))))
+ lib_b16sin.c:110: confused by earlier errors, bailing out
+
+ There are several ways that this error could be fixed:
+
+ 1. Increase the number of soft regiaters (i.e., "fake" registers defined
+ at fixed memory locations). This can be done by adding something like
+ -msoft-reg-count=4 to the CFLAGS. This approach was not taken
+ because:
+
+ - This slows hcs12 performance
+ - All of these soft registers wouil have to be saved and restored
+ on every interrupt and context switch.
+
+ 2. Lowering the optimization level. Also not desireable becauase 99% of the
+ files that do not have this problem also increase in size. Special case
+ compilation with reduced optimization levels just for the files that need
+ it could be done, but this would complicate the make system.
+
+ 3. Restructuring files to reduce the complexity. If you add local variables
+ to hold intermediate computational results, this error can be eliminated.
+ This is the approach taken in NuttX. It has disadvantages only in that
+ (1) it takes some effort and good guessing to eliminate the problem, and (2)
+ the problem is not really eliminated -- it can and will re-occur when files
+ are changed or new files are added.
+
HCS12/DEMO9S12NEC64-specific Configuration Options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/nuttx/fs/fs_inoderemove.c b/nuttx/fs/fs_inoderemove.c
index 1dcfce467..2034234db 100644
--- a/nuttx/fs/fs_inoderemove.c
+++ b/nuttx/fs/fs_inoderemove.c
@@ -1,7 +1,7 @@
/****************************************************************************
* fs/fs_inoderemove.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -105,7 +105,7 @@ static void inode_unlink(struct inode *node,
* NOTE: Caller must hold the inode semaphore
****************************************************************************/
-STATUS inode_remove(const char *path)
+int inode_remove(const char *path)
{
const char *name = path;
FAR struct inode *node;
diff --git a/nuttx/fs/fs_internal.h b/nuttx/fs/fs_internal.h
index 34b722e98..48849436f 100644
--- a/nuttx/fs/fs_internal.h
+++ b/nuttx/fs/fs_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
- * fs_internal.h
+ * fs/fs_internal.h
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009 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.
*
@@ -208,7 +208,7 @@ EXTERN FAR struct inode *inode_reserve(const char *path);
/* fs_inoderemove.c **********************************************************/
-EXTERN STATUS inode_remove(const char *path);
+EXTERN int inode_remove(const char *path);
/* fs_inodefind.c ************************************************************/
diff --git a/nuttx/fs/fs_registerblockdriver.c b/nuttx/fs/fs_registerblockdriver.c
index aad6a9224..248e3e2a7 100644
--- a/nuttx/fs/fs_registerblockdriver.c
+++ b/nuttx/fs/fs_registerblockdriver.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * fs_registerblockdriver.c
+ * fs/fs_registerblockdriver.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -67,12 +67,12 @@
* Name: register_driver
****************************************************************************/
-STATUS register_blockdriver(const char *path,
+int register_blockdriver(const char *path,
const struct block_operations *bops,
mode_t mode, void *priv)
{
struct inode *node;
- STATUS ret = -ENOMEM;
+ int ret = -ENOMEM;
/* Insert an inode for the device driver -- we need to hold the inode semaphore
* to prevent access to the tree while we this. This is because we will have a
diff --git a/nuttx/fs/fs_registerdriver.c b/nuttx/fs/fs_registerdriver.c
index 5299ba28d..7b3520435 100644
--- a/nuttx/fs/fs_registerdriver.c
+++ b/nuttx/fs/fs_registerdriver.c
@@ -67,11 +67,11 @@
* Name: register_driver
****************************************************************************/
-STATUS register_driver(const char *path, const struct file_operations *fops,
+int register_driver(const char *path, const struct file_operations *fops,
mode_t mode, void *priv)
{
struct inode *node;
- STATUS ret = ERROR;
+ int ret = ERROR;
/* Insert a dummy node -- we need to hold the inode semaphore
* to do this because we will have a momentarily bad structure.
diff --git a/nuttx/fs/fs_unregisterblockdriver.c b/nuttx/fs/fs_unregisterblockdriver.c
index 2e0bc6673..cb737f2e3 100644
--- a/nuttx/fs/fs_unregisterblockdriver.c
+++ b/nuttx/fs/fs_unregisterblockdriver.c
@@ -1,7 +1,7 @@
/****************************************************************************
* fs/fs_unregisterblockdriver.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -71,9 +71,9 @@
* Name: unregister_blockdriver()
****************************************************************************/
-STATUS unregister_blockdriver(const char *path)
+int unregister_blockdriver(const char *path)
{
- STATUS ret;
+ int ret;
inode_semtake();
ret = inode_remove(path);
inode_semgive();
diff --git a/nuttx/fs/fs_unregisterdriver.c b/nuttx/fs/fs_unregisterdriver.c
index 377154263..2455742db 100644
--- a/nuttx/fs/fs_unregisterdriver.c
+++ b/nuttx/fs/fs_unregisterdriver.c
@@ -1,7 +1,7 @@
/****************************************************************************
* fs/fs_unregisterdriver.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -71,9 +71,9 @@
* Name: unregister_driver()
****************************************************************************/
-STATUS unregister_driver(const char *path)
+int unregister_driver(const char *path)
{
- STATUS ret;
+ int ret;
inode_semtake();
ret = inode_remove(path);
inode_semgive();
diff --git a/nuttx/include/cxx/cstddef b/nuttx/include/cxx/cstddef
index d932eecf0..a3c474a6c 100755
--- a/nuttx/include/cxx/cstddef
+++ b/nuttx/include/cxx/cstddef
@@ -87,7 +87,6 @@ namespace std
using ::gid_t;
using ::dev_t;
using ::ino_t;
- using ::sig_atomic_t;
using ::pid_t;
using ::socklen_t;
diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h
index a1182b198..6e855c82f 100644
--- a/nuttx/include/nuttx/arch.h
+++ b/nuttx/include/nuttx/arch.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * nuttx/arch.h
+ * include/nuttx/arch.h
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -152,7 +152,7 @@ EXTERN void up_initial_state(FAR _TCB *tcb);
****************************************************************************/
#ifndef CONFIG_CUSTOM_STACK
-EXTERN STATUS up_create_stack(FAR _TCB *tcb, size_t stack_size);
+EXTERN int up_create_stack(FAR _TCB *tcb, size_t stack_size);
#endif
/****************************************************************************
@@ -177,7 +177,7 @@ EXTERN STATUS up_create_stack(FAR _TCB *tcb, size_t stack_size);
****************************************************************************/
#ifndef CONFIG_CUSTOM_STACK
-EXTERN STATUS up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size);
+EXTERN int up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size);
#endif
/****************************************************************************
diff --git a/nuttx/include/nuttx/fs.h b/nuttx/include/nuttx/fs.h
index a0c70390d..2f399d2d2 100644
--- a/nuttx/include/nuttx/fs.h
+++ b/nuttx/include/nuttx/fs.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/fs.h
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __NUTTX_FS_H
-#define __NUTTX_FS_H
+#ifndef __INCLUDE_NUTTX_FS_H
+#define __INCLUDE_NUTTX_FS_H
/****************************************************************************
* Included Files
@@ -312,27 +312,27 @@ EXTERN void weak_function fs_initialize(void);
/* fs_registerdriver.c ******************************************************/
-EXTERN STATUS register_driver(const char *path,
- const struct file_operations *fops,
- mode_t mode, void *priv);
+EXTERN int register_driver(const char *path,
+ const struct file_operations *fops,
+ mode_t mode, void *priv);
/* fs_registerdriver.c ******************************************************/
-EXTERN STATUS register_blockdriver(const char *path,
- const struct block_operations *bops,
- mode_t mode, void *priv);
+EXTERN int register_blockdriver(const char *path,
+ const struct block_operations *bops,
+ mode_t mode, void *priv);
/* fs_unregisterdriver.c ****************************************************/
-EXTERN STATUS unregister_driver(const char *path);
+EXTERN int unregister_driver(const char *path);
/* fs_unregisterblockdriver.c ***********************************************/
-EXTERN STATUS unregister_blockdriver(const char *path);
+EXTERN int unregister_blockdriver(const char *path);
/* fs_open.c ****************************************************************/
-EXTERN int inode_checkflags(FAR struct inode *inode, int oflags);
+EXTERN int inode_checkflags(FAR struct inode *inode, int oflags);
/* fs_files.c ***************************************************************/
@@ -429,4 +429,4 @@ EXTERN ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t off
}
#endif
-#endif /* __NUTTX_FS_H */
+#endif /* __INCLUDE_NUTTX_FS_H */
diff --git a/nuttx/include/sched.h b/nuttx/include/sched.h
index 0923987f3..ed43f38d8 100644
--- a/nuttx/include/sched.h
+++ b/nuttx/include/sched.h
@@ -1,7 +1,7 @@
/********************************************************************************
* include/sched.h
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -87,41 +87,41 @@ extern "C" {
/* Task Control Interfaces (non-standard) */
#ifndef CONFIG_CUSTOM_STACK
-EXTERN STATUS task_init(FAR _TCB *tcb, const char *name, int priority,
- FAR uint32 *stack, uint32 stack_size,
- main_t entry, const char *argv[]);
+EXTERN int task_init(FAR _TCB *tcb, const char *name, int priority,
+ FAR uint32 *stack, uint32 stack_size,
+ main_t entry, const char *argv[]);
#else
-EXTERN STATUS task_init(FAR _TCB *tcb, const char *name, int priority,
- main_t entry, const char *argv[]);
+EXTERN int task_init(FAR _TCB *tcb, const char *name, int priority,
+ main_t entry, const char *argv[]);
#endif
-EXTERN STATUS task_activate(FAR _TCB *tcb);
+EXTERN int task_activate(FAR _TCB *tcb);
#ifndef CONFIG_CUSTOM_STACK
-EXTERN int task_create(const char *name, int priority, int stack_size,
- main_t entry, const char *argv[]);
+EXTERN int task_create(const char *name, int priority, int stack_size,
+ main_t entry, const char *argv[]);
#else
-EXTERN int task_create(const char *name, int priority,
- main_t entry, const char *argv[]);
+EXTERN int task_create(const char *name, int priority,
+ main_t entry, const char *argv[]);
#endif
-EXTERN STATUS task_delete(pid_t pid);
-EXTERN STATUS task_restart(pid_t pid);
+EXTERN int task_delete(pid_t pid);
+EXTERN int task_restart(pid_t pid);
/* Task Scheduling Interfaces (based on POSIX APIs) */
-EXTERN int sched_setparam(pid_t pid, const struct sched_param *param);
-EXTERN int sched_getparam(pid_t pid, struct sched_param *param);
-EXTERN int sched_setscheduler(pid_t pid, int policy,
- const struct sched_param *param);
-EXTERN int sched_getscheduler(pid_t pid);
-EXTERN int sched_yield(void);
-EXTERN int sched_get_priority_max(int policy);
-EXTERN int sched_get_priority_min(int policy);
-EXTERN int sched_rr_get_interval(pid_t pid, struct timespec *interval);
+EXTERN int sched_setparam(pid_t pid, const struct sched_param *param);
+EXTERN int sched_getparam(pid_t pid, struct sched_param *param);
+EXTERN int sched_setscheduler(pid_t pid, int policy,
+ const struct sched_param *param);
+EXTERN int sched_getscheduler(pid_t pid);
+EXTERN int sched_yield(void);
+EXTERN int sched_get_priority_max(int policy);
+EXTERN int sched_get_priority_min(int policy);
+EXTERN int sched_rr_get_interval(pid_t pid, struct timespec *interval);
/* Task Switching Interfaces (non-standard) */
-EXTERN STATUS sched_lock(void);
-EXTERN STATUS sched_unlock(void);
-EXTERN sint32 sched_lockcount(void);
+EXTERN int sched_lock(void);
+EXTERN int sched_unlock(void);
+EXTERN sint32 sched_lockcount(void);
/* If instrumentation of the scheduler is enabled, then some
* outboard logic must provide the following interfaces.
@@ -129,9 +129,9 @@ EXTERN sint32 sched_lockcount(void);
#ifdef CONFIG_SCHED_INSTRUMENTATION
-EXTERN void sched_note_start(FAR _TCB *tcb );
-EXTERN void sched_note_stop(FAR _TCB *tcb );
-EXTERN void sched_note_switch(FAR _TCB *pFromTcb, FAR _TCB *pToTcb);
+EXTERN void sched_note_start(FAR _TCB *tcb );
+EXTERN void sched_note_stop(FAR _TCB *tcb );
+EXTERN void sched_note_switch(FAR _TCB *pFromTcb, FAR _TCB *pToTcb);
#else
# define sched_note_start(t)
diff --git a/nuttx/include/sys/types.h b/nuttx/include/sys/types.h
index 91544bf0c..a8baa9a58 100644
--- a/nuttx/include/sys/types.h
+++ b/nuttx/include/sys/types.h
@@ -107,30 +107,61 @@ typedef double float64;
/* Misc. scalar types */
-typedef unsigned int mode_t; /* Needs at least 16-bits but must be */
- /* sizeof(int) because it is passed */
- /* via varargs. */
+/* mode_t is an integer type used for file attributes. mode_t needs
+ * to be at least 16-bits but, in fact must be sizeof(int) because it is
+ * pased via varargs.
+ */
+
+typedef unsigned int mode_t;
+
+/* size_t is used for sizes of objects.
+ * ssize_t is used for a count of bytes or an error indication.
+ */
+
#ifdef CONFIG_SMALL_MEMORY
typedef uint16 size_t;
typedef sint16 ssize_t;
-typedef sint16 off_t;
-typedef uint16 blksize_t;
-typedef uint16 blkcnt_t;
#else
typedef uint32 size_t;
typedef sint32 ssize_t;
-typedef sint32 off_t;
-typedef uint16 blksize_t;
-typedef uint32 blkcnt_t;
#endif
-typedef off_t fpos_t;
+
+/* uid_t is used for user IDs
+ * gid_t is used for group IDs.
+ */
+
typedef sint16 uid_t;
typedef sint16 gid_t;
+
+/* dev_t is used for device IDs */
+
typedef uint16 dev_t;
+
+/* ino_t is used for file serial numbers */
+
typedef uint16 ino_t;
-typedef unsigned int sig_atomic_t;
+
+/* pid_t is used for process IDs and process group IDs */
+
typedef int pid_t;
-typedef int STATUS;
+
+/* blkcnt_t and off_t are signed integer types.
+ *
+ * blkcnt_t is used for file block counts.
+ * off_t is used for file sizes.
+ *
+ * Hence, both should be independent of processor architecture.
+ */
+
+typedef uint32 blkcnt_t;
+typedef sint32 off_t;
+typedef off_t fpos_t;
+
+/* blksize_t is a signed integer value used for file block sizes */
+
+typedef sint16 blksize_t;
+
+/* Network related */
typedef unsigned int socklen_t;
typedef uint16 sa_family_t;
diff --git a/nuttx/include/wdog.h b/nuttx/include/wdog.h
index 5056ab4cf..69fb59f0f 100644
--- a/nuttx/include/wdog.h
+++ b/nuttx/include/wdog.h
@@ -98,10 +98,9 @@ extern "C" {
#endif
EXTERN WDOG_ID wd_create(void);
-EXTERN STATUS wd_delete(WDOG_ID wdog);
-EXTERN STATUS wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry,
- int argc, ...);
-EXTERN STATUS wd_cancel(WDOG_ID wdog);
+EXTERN int wd_delete(WDOG_ID wdog);
+EXTERN int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...);
+EXTERN int wd_cancel(WDOG_ID wdog);
EXTERN int wd_gettime(WDOG_ID wdog);
#undef EXTERN
diff --git a/nuttx/lib/lib_fgetpos.c b/nuttx/lib/lib_fgetpos.c
index 9bb1af2a3..e91476813 100644
--- a/nuttx/lib/lib_fgetpos.c
+++ b/nuttx/lib/lib_fgetpos.c
@@ -1,7 +1,7 @@
/****************************************************************************
* lib/lib_fgetpos.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -118,6 +118,6 @@ int fgetpos(FAR FILE *stream, FAR fpos_t *pos)
return ERROR;
}
- *pos = (fpos_t)pos;
+ *pos = (fpos_t)position;
return OK;
}
diff --git a/nuttx/sched/os_internal.h b/nuttx/sched/os_internal.h
index 84a2997c7..a7b55acfd 100644
--- a/nuttx/sched/os_internal.h
+++ b/nuttx/sched/os_internal.h
@@ -239,11 +239,11 @@ extern const tasklist_t g_tasklisttable[NUM_TASK_STATES];
****************************************************************************/
extern void task_start(void);
-extern STATUS task_schedsetup(FAR _TCB *tcb, int priority,
+extern int task_schedsetup(FAR _TCB *tcb, int priority,
start_t start, main_t main);
-extern STATUS task_argsetup(FAR _TCB *tcb, const char *name,
+extern int task_argsetup(FAR _TCB *tcb, const char *name,
const char *argv[]);
-extern STATUS task_deletecurrent(void);
+extern int task_deletecurrent(void);
extern boolean sched_addreadytorun(FAR _TCB *rtrtcb);
extern boolean sched_removereadytorun(FAR _TCB *rtrtcb);
diff --git a/nuttx/sched/pthread_create.c b/nuttx/sched/pthread_create.c
index 836b422c6..4f3d05bdc 100644
--- a/nuttx/sched/pthread_create.c
+++ b/nuttx/sched/pthread_create.c
@@ -247,7 +247,7 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
{
FAR _TCB *ptcb;
FAR join_t *pjoin;
- STATUS status;
+ int status;
int priority;
#if CONFIG_RR_INTERVAL > 0
int policy;
diff --git a/nuttx/sched/sched_lock.c b/nuttx/sched/sched_lock.c
index 344d3d75b..5cddc436e 100644
--- a/nuttx/sched/sched_lock.c
+++ b/nuttx/sched/sched_lock.c
@@ -1,7 +1,7 @@
-/************************************************************
- * sched_lock.c
+/************************************************************************
+ * sched/sched_lock.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009 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 <nuttx/config.h>
#include <sys/types.h>
@@ -44,35 +44,35 @@
#include <nuttx/arch.h>
#include "os_internal.h"
-/************************************************************
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Type Declarations
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Global Variables
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Variables
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Functionss
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: sched_lock
*
* Description:
@@ -89,9 +89,9 @@
* Return Value:
* OK on success; ERROR on failure
*
- ************************************************************/
+ ************************************************************************/
-STATUS sched_lock(void)
+int sched_lock(void)
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
diff --git a/nuttx/sched/sched_unlock.c b/nuttx/sched/sched_unlock.c
index 073f5e31f..1d56b07e7 100644
--- a/nuttx/sched/sched_unlock.c
+++ b/nuttx/sched/sched_unlock.c
@@ -1,7 +1,7 @@
-/************************************************************
- * sched_unlock.c
+/************************************************************************
+ * sched/sched_unlock.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009 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,46 +31,46 @@
* 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 <nuttx/arch.h>
#include "os_internal.h"
-/************************************************************
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Type Declarations
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Global Variables
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Variables
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Functionss
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: sched_unlock
*
* Description: This function decrements the preemption lock
@@ -80,9 +80,9 @@
* times as sched_lock(). When the lockcount is decremented
* to zero, any tasks that were eligible to preempt the
* current task will execute.
- ************************************************************/
+ ************************************************************************/
-STATUS sched_unlock(void)
+int sched_unlock(void)
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
diff --git a/nuttx/sched/sem_post.c b/nuttx/sched/sem_post.c
index 3c5ccaf77..bed58f6bc 100644
--- a/nuttx/sched/sem_post.c
+++ b/nuttx/sched/sem_post.c
@@ -101,7 +101,7 @@
int sem_post(FAR sem_t *sem)
{
FAR _TCB *stcb = NULL;
- STATUS ret = ERROR;
+ int ret = ERROR;
irqstate_t saved_state;
/* Make sure we were supplied with a valid semaphore. */
diff --git a/nuttx/sched/task_activate.c b/nuttx/sched/task_activate.c
index e324e17a3..12038960f 100644
--- a/nuttx/sched/task_activate.c
+++ b/nuttx/sched/task_activate.c
@@ -88,7 +88,7 @@
*
****************************************************************************/
-STATUS task_activate(FAR _TCB *tcb)
+int task_activate(FAR _TCB *tcb)
{
irqstate_t flags = irqsave();
diff --git a/nuttx/sched/task_create.c b/nuttx/sched/task_create.c
index 5d7a5872b..247183eca 100644
--- a/nuttx/sched/task_create.c
+++ b/nuttx/sched/task_create.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * task_create.c
+ * sched/task_create.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -116,7 +116,7 @@ int task_create(const char *name, int priority,
#endif
{
FAR _TCB *tcb;
- STATUS status;
+ int status;
pid_t pid;
/* Allocate a TCB for the new task. */
diff --git a/nuttx/sched/task_delete.c b/nuttx/sched/task_delete.c
index 369f601ed..683fbd18d 100644
--- a/nuttx/sched/task_delete.c
+++ b/nuttx/sched/task_delete.c
@@ -1,7 +1,7 @@
/****************************************************************************
* sched/task_delete.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -93,12 +93,12 @@
*
****************************************************************************/
-STATUS task_delete(pid_t pid)
+int task_delete(pid_t pid)
{
FAR _TCB *rtcb;
FAR _TCB *dtcb;
irqstate_t saved_state;
- STATUS ret = ERROR;
+ int ret = ERROR;
/* Check if the task to delete is the calling task */
diff --git a/nuttx/sched/task_deletecurrent.c b/nuttx/sched/task_deletecurrent.c
index 8246bb471..4de621b2a 100644
--- a/nuttx/sched/task_deletecurrent.c
+++ b/nuttx/sched/task_deletecurrent.c
@@ -1,7 +1,7 @@
/****************************************************************************
* sched/task_deletecurrent.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -93,7 +93,7 @@
*
****************************************************************************/
-STATUS task_deletecurrent(void)
+int task_deletecurrent(void)
{
FAR _TCB *dtcb = (FAR _TCB*)g_readytorun.head;
FAR _TCB *rtcb;
diff --git a/nuttx/sched/task_init.c b/nuttx/sched/task_init.c
index 6d5395594..6c70bf435 100644
--- a/nuttx/sched/task_init.c
+++ b/nuttx/sched/task_init.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * task_init.c
+ * sched/task_init.c
*
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -108,15 +108,15 @@
****************************************************************************/
#ifndef CONFIG_CUSTOM_STACK
-STATUS task_init(FAR _TCB *tcb, const char *name, int priority,
- FAR uint32 *stack, uint32 stack_size,
- main_t entry, const char *argv[])
+int task_init(FAR _TCB *tcb, const char *name, int priority,
+ FAR uint32 *stack, uint32 stack_size,
+ main_t entry, const char *argv[])
#else
-STATUS task_init(FAR _TCB *tcb, const char *name, int priority,
- main_t entry, const char *argv[])
+int task_init(FAR _TCB *tcb, const char *name, int priority,
+ main_t entry, const char *argv[])
#endif
{
- STATUS ret;
+ int ret;
/* Associate file descriptors with the new task */
diff --git a/nuttx/sched/task_restart.c b/nuttx/sched/task_restart.c
index 00b8bf0a8..1cd575a4e 100644
--- a/nuttx/sched/task_restart.c
+++ b/nuttx/sched/task_restart.c
@@ -96,11 +96,11 @@
*
****************************************************************************/
-STATUS task_restart(pid_t pid)
+int task_restart(pid_t pid)
{
FAR _TCB *rtcb;
FAR _TCB *tcb;
- STATUS status;
+ int status;
irqstate_t state;
/* Make sure this task does not become ready-to-run while
diff --git a/nuttx/sched/task_setup.c b/nuttx/sched/task_setup.c
index 83bae570b..f54796e59 100644
--- a/nuttx/sched/task_setup.c
+++ b/nuttx/sched/task_setup.c
@@ -70,7 +70,7 @@ static const char g_noname[] = "<noname>";
* Private Function Prototypes
****************************************************************************/
-static STATUS task_assignpid(FAR _TCB* tcb);
+static int task_assignpid(FAR _TCB* tcb);
/****************************************************************************
* Private Functions
@@ -90,7 +90,7 @@ static STATUS task_assignpid(FAR _TCB* tcb);
*
****************************************************************************/
-static STATUS task_assignpid(FAR _TCB *tcb)
+static int task_assignpid(FAR _TCB *tcb)
{
pid_t next_pid;
int hash_ndx;
@@ -207,10 +207,9 @@ static inline void task_dupdspace(FAR _TCB *tcb)
*
****************************************************************************/
-STATUS task_schedsetup(FAR _TCB *tcb, int priority,
- start_t start, main_t main)
+int task_schedsetup(FAR _TCB *tcb, int priority, start_t start, main_t main)
{
- STATUS ret;
+ int ret;
/* Assign a unique task ID to the task. */
@@ -289,7 +288,7 @@ STATUS task_schedsetup(FAR _TCB *tcb, int priority,
*
****************************************************************************/
-STATUS task_argsetup(FAR _TCB *tcb, const char *name, const char *argv[])
+int task_argsetup(FAR _TCB *tcb, const char *name, const char *argv[])
{
int i;
diff --git a/nuttx/sched/wd_cancel.c b/nuttx/sched/wd_cancel.c
index 9bdeafcf8..acf957163 100644
--- a/nuttx/sched/wd_cancel.c
+++ b/nuttx/sched/wd_cancel.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * wd_cancel.c
+ * sched/wd_cancel.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -85,12 +85,12 @@
*
****************************************************************************/
-STATUS wd_cancel (WDOG_ID wdid)
+int wd_cancel (WDOG_ID wdid)
{
wdog_t *curr;
wdog_t *prev;
irqstate_t saved_state;
- STATUS ret = ERROR;
+ int ret = ERROR;
/* Prohibit timer interactions with the timer queue until the
* cancellation is complete
diff --git a/nuttx/sched/wd_delete.c b/nuttx/sched/wd_delete.c
index 25f2db8ab..eebfc0dc8 100644
--- a/nuttx/sched/wd_delete.c
+++ b/nuttx/sched/wd_delete.c
@@ -1,7 +1,7 @@
/****************************************************************************
- * wd_delete.c
+ * sched/wd_delete.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -92,7 +92,7 @@
*
****************************************************************************/
-STATUS wd_delete(WDOG_ID wdId)
+int wd_delete(WDOG_ID wdId)
{
irqstate_t saved_state;
diff --git a/nuttx/sched/wd_start.c b/nuttx/sched/wd_start.c
index a406b3f30..39525c0bc 100644
--- a/nuttx/sched/wd_start.c
+++ b/nuttx/sched/wd_start.c
@@ -125,7 +125,7 @@ typedef void (*wdentry4_t)(int argc, uint32 arg1, uint32 arg2,
*
****************************************************************************/
-STATUS wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...)
+int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...)
{
va_list ap;
FAR wdog_t *curr;