mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 10:58:49 +08:00
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
This commit is contained in:
parent
9535a28d7a
commit
4686cc55fa
47 changed files with 340 additions and 231 deletions
|
@ -990,4 +990,9 @@
|
||||||
can be used with any file system. Good performance of this layer will
|
can be used with any file system. Good performance of this layer will
|
||||||
depend upon functioning write buffer support!
|
depend upon functioning write buffer support!
|
||||||
NOTE: FTL support is untested as of the initial check-in.
|
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
|
||||||
|
|
||||||
|
|
|
@ -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: December 5 2009</p>
|
<p>Last Updated: December 13, 2009</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1616,6 +1616,11 @@ nuttx-2010.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
can be used with any file system. Good performance of this layer will
|
can be used with any file system. Good performance of this layer will
|
||||||
depend upon functioning write buffer support!
|
depend upon functioning write buffer support!
|
||||||
NOTE: FTL support is untested as of the initial check-in.
|
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 <spudmonkey@racsa.co.cr>
|
pascal-2010.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
|
|
@ -438,8 +438,10 @@
|
||||||
<li><code>arch/arm/include/lpc214x</code> and <code>arch/arm/src/lpc214x</code>:
|
<li><code>arch/arm/include/lpc214x</code> and <code>arch/arm/src/lpc214x</code>:
|
||||||
These directories provide support for NXP LPC214x family of
|
These directories provide support for NXP LPC214x family of
|
||||||
processors.
|
processors.
|
||||||
STATUS: This port is in progress and should be available in the
|
STATUS: This port boots and passes the OS test (examples/ostest).
|
||||||
nuttx-0.2.5 release.
|
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>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -700,7 +702,14 @@
|
||||||
|
|
||||||
<li><code>configs/us7032evb1</code>:
|
<li><code>configs/us7032evb1</code>:
|
||||||
This is a port of the Hitachi SH-1 on the Hitachi SH-1/US7032EVB1 board.
|
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>
|
||||||
|
|
||||||
<li><code>configs/xtrs</code>:
|
<li><code>configs/xtrs</code>:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<h1><big><font color="#3c34ec"><i>NuttX Operating System<p>User's Manual</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>NuttX Operating System<p>User's Manual</i></font></big></h1>
|
||||||
<p><small>by</small></p>
|
<p><small>by</small></p>
|
||||||
<p>Gregory Nutt<p>
|
<p>Gregory Nutt<p>
|
||||||
<p>Last Updated: May 22, 2009</p>
|
<p>Last Updated: December 13, 2009</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -296,8 +296,8 @@ VxWorks provides the following similar interface:
|
||||||
<b>Function Prototype:</b>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
STATUS task_init(_TCB *tcb, char *name, int priority, uint32 *stack, uint32 stack_size,
|
int task_init(_TCB *tcb, char *name, int priority, uint32 *stack, uint32 stack_size,
|
||||||
maint_t entry, const char *argv[]);
|
maint_t entry, const char *argv[]);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -368,7 +368,7 @@ VxWorks provides the following similar interface:
|
||||||
<b>Function Prototype:</b>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
STATUS task_activate( _TCB *tcb );
|
int task_activate( _TCB *tcb );
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -418,7 +418,7 @@ the pointer to the WIND_TCB cast to an integer.
|
||||||
<b>Function Prototype:</b>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
STATUS task_delete( pid_t pid );
|
int task_delete( pid_t pid );
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -514,7 +514,7 @@ And the UNIX interface:
|
||||||
<b>Function Prototype:</b>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
STATUS task_restart( pid_t pid );
|
int task_restart( pid_t pid );
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -974,7 +974,7 @@ priority of the calling task is returned.
|
||||||
<b>Function Prototype:</b>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
STATUS sched_lock( void );
|
int sched_lock( void );
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -994,7 +994,7 @@ number of times) or until it blocks itself.
|
||||||
<p>
|
<p>
|
||||||
<b>Assumptions/Limitations:</b>
|
<b>Assumptions/Limitations:</b>
|
||||||
<p>
|
<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:
|
VxWorks provides the comparable interface:
|
||||||
<pre>
|
<pre>
|
||||||
STATUS taskLock( void );
|
STATUS taskLock( void );
|
||||||
|
@ -1006,7 +1006,7 @@ VxWorks provides the comparable interface:
|
||||||
<b>Function Prototype:</b>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
STATUS sched_unlock( void );
|
int sched_unlock( void );
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -1027,7 +1027,7 @@ eligible to preempt the current task will execute.
|
||||||
<p>
|
<p>
|
||||||
<b>Assumptions/Limitations:</b>
|
<b>Assumptions/Limitations:</b>
|
||||||
<p>
|
<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:
|
VxWorks provides the comparable interface:
|
||||||
<pre>
|
<pre>
|
||||||
STATUS taskUnlock( void );
|
STATUS taskUnlock( void );
|
||||||
|
@ -2296,7 +2296,7 @@ initialization time).
|
||||||
<b>Function Prototype:</b>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <wdog.h>
|
#include <wdog.h>
|
||||||
STATUS wd_delete (WDOG_ID wdog);
|
int wd_delete (WDOG_ID wdog);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -2321,7 +2321,7 @@ pointer to a watchdog structure.
|
||||||
caller to assure that the watchdog is inactive before deleting
|
caller to assure that the watchdog is inactive before deleting
|
||||||
it.
|
it.
|
||||||
<p>
|
<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:
|
VxWorks provides the following comparable interface:
|
||||||
<pre>
|
<pre>
|
||||||
STATUS wdDelete (WDOG_ID wdog);
|
STATUS wdDelete (WDOG_ID wdog);
|
||||||
|
@ -2340,7 +2340,7 @@ before deallocating it (i.e., never returns ERROR).
|
||||||
<b>Function Prototype:</b>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <wdog.h>
|
#include <wdog.h>
|
||||||
STATUS wd_start( WDOG_ID wdog, int delay, wdentry_t wdentry,
|
int wd_start( WDOG_ID wdog, int delay, wdentry_t wdentry,
|
||||||
intt argc, ....);
|
intt argc, ....);
|
||||||
</pre>
|
</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
|
context of the timer interrupt handler and is subject to all ISR
|
||||||
restrictions.
|
restrictions.
|
||||||
<p>
|
<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:
|
VxWorks provides the following comparable interface:
|
||||||
<pre>
|
<pre>
|
||||||
STATUS wdStart (WDOG_ID wdog, int delay, FUNCPTR wdentry, int parameter);
|
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>
|
<b>Function Prototype:</b>
|
||||||
<pre>
|
<pre>
|
||||||
#include <wdog.h>
|
#include <wdog.h>
|
||||||
STATUS wd_cancel (WDOG_ID wdog);
|
int wd_cancel (WDOG_ID wdog);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -2419,7 +2419,7 @@ level.
|
||||||
<p>
|
<p>
|
||||||
<b>Assumptions/Limitations:</b>
|
<b>Assumptions/Limitations:</b>
|
||||||
<p>
|
<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:
|
VxWorks provides the following comparable interface:
|
||||||
<pre>
|
<pre>
|
||||||
STATUS wdCancel (WDOG_ID wdog);
|
STATUS wdCancel (WDOG_ID wdog);
|
||||||
|
@ -7392,7 +7392,6 @@ interface include:
|
||||||
<li>pid_t
|
<li>pid_t
|
||||||
<li>size_t
|
<li>size_t
|
||||||
<li>sigset_t
|
<li>sigset_t
|
||||||
<li>STATUS
|
|
||||||
<li>time_t
|
<li>time_t
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
38
README.txt
38
README.txt
|
@ -9,20 +9,36 @@ README
|
||||||
INSTALLATION
|
INSTALLATION
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
Download and unpack the NuttX tarball. If you are reading this, then you
|
Download and Unpack:
|
||||||
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
|
Download and unpack the NuttX tarball. If you are reading this, then
|
||||||
in the higher level directory names. For example, under Cygwin, your home
|
you have probably already done that. After unpacking, you will end
|
||||||
directory might be formed from your first and last names like: "/home/First Last".
|
up with a directory called nuttx-version (where version is the NuttX
|
||||||
That will cause strange errors when the make system tries to build.
|
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.
|
||||||
|
|
||||||
[Actually, that is probably not to difficult to fix. Some Makefiles probably
|
That nuttx build directory should reside in a path that contains no
|
||||||
just need some pathes within double quotes]
|
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
|
CONFIGURING NUTTX
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
21
TODO
21
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/)
|
(5) Task/Scheduler (sched/)
|
||||||
(2) Memory Managment (mm/)
|
(2) Memory Managment (mm/)
|
||||||
|
@ -32,6 +32,7 @@ NuttX TODO List (Last updated December 5, 2009)
|
||||||
(4) Renesas M16C/26 (arch/sh/src/m16c)
|
(4) Renesas M16C/26 (arch/sh/src/m16c)
|
||||||
(8) z80/z8/ez80 (arch/z80/)
|
(8) z80/z8/ez80 (arch/z80/)
|
||||||
(8) z16 (arch/z16/)
|
(8) z16 (arch/z16/)
|
||||||
|
(0) mc68hc1x (arch/hc)
|
||||||
|
|
||||||
o Task/Scheduler (sched/)
|
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/barrier.c around lines 53 and 74
|
||||||
examples/ostest/sighand.c at 225 and 244
|
examples/ostest/sighand.c at 225 and 244
|
||||||
driver/serial.c in usleep calls around 347 and 354
|
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
|
Priority: Medium
|
||||||
|
|
||||||
Description Global data is not being initialized. Logic like that of SDCCs
|
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)
|
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
|
compilation as described for pjrc-8051. At typical cause is code like
|
||||||
usleep(500*1000) which exceeds the range of a 16-bit integer
|
usleep(500*1000) which exceeds the range of a 16-bit integer.
|
||||||
Status: See pjrc-8051
|
Status: See pjrc-8051. These have probably been fixed but have not yet
|
||||||
|
been verified on these platforms.
|
||||||
Priority: See pjrc-8051
|
Priority: See pjrc-8051
|
||||||
|
|
||||||
Description: The simulated Z80 serial console (configs/z80sim/src/z80_serial.c +
|
Description: The simulated Z80 serial console (configs/z80sim/src/z80_serial.c +
|
||||||
|
@ -976,5 +981,5 @@ o z16 (arch/z16)
|
||||||
Status: Open
|
Status: Open
|
||||||
Priority: Low
|
Priority: Low
|
||||||
|
|
||||||
|
o mc68hc1x (arch/hc)
|
||||||
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/common/up_createstack.c
|
* 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>
|
* 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
|
||||||
|
@ -82,7 +82,7 @@
|
||||||
* must be allocated.
|
* 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 &&
|
if (tcb->stack_alloc_ptr &&
|
||||||
tcb->adj_stack_size != stack_size)
|
tcb->adj_stack_size != stack_size)
|
||||||
|
|
|
@ -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 top_of_stack;
|
||||||
size_t size_of_stack;
|
size_t size_of_stack;
|
||||||
|
|
|
@ -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)
|
if (tcb->stack_alloc_ptr && tcb->adj_stack_size != stack_size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 top_of_stack;
|
||||||
size_t size_of_stack;
|
size_t size_of_stack;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/sh/src/common/up_createstack.c
|
* 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>
|
* 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
|
||||||
|
@ -82,7 +82,7 @@
|
||||||
* must be allocated.
|
* 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 &&
|
if (tcb->stack_alloc_ptr &&
|
||||||
tcb->adj_stack_size != stack_size)
|
tcb->adj_stack_size != stack_size)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/sh/src/common/up_usestack.c
|
* 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>
|
* 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
|
||||||
|
@ -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 top_of_stack;
|
||||||
size_t size_of_stack;
|
size_t size_of_stack;
|
||||||
|
|
|
@ -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>
|
* 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
|
||||||
|
@ -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 */
|
/* Move up to next even word boundary if necessary */
|
||||||
|
|
||||||
|
|
|
@ -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>
|
* 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
|
||||||
|
@ -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 */
|
/* Move up to next even word boundary if necessary */
|
||||||
|
|
||||||
|
|
|
@ -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>
|
* 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
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
* must be allocated.
|
* 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 &&
|
if (tcb->stack_alloc_ptr &&
|
||||||
tcb->adj_stack_size != stack_size)
|
tcb->adj_stack_size != stack_size)
|
||||||
|
|
|
@ -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>
|
* 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
|
||||||
|
@ -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 top_of_stack;
|
||||||
size_t size_of_stack;
|
size_t size_of_stack;
|
||||||
|
|
|
@ -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>
|
* 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
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
* must be allocated.
|
* 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 &&
|
if (tcb->stack_alloc_ptr &&
|
||||||
tcb->adj_stack_size != stack_size)
|
tcb->adj_stack_size != stack_size)
|
||||||
|
|
|
@ -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>
|
* 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
|
||||||
|
@ -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 top_of_stack;
|
||||||
size_t size_of_stack;
|
size_t size_of_stack;
|
||||||
|
|
|
@ -191,6 +191,48 @@ FreeScale HCS12 Serial Monitor
|
||||||
therefore keep the normal (non-monitor) vector locations
|
therefore keep the normal (non-monitor) vector locations
|
||||||
(0xff80–0xfffe).
|
(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
|
HCS12/DEMO9S12NEC64-specific Configuration Options
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/fs_inoderemove.c
|
* 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>
|
* 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
|
||||||
|
@ -105,7 +105,7 @@ static void inode_unlink(struct inode *node,
|
||||||
* NOTE: Caller must hold the inode semaphore
|
* NOTE: Caller must hold the inode semaphore
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS inode_remove(const char *path)
|
int inode_remove(const char *path)
|
||||||
{
|
{
|
||||||
const char *name = path;
|
const char *name = path;
|
||||||
FAR struct inode *node;
|
FAR struct inode *node;
|
||||||
|
|
|
@ -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>
|
* 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.
|
||||||
*
|
*
|
||||||
|
@ -208,7 +208,7 @@ EXTERN FAR struct inode *inode_reserve(const char *path);
|
||||||
|
|
||||||
/* fs_inoderemove.c **********************************************************/
|
/* fs_inoderemove.c **********************************************************/
|
||||||
|
|
||||||
EXTERN STATUS inode_remove(const char *path);
|
EXTERN int inode_remove(const char *path);
|
||||||
|
|
||||||
/* fs_inodefind.c ************************************************************/
|
/* fs_inodefind.c ************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs_registerblockdriver.c
|
* fs/fs_registerblockdriver.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
@ -67,12 +67,12 @@
|
||||||
* Name: register_driver
|
* Name: register_driver
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS register_blockdriver(const char *path,
|
int register_blockdriver(const char *path,
|
||||||
const struct block_operations *bops,
|
const struct block_operations *bops,
|
||||||
mode_t mode, void *priv)
|
mode_t mode, void *priv)
|
||||||
{
|
{
|
||||||
struct inode *node;
|
struct inode *node;
|
||||||
STATUS ret = -ENOMEM;
|
int ret = -ENOMEM;
|
||||||
|
|
||||||
/* Insert an inode for the device driver -- we need to hold the inode semaphore
|
/* 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
|
* to prevent access to the tree while we this. This is because we will have a
|
||||||
|
|
|
@ -67,11 +67,11 @@
|
||||||
* Name: register_driver
|
* 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)
|
mode_t mode, void *priv)
|
||||||
{
|
{
|
||||||
struct inode *node;
|
struct inode *node;
|
||||||
STATUS ret = ERROR;
|
int ret = ERROR;
|
||||||
|
|
||||||
/* Insert a dummy node -- we need to hold the inode semaphore
|
/* Insert a dummy node -- we need to hold the inode semaphore
|
||||||
* to do this because we will have a momentarily bad structure.
|
* to do this because we will have a momentarily bad structure.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/fs_unregisterblockdriver.c
|
* 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>
|
* 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
|
||||||
|
@ -71,9 +71,9 @@
|
||||||
* Name: unregister_blockdriver()
|
* Name: unregister_blockdriver()
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS unregister_blockdriver(const char *path)
|
int unregister_blockdriver(const char *path)
|
||||||
{
|
{
|
||||||
STATUS ret;
|
int ret;
|
||||||
inode_semtake();
|
inode_semtake();
|
||||||
ret = inode_remove(path);
|
ret = inode_remove(path);
|
||||||
inode_semgive();
|
inode_semgive();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/fs_unregisterdriver.c
|
* 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>
|
* 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
|
||||||
|
@ -71,9 +71,9 @@
|
||||||
* Name: unregister_driver()
|
* Name: unregister_driver()
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS unregister_driver(const char *path)
|
int unregister_driver(const char *path)
|
||||||
{
|
{
|
||||||
STATUS ret;
|
int ret;
|
||||||
inode_semtake();
|
inode_semtake();
|
||||||
ret = inode_remove(path);
|
ret = inode_remove(path);
|
||||||
inode_semgive();
|
inode_semgive();
|
||||||
|
|
|
@ -87,7 +87,6 @@ namespace std
|
||||||
using ::gid_t;
|
using ::gid_t;
|
||||||
using ::dev_t;
|
using ::dev_t;
|
||||||
using ::ino_t;
|
using ::ino_t;
|
||||||
using ::sig_atomic_t;
|
|
||||||
using ::pid_t;
|
using ::pid_t;
|
||||||
|
|
||||||
using ::socklen_t;
|
using ::socklen_t;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* nuttx/arch.h
|
* include/nuttx/arch.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
@ -152,7 +152,7 @@ EXTERN void up_initial_state(FAR _TCB *tcb);
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_CUSTOM_STACK
|
#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
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -177,7 +177,7 @@ EXTERN STATUS up_create_stack(FAR _TCB *tcb, size_t stack_size);
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_CUSTOM_STACK
|
#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
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/nuttx/fs.h
|
* 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>
|
* 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
|
||||||
|
@ -33,8 +33,8 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __NUTTX_FS_H
|
#ifndef __INCLUDE_NUTTX_FS_H
|
||||||
#define __NUTTX_FS_H
|
#define __INCLUDE_NUTTX_FS_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
|
@ -312,27 +312,27 @@ EXTERN void weak_function fs_initialize(void);
|
||||||
|
|
||||||
/* fs_registerdriver.c ******************************************************/
|
/* fs_registerdriver.c ******************************************************/
|
||||||
|
|
||||||
EXTERN STATUS register_driver(const char *path,
|
EXTERN int register_driver(const char *path,
|
||||||
const struct file_operations *fops,
|
const struct file_operations *fops,
|
||||||
mode_t mode, void *priv);
|
mode_t mode, void *priv);
|
||||||
|
|
||||||
/* fs_registerdriver.c ******************************************************/
|
/* fs_registerdriver.c ******************************************************/
|
||||||
|
|
||||||
EXTERN STATUS register_blockdriver(const char *path,
|
EXTERN int register_blockdriver(const char *path,
|
||||||
const struct block_operations *bops,
|
const struct block_operations *bops,
|
||||||
mode_t mode, void *priv);
|
mode_t mode, void *priv);
|
||||||
|
|
||||||
/* fs_unregisterdriver.c ****************************************************/
|
/* fs_unregisterdriver.c ****************************************************/
|
||||||
|
|
||||||
EXTERN STATUS unregister_driver(const char *path);
|
EXTERN int unregister_driver(const char *path);
|
||||||
|
|
||||||
/* fs_unregisterblockdriver.c ***********************************************/
|
/* fs_unregisterblockdriver.c ***********************************************/
|
||||||
|
|
||||||
EXTERN STATUS unregister_blockdriver(const char *path);
|
EXTERN int unregister_blockdriver(const char *path);
|
||||||
|
|
||||||
/* fs_open.c ****************************************************************/
|
/* 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 ***************************************************************/
|
/* fs_files.c ***************************************************************/
|
||||||
|
|
||||||
|
@ -429,4 +429,4 @@ EXTERN ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t off
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __NUTTX_FS_H */
|
#endif /* __INCLUDE_NUTTX_FS_H */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* include/sched.h
|
* 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>
|
* 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
|
||||||
|
@ -87,41 +87,41 @@ extern "C" {
|
||||||
/* Task Control Interfaces (non-standard) */
|
/* Task Control Interfaces (non-standard) */
|
||||||
|
|
||||||
#ifndef CONFIG_CUSTOM_STACK
|
#ifndef CONFIG_CUSTOM_STACK
|
||||||
EXTERN STATUS task_init(FAR _TCB *tcb, const char *name, int priority,
|
EXTERN int task_init(FAR _TCB *tcb, const char *name, int priority,
|
||||||
FAR uint32 *stack, uint32 stack_size,
|
FAR uint32 *stack, uint32 stack_size,
|
||||||
main_t entry, const char *argv[]);
|
main_t entry, const char *argv[]);
|
||||||
#else
|
#else
|
||||||
EXTERN STATUS task_init(FAR _TCB *tcb, const char *name, int priority,
|
EXTERN int task_init(FAR _TCB *tcb, const char *name, int priority,
|
||||||
main_t entry, const char *argv[]);
|
main_t entry, const char *argv[]);
|
||||||
#endif
|
#endif
|
||||||
EXTERN STATUS task_activate(FAR _TCB *tcb);
|
EXTERN int task_activate(FAR _TCB *tcb);
|
||||||
#ifndef CONFIG_CUSTOM_STACK
|
#ifndef CONFIG_CUSTOM_STACK
|
||||||
EXTERN int task_create(const char *name, int priority, int stack_size,
|
EXTERN int task_create(const char *name, int priority, int stack_size,
|
||||||
main_t entry, const char *argv[]);
|
main_t entry, const char *argv[]);
|
||||||
#else
|
#else
|
||||||
EXTERN int task_create(const char *name, int priority,
|
EXTERN int task_create(const char *name, int priority,
|
||||||
main_t entry, const char *argv[]);
|
main_t entry, const char *argv[]);
|
||||||
#endif
|
#endif
|
||||||
EXTERN STATUS task_delete(pid_t pid);
|
EXTERN int task_delete(pid_t pid);
|
||||||
EXTERN STATUS task_restart(pid_t pid);
|
EXTERN int task_restart(pid_t pid);
|
||||||
|
|
||||||
/* Task Scheduling Interfaces (based on POSIX APIs) */
|
/* Task Scheduling Interfaces (based on POSIX APIs) */
|
||||||
|
|
||||||
EXTERN int sched_setparam(pid_t pid, const struct sched_param *param);
|
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_getparam(pid_t pid, struct sched_param *param);
|
||||||
EXTERN int sched_setscheduler(pid_t pid, int policy,
|
EXTERN int sched_setscheduler(pid_t pid, int policy,
|
||||||
const struct sched_param *param);
|
const struct sched_param *param);
|
||||||
EXTERN int sched_getscheduler(pid_t pid);
|
EXTERN int sched_getscheduler(pid_t pid);
|
||||||
EXTERN int sched_yield(void);
|
EXTERN int sched_yield(void);
|
||||||
EXTERN int sched_get_priority_max(int policy);
|
EXTERN int sched_get_priority_max(int policy);
|
||||||
EXTERN int sched_get_priority_min(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_rr_get_interval(pid_t pid, struct timespec *interval);
|
||||||
|
|
||||||
/* Task Switching Interfaces (non-standard) */
|
/* Task Switching Interfaces (non-standard) */
|
||||||
|
|
||||||
EXTERN STATUS sched_lock(void);
|
EXTERN int sched_lock(void);
|
||||||
EXTERN STATUS sched_unlock(void);
|
EXTERN int sched_unlock(void);
|
||||||
EXTERN sint32 sched_lockcount(void);
|
EXTERN sint32 sched_lockcount(void);
|
||||||
|
|
||||||
/* If instrumentation of the scheduler is enabled, then some
|
/* If instrumentation of the scheduler is enabled, then some
|
||||||
* outboard logic must provide the following interfaces.
|
* outboard logic must provide the following interfaces.
|
||||||
|
@ -129,9 +129,9 @@ EXTERN sint32 sched_lockcount(void);
|
||||||
|
|
||||||
#ifdef CONFIG_SCHED_INSTRUMENTATION
|
#ifdef CONFIG_SCHED_INSTRUMENTATION
|
||||||
|
|
||||||
EXTERN void sched_note_start(FAR _TCB *tcb );
|
EXTERN void sched_note_start(FAR _TCB *tcb );
|
||||||
EXTERN void sched_note_stop(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_switch(FAR _TCB *pFromTcb, FAR _TCB *pToTcb);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# define sched_note_start(t)
|
# define sched_note_start(t)
|
||||||
|
|
|
@ -107,30 +107,61 @@ typedef double float64;
|
||||||
|
|
||||||
/* Misc. scalar types */
|
/* Misc. scalar types */
|
||||||
|
|
||||||
typedef unsigned int mode_t; /* Needs at least 16-bits but must be */
|
/* mode_t is an integer type used for file attributes. mode_t needs
|
||||||
/* sizeof(int) because it is passed */
|
* to be at least 16-bits but, in fact must be sizeof(int) because it is
|
||||||
/* via varargs. */
|
* 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
|
#ifdef CONFIG_SMALL_MEMORY
|
||||||
typedef uint16 size_t;
|
typedef uint16 size_t;
|
||||||
typedef sint16 ssize_t;
|
typedef sint16 ssize_t;
|
||||||
typedef sint16 off_t;
|
|
||||||
typedef uint16 blksize_t;
|
|
||||||
typedef uint16 blkcnt_t;
|
|
||||||
#else
|
#else
|
||||||
typedef uint32 size_t;
|
typedef uint32 size_t;
|
||||||
typedef sint32 ssize_t;
|
typedef sint32 ssize_t;
|
||||||
typedef sint32 off_t;
|
|
||||||
typedef uint16 blksize_t;
|
|
||||||
typedef uint32 blkcnt_t;
|
|
||||||
#endif
|
#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 uid_t;
|
||||||
typedef sint16 gid_t;
|
typedef sint16 gid_t;
|
||||||
|
|
||||||
|
/* dev_t is used for device IDs */
|
||||||
|
|
||||||
typedef uint16 dev_t;
|
typedef uint16 dev_t;
|
||||||
|
|
||||||
|
/* ino_t is used for file serial numbers */
|
||||||
|
|
||||||
typedef uint16 ino_t;
|
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 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 unsigned int socklen_t;
|
||||||
typedef uint16 sa_family_t;
|
typedef uint16 sa_family_t;
|
||||||
|
|
|
@ -98,10 +98,9 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EXTERN WDOG_ID wd_create(void);
|
EXTERN WDOG_ID wd_create(void);
|
||||||
EXTERN STATUS wd_delete(WDOG_ID wdog);
|
EXTERN int wd_delete(WDOG_ID wdog);
|
||||||
EXTERN STATUS wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry,
|
EXTERN int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...);
|
||||||
int argc, ...);
|
EXTERN int wd_cancel(WDOG_ID wdog);
|
||||||
EXTERN STATUS wd_cancel(WDOG_ID wdog);
|
|
||||||
EXTERN int wd_gettime(WDOG_ID wdog);
|
EXTERN int wd_gettime(WDOG_ID wdog);
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* lib/lib_fgetpos.c
|
* 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>
|
* 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
|
||||||
|
@ -118,6 +118,6 @@ int fgetpos(FAR FILE *stream, FAR fpos_t *pos)
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
*pos = (fpos_t)pos;
|
*pos = (fpos_t)position;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,11 +239,11 @@ extern const tasklist_t g_tasklisttable[NUM_TASK_STATES];
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
extern void task_start(void);
|
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);
|
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[]);
|
const char *argv[]);
|
||||||
extern STATUS task_deletecurrent(void);
|
extern int task_deletecurrent(void);
|
||||||
|
|
||||||
extern boolean sched_addreadytorun(FAR _TCB *rtrtcb);
|
extern boolean sched_addreadytorun(FAR _TCB *rtrtcb);
|
||||||
extern boolean sched_removereadytorun(FAR _TCB *rtrtcb);
|
extern boolean sched_removereadytorun(FAR _TCB *rtrtcb);
|
||||||
|
|
|
@ -247,7 +247,7 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
|
||||||
{
|
{
|
||||||
FAR _TCB *ptcb;
|
FAR _TCB *ptcb;
|
||||||
FAR join_t *pjoin;
|
FAR join_t *pjoin;
|
||||||
STATUS status;
|
int status;
|
||||||
int priority;
|
int priority;
|
||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
int policy;
|
int policy;
|
||||||
|
|
|
@ -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>
|
* 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>
|
||||||
|
@ -44,35 +44,35 @@
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include "os_internal.h"
|
#include "os_internal.h"
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Private Type Declarations
|
* Private Type Declarations
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Global Variables
|
* Global Variables
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Private Variables
|
* Private Variables
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Private Function Prototypes
|
* Private Function Prototypes
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Private Functionss
|
* Private Functionss
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Name: sched_lock
|
* Name: sched_lock
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
@ -89,9 +89,9 @@
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* OK on success; ERROR on failure
|
* OK on success; ERROR on failure
|
||||||
*
|
*
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
STATUS sched_lock(void)
|
int sched_lock(void)
|
||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
|
|
||||||
|
|
|
@ -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>
|
* 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,46 +31,46 @@
|
||||||
* 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>
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include "os_internal.h"
|
#include "os_internal.h"
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Private Type Declarations
|
* Private Type Declarations
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Global Variables
|
* Global Variables
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Private Variables
|
* Private Variables
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Private Function Prototypes
|
* Private Function Prototypes
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Private Functionss
|
* Private Functionss
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************************
|
||||||
* Name: sched_unlock
|
* Name: sched_unlock
|
||||||
*
|
*
|
||||||
* Description: This function decrements the preemption lock
|
* Description: This function decrements the preemption lock
|
||||||
|
@ -80,9 +80,9 @@
|
||||||
* times as sched_lock(). When the lockcount is decremented
|
* times as sched_lock(). When the lockcount is decremented
|
||||||
* to zero, any tasks that were eligible to preempt the
|
* to zero, any tasks that were eligible to preempt the
|
||||||
* current task will execute.
|
* current task will execute.
|
||||||
************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
STATUS sched_unlock(void)
|
int sched_unlock(void)
|
||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
int sem_post(FAR sem_t *sem)
|
int sem_post(FAR sem_t *sem)
|
||||||
{
|
{
|
||||||
FAR _TCB *stcb = NULL;
|
FAR _TCB *stcb = NULL;
|
||||||
STATUS ret = ERROR;
|
int ret = ERROR;
|
||||||
irqstate_t saved_state;
|
irqstate_t saved_state;
|
||||||
|
|
||||||
/* Make sure we were supplied with a valid semaphore. */
|
/* Make sure we were supplied with a valid semaphore. */
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS task_activate(FAR _TCB *tcb)
|
int task_activate(FAR _TCB *tcb)
|
||||||
{
|
{
|
||||||
irqstate_t flags = irqsave();
|
irqstate_t flags = irqsave();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* task_create.c
|
* sched/task_create.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
@ -116,7 +116,7 @@ int task_create(const char *name, int priority,
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
FAR _TCB *tcb;
|
FAR _TCB *tcb;
|
||||||
STATUS status;
|
int status;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
/* Allocate a TCB for the new task. */
|
/* Allocate a TCB for the new task. */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* sched/task_delete.c
|
* 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>
|
* 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
|
||||||
|
@ -93,12 +93,12 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS task_delete(pid_t pid)
|
int task_delete(pid_t pid)
|
||||||
{
|
{
|
||||||
FAR _TCB *rtcb;
|
FAR _TCB *rtcb;
|
||||||
FAR _TCB *dtcb;
|
FAR _TCB *dtcb;
|
||||||
irqstate_t saved_state;
|
irqstate_t saved_state;
|
||||||
STATUS ret = ERROR;
|
int ret = ERROR;
|
||||||
|
|
||||||
/* Check if the task to delete is the calling task */
|
/* Check if the task to delete is the calling task */
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* sched/task_deletecurrent.c
|
* 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>
|
* 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
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS task_deletecurrent(void)
|
int task_deletecurrent(void)
|
||||||
{
|
{
|
||||||
FAR _TCB *dtcb = (FAR _TCB*)g_readytorun.head;
|
FAR _TCB *dtcb = (FAR _TCB*)g_readytorun.head;
|
||||||
FAR _TCB *rtcb;
|
FAR _TCB *rtcb;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* task_init.c
|
* sched/task_init.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
@ -108,15 +108,15 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_CUSTOM_STACK
|
#ifndef CONFIG_CUSTOM_STACK
|
||||||
STATUS task_init(FAR _TCB *tcb, const char *name, int priority,
|
int task_init(FAR _TCB *tcb, const char *name, int priority,
|
||||||
FAR uint32 *stack, uint32 stack_size,
|
FAR uint32 *stack, uint32 stack_size,
|
||||||
main_t entry, const char *argv[])
|
main_t entry, const char *argv[])
|
||||||
#else
|
#else
|
||||||
STATUS task_init(FAR _TCB *tcb, const char *name, int priority,
|
int task_init(FAR _TCB *tcb, const char *name, int priority,
|
||||||
main_t entry, const char *argv[])
|
main_t entry, const char *argv[])
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
STATUS ret;
|
int ret;
|
||||||
|
|
||||||
/* Associate file descriptors with the new task */
|
/* Associate file descriptors with the new task */
|
||||||
|
|
||||||
|
|
|
@ -96,11 +96,11 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS task_restart(pid_t pid)
|
int task_restart(pid_t pid)
|
||||||
{
|
{
|
||||||
FAR _TCB *rtcb;
|
FAR _TCB *rtcb;
|
||||||
FAR _TCB *tcb;
|
FAR _TCB *tcb;
|
||||||
STATUS status;
|
int status;
|
||||||
irqstate_t state;
|
irqstate_t state;
|
||||||
|
|
||||||
/* Make sure this task does not become ready-to-run while
|
/* Make sure this task does not become ready-to-run while
|
||||||
|
|
|
@ -70,7 +70,7 @@ static const char g_noname[] = "<noname>";
|
||||||
* Private Function Prototypes
|
* Private Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static STATUS task_assignpid(FAR _TCB* tcb);
|
static int task_assignpid(FAR _TCB* tcb);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* 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;
|
pid_t next_pid;
|
||||||
int hash_ndx;
|
int hash_ndx;
|
||||||
|
@ -207,10 +207,9 @@ static inline void task_dupdspace(FAR _TCB *tcb)
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS task_schedsetup(FAR _TCB *tcb, int priority,
|
int task_schedsetup(FAR _TCB *tcb, int priority, start_t start, main_t main)
|
||||||
start_t start, main_t main)
|
|
||||||
{
|
{
|
||||||
STATUS ret;
|
int ret;
|
||||||
|
|
||||||
/* Assign a unique task ID to the task. */
|
/* 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;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* wd_cancel.c
|
* sched/wd_cancel.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* 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 *curr;
|
||||||
wdog_t *prev;
|
wdog_t *prev;
|
||||||
irqstate_t saved_state;
|
irqstate_t saved_state;
|
||||||
STATUS ret = ERROR;
|
int ret = ERROR;
|
||||||
|
|
||||||
/* Prohibit timer interactions with the timer queue until the
|
/* Prohibit timer interactions with the timer queue until the
|
||||||
* cancellation is complete
|
* cancellation is complete
|
||||||
|
|
|
@ -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>
|
* 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
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
STATUS wd_delete(WDOG_ID wdId)
|
int wd_delete(WDOG_ID wdId)
|
||||||
{
|
{
|
||||||
irqstate_t saved_state;
|
irqstate_t saved_state;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
va_list ap;
|
||||||
FAR wdog_t *curr;
|
FAR wdog_t *curr;
|
||||||
|
|
Loading…
Reference in a new issue