Rename _TCB to struct tcb_s

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5610 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2013-02-04 18:46:28 +00:00
parent 5475d02446
commit b48009644f
293 changed files with 836 additions and 839 deletions

View file

@ -4121,4 +4121,7 @@
the task group structures. Now all message queues opened by the task group structures. Now all message queues opened by
members of the group are closed when the last member of the group members of the group are closed when the last member of the group
exits. exits.
* includes/nuttx/sched.h and Lots of files: Change name of _TCB to
struct tcb_s so that (1) it is consitent with other NuttX naming and
so that (2) the naming can handle some upcoming changes.

View file

@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4"> <tr align="center" bgcolor="#e4e4e4">
<td> <td>
<h1><big><font color="#3c34ec"><i>On-Demand Paging</i></font></big></h1> <h1><big><font color="#3c34ec"><i>On-Demand Paging</i></font></big></h1>
<p>Last Updated: August 12, 2010</p> <p>Last Updated: February 4, 2010</p>
</td> </td>
</tr> </tr>
</table> </table>
@ -306,7 +306,7 @@
</p> </p>
<p> <p>
The page fill worker thread will maintain a static variable called <code>_TCB *g_pftcb</code>. The page fill worker thread will maintain a static variable called <code>struct tcb_s *g_pftcb</code>.
If no fill is in progress, <code>g_pftcb</code> will be NULL. If no fill is in progress, <code>g_pftcb</code> will be NULL.
Otherwise, it will point to the TCB of the task which is receiving the fill that is in progess. Otherwise, it will point to the TCB of the task which is receiving the fill that is in progess.
</p> </p>
@ -619,7 +619,7 @@
</p> </p>
<ul><dl> <ul><dl>
<dt> <dt>
<code>void up_block_task(FAR _TCB *tcb, tstate_t task_state);</code> <code>void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state);</code>
</dt> </dt>
<dd> <dd>
The currently executing task at the head of the ready to run list must be stopped. The currently executing task at the head of the ready to run list must be stopped.
@ -628,7 +628,7 @@
page fill, and to page fill, and to
</dd> </dd>
<dt> <dt>
<code>void up_unblock_task(FAR _TCB *tcb);</code> <code>void up_unblock_task(FAR struct tcb_s *tcb);</code>
</dt> </dt>
<dd> <dd>
A task is currently in an inactive task list but has been prepped to execute. A task is currently in an inactive task list but has been prepped to execute.
@ -643,7 +643,7 @@
<ul><dl> <ul><dl>
<dt> <dt>
<code>int up_checkmapping(FAR _TCB *tcb);</code> <code>int up_checkmapping(FAR struct tcb_s *tcb);</code>
</dt> </dt>
<dd> <dd>
The function <code>up_checkmapping()</code> returns an indication if the page fill still needs to performed or not. The function <code>up_checkmapping()</code> returns an indication if the page fill still needs to performed or not.
@ -651,7 +651,7 @@
This function will prevent the same page from be filled multiple times. This function will prevent the same page from be filled multiple times.
</dd> </dd>
<dt> <dt>
<code>int up_allocpage(FAR _TCB *tcb, FAR void *vpage);</code> <code>int up_allocpage(FAR struct tcb_s *tcb, FAR void *vpage);</code>
</dt> </dt>
<dd> <dd>
This architecture-specific function will set aside page in memory and map to its correct virtual address. This architecture-specific function will set aside page in memory and map to its correct virtual address.
@ -661,7 +661,7 @@
NOTE: This function must <i>always</i> return a page allocation. NOTE: This function must <i>always</i> return a page allocation.
If all available pages are in-use (the typical case), then this function will select a page in-use, un-map it, and make it available. If all available pages are in-use (the typical case), then this function will select a page in-use, un-map it, and make it available.
</dd> </dd>
<dt><code>int up_fillpage(FAR _TCB *tcb, FAR const void *vpage, void (*pg_callback)(FAR _TCB *tcb, int result));</code> <dt><code>int up_fillpage(FAR struct tcb_s *tcb, FAR const void *vpage, void (*pg_callback)(FAR struct tcb_s *tcb, int result));</code>
</dt> </dt>
The actual filling of the page with data from the non-volatile, must be performed by a separate call to the architecture-specific function, <code>up_fillpage()</code>. The actual filling of the page with data from the non-volatile, must be performed by a separate call to the architecture-specific function, <code>up_fillpage()</code>.
This will start asynchronous page fill. This will start asynchronous page fill.

View file

@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec"> <h1><big><font color="#3c34ec">
<i>NuttX RTOS Porting Guide</i> <i>NuttX RTOS Porting Guide</i>
</font></big></h1> </font></big></h1>
<p>Last Updated: January 23, 2013</p> <p>Last Updated: February 4, 2013</p>
</td> </td>
</tr> </tr>
</table> </table>
@ -1590,7 +1590,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
</p> </p>
<h3><a name="upinitialstate">4.1.3 <code>up_initial_state()</code></a></h3> <h3><a name="upinitialstate">4.1.3 <code>up_initial_state()</code></a></h3>
<p><b>Prototype</b>: <code>void up_initial_state(FAR _TCB *tcb);</code></p> <p><b>Prototype</b>: <code>void up_initial_state(FAR struct tcb_s *tcb);</code></p>
<p><b>Description</b>. <p><b>Description</b>.
A new thread is being started and a new TCB has been created. A new thread is being started and a new TCB has been created.
@ -1613,7 +1613,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
</p> </p>
<h3><a name="upcreatestack">4.1.4 <code>up_create_stack()</code></a></h3> <h3><a name="upcreatestack">4.1.4 <code>up_create_stack()</code></a></h3>
<p><b>Prototype</b>: <code>STATUS up_create_stack(FAR _TCB *tcb, size_t stack_size);</code></p> <p><b>Prototype</b>: <code>STATUS up_create_stack(FAR struct tcb_s *tcb, size_t stack_size);</code></p>
<p><b>Description</b>. <p><b>Description</b>.
Allocate a stack for a new thread and setup Allocate a stack for a new thread and setup
@ -1648,7 +1648,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
<h3><a name="upusestack">4.1.5 <code>up_use_stack()</code></a></h3> <h3><a name="upusestack">4.1.5 <code>up_use_stack()</code></a></h3>
<p><b>Prototype</b>: <p><b>Prototype</b>:
<code>STATUS up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size);</code> <code>STATUS up_use_stack(FAR struct tcb_s *tcb, FAR void *stack, size_t stack_size);</code>
</p> </p>
<p><b>Description</b>. <p><b>Description</b>.
@ -1682,7 +1682,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
</ul> </ul>
<h3><a name="upreleasestack">4.1.6 <code>up_release_stack()</code></a></h3> <h3><a name="upreleasestack">4.1.6 <code>up_release_stack()</code></a></h3>
<p><b>Prototype</b>: <code>void up_release_stack(FAR _TCB *dtcb);</code></p> <p><b>Prototype</b>: <code>void up_release_stack(FAR struct tcb_s *dtcb);</code></p>
<p><b>Description</b>. <p><b>Description</b>.
A task has been stopped. Free all stack A task has been stopped. Free all stack
@ -1694,7 +1694,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
</p> </p>
<h3><a name="upunblocktask">4.1.7 <code>up_unblock_task()</code></a></h3> <h3><a name="upunblocktask">4.1.7 <code>up_unblock_task()</code></a></h3>
<p><b>Prototype</b>: <code>void up_unblock_task(FAR _TCB *tcb);</code></p> <p><b>Prototype</b>: <code>void up_unblock_task(FAR struct tcb_s *tcb);</code></p>
<p><b>Description</b>. <p><b>Description</b>.
A task is currently in an inactive task list A task is currently in an inactive task list
@ -1717,7 +1717,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
</ul> </ul>
<h3><a name="upblocktask">4.1.8 <code>up_block_task()</code></a></h3> <h3><a name="upblocktask">4.1.8 <code>up_block_task()</code></a></h3>
<p><b>Prototype</b>: <code>void up_block_task(FAR _TCB *tcb, tstate_t task_state);</code></p> <p><b>Prototype</b>: <code>void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state);</code></p>
<p><b>Description</b>. <p><b>Description</b>.
The currently executing task at the head of The currently executing task at the head of
@ -1760,7 +1760,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
</p> </p>
<h3><a name="upreprioritizertr">4.1.10 <code>up_reprioritize_rtr()</code></a></h3> <h3><a name="upreprioritizertr">4.1.10 <code>up_reprioritize_rtr()</code></a></h3>
<p><b>Prototype</b>: <code>void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority);</code></p> <p><b>Prototype</b>: <code>void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority);</code></p>
<p><b>Description</b>. <p><b>Description</b>.
Called when the priority of a running or Called when the priority of a running or
@ -1821,7 +1821,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
<h3><a name="upschedulesigaction">4.1.13 <code>up_schedule_sigaction()</code></a></h3> <h3><a name="upschedulesigaction">4.1.13 <code>up_schedule_sigaction()</code></a></h3>
<p><b>Prototype</b>: <p><b>Prototype</b>:
<code>void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver);</code> <code>void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver);</code>
</p> </p>
<p><b>Description</b>. <p><b>Description</b>.
@ -2297,7 +2297,7 @@ else
<h4><a name="up_addrenv_assign">4.1.21.6 <code>up_addrenv_assign()</code></a></h4> <h4><a name="up_addrenv_assign">4.1.21.6 <code>up_addrenv_assign()</code></a></h4>
<p><b>Prototype</b>:<p> <p><b>Prototype</b>:<p>
<ul> <ul>
<code>int up_addrenv_assign(task_addrenv_t addrenv, FAR _TCB *tcb);</code> <code>int up_addrenv_assign(task_addrenv_t addrenv, FAR struct tcb_s *tcb);</code>
</ul> </ul>
<p><b>Description</b>:</p> <p><b>Description</b>:</p>
<ul> <ul>
@ -2316,7 +2316,7 @@ else
<h4><a name="up_addrenv_share">4.1.21.7 <code>up_addrenv_share()</code></a></h4> <h4><a name="up_addrenv_share">4.1.21.7 <code>up_addrenv_share()</code></a></h4>
<p><b>Prototype</b>:<p> <p><b>Prototype</b>:<p>
<ul> <ul>
<code>int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb);</code> <code>int up_addrenv_share(FAR const struct tcb_s *ptcb, FAR struct tcb_s *ctcb);</code>
</ul> </ul>
<p><b>Description</b>:</p> <p><b>Description</b>:</p>
<ul> <ul>
@ -2336,7 +2336,7 @@ else
<h4><a name="up_addrenv_release">4.1.21.8 <code>up_addrenv_release()</code></a></h4> <h4><a name="up_addrenv_release">4.1.21.8 <code>up_addrenv_release()</code></a></h4>
<p><b>Prototype</b>:<p> <p><b>Prototype</b>:<p>
<ul> <ul>
<code>int up_addrenv_release(FAR _TCB *tcb);</code> <code>int up_addrenv_release(FAR struct tcb_s *tcb);</code>
</ul> </ul>
<p><b>Description</b>:</p> <p><b>Description</b>:</p>
<ul> <ul>

View file

@ -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: February 2, 2013</p> <p>Last Updated: February 4, 2013</p>
</td> </td>
</tr> </tr>
</table> </table>
@ -342,7 +342,7 @@ VxWorks provides the following similar interface:
<b>Function Prototype:</b> <b>Function Prototype:</b>
<pre> <pre>
#include &lt;sched.h&gt; #include &lt;sched.h&gt;
int task_init(_TCB *tcb, char *name, int priority, uint32_t *stack, uint32_t stack_size, int task_init(struct tcb_s *tcb, char *name, int priority, uint32_t *stack, uint32_t stack_size,
maint_t entry, char * const argv[]); maint_t entry, char * const argv[]);
</pre> </pre>
@ -414,7 +414,7 @@ VxWorks provides the following similar interface:
<b>Function Prototype:</b> <b>Function Prototype:</b>
<pre> <pre>
#include &lt;sched.h&gt; #include &lt;sched.h&gt;
int task_activate(_TCB *tcb); int task_activate(struct tcb_s *tcb);
</pre> </pre>
<p> <p>
@ -9188,7 +9188,7 @@ From the standpoint of the application, these structures (and
structure pointers) should be treated as simple handles to reference structure pointers) should be treated as simple handles to reference
OS resources. These hidden structures include: OS resources. These hidden structures include:
<ul> <ul>
<li>_TCB <li>struct tcb_s
<li>mqd_t <li>mqd_t
<li>sem_t <li>sem_t
<li>WDOG_ID <li>WDOG_ID

4
TODO
View file

@ -198,8 +198,8 @@ o Task/Scheduler (sched/)
bug-for-bug compatibility, the same errno should be shared by bug-for-bug compatibility, the same errno should be shared by
the task and each thread that it creates. It is *very* easy the task and each thread that it creates. It is *very* easy
to make this change: Just move the pterrno field from to make this change: Just move the pterrno field from
_TCB to struct task_group_s. However, I am still not sure struct tcb_s to struct task_group_s. However, I am still not
if this should be done or not. sure if this should be done or not.
Status: Closed. The existing solution is better (although its Status: Closed. The existing solution is better (although its
incompatibilities could show up in porting some code). incompatibilities could show up in porting some code).
Priority: Low Priority: Low

View file

@ -70,7 +70,7 @@ static void _up_assert(int errorcode)
{ {
/* Are we in an interrupt handler or the idle task? */ /* Are we in an interrupt handler or the idle task? */
if (g_irqtos || ((FAR _TCB*)g_readytorun.head)->pid == 0) if (g_irqtos || ((FAR struct tcb_s*)g_readytorun.head)->pid == 0)
{ {
(void)irqsave(); (void)irqsave();
for(;;) for(;;)
@ -100,7 +100,7 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno) void up_assert(const uint8_t *filename, int lineno)
{ {
#if CONFIG_TASK_NAME_SIZE > 0 #if CONFIG_TASK_NAME_SIZE > 0
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
@ -124,7 +124,7 @@ void up_assert(const uint8_t *filename, int lineno)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode) void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{ {
#if CONFIG_TASK_NAME_SIZE > 0 #if CONFIG_TASK_NAME_SIZE > 0
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);

View file

@ -83,7 +83,7 @@
* *
************************************************************************/ ************************************************************************/
void up_block_task(FAR _TCB *tcb, tstate_t task_state) void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -94,7 +94,7 @@ void up_block_task(FAR _TCB *tcb, tstate_t task_state)
} }
else else
{ {
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
dbg("Blocking TCB=%p\n", tcb); dbg("Blocking TCB=%p\n", tcb);
@ -139,7 +139,7 @@ void up_block_task(FAR _TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (FAR _TCB*)g_readytorun.head; rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb); dbg("New Active Task TCB=%p\n", rtcb);
/* Then setup so that the context will be performed on exit /* Then setup so that the context will be performed on exit
@ -160,7 +160,7 @@ void up_block_task(FAR _TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (FAR _TCB*)g_readytorun.head; rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb); dbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -77,7 +77,7 @@
void _exit(int status) void _exit(int status)
{ {
FAR _TCB* tcb; FAR struct tcb_s* tcb;
dbg("TCB=%p exitting\n", tcb); dbg("TCB=%p exitting\n", tcb);
@ -95,7 +95,7 @@ void _exit(int status)
* head of the list. * head of the list.
*/ */
tcb = (FAR _TCB*)g_readytorun.head; tcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", tcb); dbg("New Active Task TCB=%p\n", tcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -68,7 +68,7 @@ volatile uint8_t g_irqtos;
* during the interrupt handling, these registers will be * during the interrupt handling, these registers will be
* copied into the TCB again (NOTE: We could save a copy * copied into the TCB again (NOTE: We could save a copy
* if the interrupt handling logic saved the registers * if the interrupt handling logic saved the registers
* directly into (_TCB*)g_readytorun.head->xcp.regs). * directly into (struct tcb_s*)g_readytorun.head->xcp.regs).
*/ */
uint8_t g_irqregs[REGS_SIZE]; uint8_t g_irqregs[REGS_SIZE];

View file

@ -74,7 +74,7 @@
* *
************************************************************************/ ************************************************************************/
void up_initial_state(FAR _TCB *tcb) void up_initial_state(FAR struct tcb_s *tcb)
{ {
FAR uint8_t *frame = tcb->xcp.stack; FAR uint8_t *frame = tcb->xcp.stack;
FAR uint8_t *regs = tcb->xcp.regs; FAR uint8_t *regs = tcb->xcp.regs;

View file

@ -79,7 +79,7 @@ extern volatile uint8_t g_irqtos;
* during the interrupt handling, these registers will be * during the interrupt handling, these registers will be
* copied into the TCB again (NOTE: We could save a copy * copied into the TCB again (NOTE: We could save a copy
* if the interrupt handling logic saved the registers * if the interrupt handling logic saved the registers
* directly into (_TCB*)g_readytorun.head->xcp.regs). * directly into (struct tcb_s*)g_readytorun.head->xcp.regs).
*/ */
extern uint8_t g_irqregs[REGS_SIZE]; extern uint8_t g_irqregs[REGS_SIZE];

View file

@ -76,7 +76,7 @@
void up_release_pending(void) void up_release_pending(void)
{ {
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("From TCB=%p\n", rtcb); dbg("From TCB=%p\n", rtcb);
@ -102,7 +102,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (FAR _TCB*)g_readytorun.head; rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb); dbg("New Active Task TCB=%p\n", rtcb);
/* Then setup so that the context will be performed on exit /* Then setup so that the context will be performed on exit
@ -124,7 +124,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (FAR _TCB*)g_readytorun.head; rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb); dbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -85,7 +85,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority) void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority)
{ {
/* Verify that the caller is sane */ /* Verify that the caller is sane */
@ -103,7 +103,7 @@ void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority)
} }
else else
{ {
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
dbg("TCB=%p PRI=%d\n", tcb, priority); dbg("TCB=%p PRI=%d\n", tcb, priority);
@ -157,7 +157,7 @@ void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (FAR _TCB*)g_readytorun.head; rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb); dbg("New Active Task TCB=%p\n", rtcb);
/* Then setup so that the context will be performed on exit /* Then setup so that the context will be performed on exit
@ -178,7 +178,7 @@ void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (FAR _TCB*)g_readytorun.head; rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb); dbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -80,7 +80,7 @@
* *
************************************************************************/ ************************************************************************/
void up_unblock_task(FAR _TCB *tcb) void up_unblock_task(FAR struct tcb_s *tcb)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -91,7 +91,7 @@ void up_unblock_task(FAR _TCB *tcb)
} }
else else
{ {
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("Unblocking TCB=%p\n", tcb); dbg("Unblocking TCB=%p\n", tcb);
@ -131,7 +131,7 @@ void up_unblock_task(FAR _TCB *tcb)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (FAR _TCB*)g_readytorun.head; rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb); dbg("New Active Task TCB=%p\n", rtcb);
/* Then setup so that the context will be performed on exit /* Then setup so that the context will be performed on exit
@ -154,7 +154,7 @@ void up_unblock_task(FAR _TCB *tcb)
* g_readytorun task list. * g_readytorun task list.
*/ */
rtcb = (FAR _TCB*)g_readytorun.head; rtcb = (FAR struct tcb_s*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb); dbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -165,7 +165,7 @@ static bool g_pgwrap;
* *
****************************************************************************/ ****************************************************************************/
int up_allocpage(FAR _TCB *tcb, FAR void **vpage) int up_allocpage(FAR struct tcb_s *tcb, FAR void **vpage)
{ {
uintptr_t vaddr; uintptr_t vaddr;
uintptr_t paddr; uintptr_t paddr;

View file

@ -161,7 +161,7 @@ static inline void up_registerdump(void)
#ifdef CONFIG_ARCH_STACKDUMP #ifdef CONFIG_ARCH_STACKDUMP
static void up_dumpstate(void) static void up_dumpstate(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint32_t sp = up_getsp(); uint32_t sp = up_getsp();
uint32_t ustackbase; uint32_t ustackbase;
uint32_t ustacksize; uint32_t ustacksize;
@ -257,7 +257,7 @@ static void _up_assert(int errorcode)
{ {
/* Are we in an interrupt handler or the idle task? */ /* Are we in an interrupt handler or the idle task? */
if (current_regs || ((_TCB*)g_readytorun.head)->pid == 0) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0)
{ {
(void)irqsave(); (void)irqsave();
for(;;) for(;;)
@ -287,7 +287,7 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno) void up_assert(const uint8_t *filename, int lineno)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
@ -309,7 +309,7 @@ void up_assert(const uint8_t *filename, int lineno)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode) void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_block_task(_TCB *tcb, tstate_t task_state) void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -95,7 +95,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@ -138,7 +138,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -156,7 +156,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -97,7 +97,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkmapping(FAR _TCB *tcb) bool up_checkmapping(FAR struct tcb_s *tcb)
{ {
uintptr_t vaddr; uintptr_t vaddr;
uint32_t *pte; uint32_t *pte;

View file

@ -102,9 +102,9 @@
#ifdef CONFIG_PAGING #ifdef CONFIG_PAGING
void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr) void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
{ {
FAR _TCB *tcb = (FAR _TCB *)g_readytorun.head; FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head;
#ifdef CONFIG_PAGING #ifdef CONFIG_PAGING
uint32_t *savestate; uint32_t *savestate;
/* Save the saved processor context in current_regs where it can be accessed /* Save the saved processor context in current_regs where it can be accessed
* for register dumps and possibly context switching. * for register dumps and possibly context switching.

View file

@ -78,7 +78,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_initial_state(_TCB *tcb) void up_initial_state(struct tcb_s *tcb)
{ {
struct xcptcontext *xcp = &tcb->xcp; struct xcptcontext *xcp = &tcb->xcp;
uint32_t cpsr; uint32_t cpsr;

View file

@ -121,7 +121,7 @@ void up_prefetchabort(uint32_t *regs)
* prefetch and data aborts. * prefetch and data aborts.
*/ */
FAR _TCB *tcb = (FAR _TCB *)g_readytorun.head; FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head;
tcb->xcp.far = regs[REG_R15]; tcb->xcp.far = regs[REG_R15];
/* Call pg_miss() to schedule the page fill. A consequences of this /* Call pg_miss() to schedule the page fill. A consequences of this

View file

@ -75,7 +75,7 @@
void up_release_pending(void) void up_release_pending(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("From TCB=%p\n", rtcb); slldbg("From TCB=%p\n", rtcb);
@ -101,7 +101,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -121,7 +121,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_reprioritize_rtr(_TCB *tcb, uint8_t priority) void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
{ {
/* Verify that the caller is sane */ /* Verify that the caller is sane */
@ -102,7 +102,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority); slldbg("TCB=%p PRI=%d\n", tcb, priority);
@ -156,7 +156,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -175,7 +175,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -101,7 +101,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{ {
/* Refuse to handle nested signal actions */ /* Refuse to handle nested signal actions */
@ -121,7 +121,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
if (tcb == (_TCB*)g_readytorun.head) if (tcb == (struct tcb_s*)g_readytorun.head)
{ {
/* CASE 1: We are not in an interrupt handler and /* CASE 1: We are not in an interrupt handler and
* a task is signalling itself for some reason. * a task is signalling itself for some reason.

View file

@ -81,7 +81,7 @@
void up_sigdeliver(void) void up_sigdeliver(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint32_t regs[XCPTCONTEXT_REGS]; uint32_t regs[XCPTCONTEXT_REGS];
sig_deliver_t sigdeliver; sig_deliver_t sigdeliver;

View file

@ -79,7 +79,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_unblock_task(_TCB *tcb) void up_unblock_task(struct tcb_s *tcb)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -90,7 +90,7 @@ void up_unblock_task(_TCB *tcb)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@ -128,7 +128,7 @@ void up_unblock_task(_TCB *tcb)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -148,7 +148,7 @@ void up_unblock_task(_TCB *tcb)
* g_readytorun task list. * g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -167,8 +167,8 @@ static inline void up_registerdump(void)
#ifdef CONFIG_ARCH_STACKDUMP #ifdef CONFIG_ARCH_STACKDUMP
static void up_dumpstate(void) static void up_dumpstate(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint32_t sp = up_getsp(); uint32_t sp = up_getsp();
uint32_t ustackbase; uint32_t ustackbase;
uint32_t ustacksize; uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3 #if CONFIG_ARCH_INTERRUPTSTACK > 3
@ -272,7 +272,7 @@ static void _up_assert(int errorcode)
{ {
/* Are we in an interrupt handler or the idle task? */ /* Are we in an interrupt handler or the idle task? */
if (current_regs || ((_TCB*)g_readytorun.head)->pid == 0) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0)
{ {
(void)irqsave(); (void)irqsave();
for(;;) for(;;)
@ -302,7 +302,7 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno) void up_assert(const uint8_t *filename, int lineno)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
@ -324,7 +324,7 @@ void up_assert(const uint8_t *filename, int lineno)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode) void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_block_task(_TCB *tcb, tstate_t task_state) void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -95,7 +95,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@ -138,7 +138,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -153,7 +153,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -81,7 +81,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_initial_state(_TCB *tcb) void up_initial_state(struct tcb_s *tcb)
{ {
struct xcptcontext *xcp = &tcb->xcp; struct xcptcontext *xcp = &tcb->xcp;

View file

@ -75,7 +75,7 @@
void up_release_pending(void) void up_release_pending(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("From TCB=%p\n", rtcb); slldbg("From TCB=%p\n", rtcb);
@ -100,7 +100,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -116,7 +116,7 @@ void up_release_pending(void)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_reprioritize_rtr(_TCB *tcb, uint8_t priority) void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
{ {
/* Verify that the caller is sane */ /* Verify that the caller is sane */
@ -102,7 +102,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority); slldbg("TCB=%p PRI=%d\n", tcb, priority);
@ -157,7 +157,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -173,7 +173,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -101,7 +101,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{ {
/* Refuse to handle nested signal actions */ /* Refuse to handle nested signal actions */
@ -121,7 +121,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
if (tcb == (_TCB*)g_readytorun.head) if (tcb == (struct tcb_s*)g_readytorun.head)
{ {
/* CASE 1: We are not in an interrupt handler and /* CASE 1: We are not in an interrupt handler and
* a task is signalling itself for some reason. * a task is signalling itself for some reason.

View file

@ -81,7 +81,7 @@
void up_sigdeliver(void) void up_sigdeliver(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint32_t regs[XCPTCONTEXT_REGS]; uint32_t regs[XCPTCONTEXT_REGS];
sig_deliver_t sigdeliver; sig_deliver_t sigdeliver;

View file

@ -109,9 +109,9 @@
#ifdef CONFIG_NUTTX_KERNEL #ifdef CONFIG_NUTTX_KERNEL
static inline void dispatch_syscall(uint32_t *regs) static inline void dispatch_syscall(uint32_t *regs)
{ {
uint32_t cmd = regs[REG_R0]; uint32_t cmd = regs[REG_R0];
FAR _TCB *rtcb = sched_self(); FAR struct tcb_s *rtcb = sched_self();
uintptr_t ret = (uintptr_t)ERROR; uintptr_t ret = (uintptr_t)ERROR;
/* Verify the the SYS call number is within range */ /* Verify the the SYS call number is within range */

View file

@ -79,7 +79,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_unblock_task(_TCB *tcb) void up_unblock_task(struct tcb_s *tcb)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -90,7 +90,7 @@ void up_unblock_task(_TCB *tcb)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@ -128,7 +128,7 @@ void up_unblock_task(_TCB *tcb)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -143,7 +143,7 @@ void up_unblock_task(_TCB *tcb)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -78,7 +78,7 @@
* *
****************************************************************************/ ****************************************************************************/
size_t up_check_tcbstack(FAR _TCB *tcb) size_t up_check_tcbstack(FAR struct tcb_s *tcb)
{ {
FAR uint32_t *ptr; FAR uint32_t *ptr;
size_t mark; size_t mark;
@ -136,12 +136,12 @@ size_t up_check_tcbstack(FAR _TCB *tcb)
size_t up_check_stack(void) size_t up_check_stack(void)
{ {
return up_check_tcbstack((FAR _TCB*)g_readytorun.head); return up_check_tcbstack((FAR struct tcb_s*)g_readytorun.head);
} }
size_t up_check_stack_remain(void) size_t up_check_stack_remain(void)
{ {
return ((FAR _TCB*)g_readytorun.head)->adj_stack_size - up_check_tcbstack((FAR _TCB*)g_readytorun.head); return ((FAR struct tcb_s*)g_readytorun.head)->adj_stack_size - up_check_tcbstack((FAR struct tcb_s*)g_readytorun.head);
} }
#endif /* CONFIG_DEBUG && CONFIG_DEBUG_STACK */ #endif /* CONFIG_DEBUG && CONFIG_DEBUG_STACK */

View file

@ -128,7 +128,7 @@ static void *memset32(void *s, uint32_t c, size_t n)
* must be allocated. * must be allocated.
****************************************************************************/ ****************************************************************************/
int up_create_stack(_TCB *tcb, size_t stack_size) int up_create_stack(struct tcb_s *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)
@ -174,7 +174,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4; size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (uint32_t*)top_of_stack; tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -73,7 +73,7 @@
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG) #if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg) static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
{ {
#if CONFIG_NFILE_DESCRIPTORS > 0 #if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct filelist *filelist; FAR struct filelist *filelist;
@ -136,7 +136,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
void _exit(int status) void _exit(int status)
{ {
_TCB* tcb; struct tcb_s* tcb;
/* Disable interrupts. They will be restored when the next /* Disable interrupts. They will be restored when the next
* task is started. * task is started.
@ -159,7 +159,7 @@ void _exit(int status)
* head of the list. * head of the list.
*/ */
tcb = (_TCB*)g_readytorun.head; tcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -410,8 +410,8 @@ extern void up_rnginitialize(void);
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK) #if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_STACK)
extern size_t up_check_stack(void); extern size_t up_check_stack(void);
extern size_t up_check_tcbstack(FAR _TCB); extern size_t up_check_tcbstack(FAR struct tcb_s);
extern size_t up_check_tcbstack_remain(FAR _TCB); extern size_t up_check_tcbstack_remain(FAR struct tcb_s);
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */

View file

@ -67,7 +67,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_release_stack(_TCB *dtcb) void up_release_stack(struct tcb_s *dtcb)
{ {
if (dtcb->stack_alloc_ptr) if (dtcb->stack_alloc_ptr)
{ {

View file

@ -109,7 +109,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_use_stack(_TCB *tcb, void *stack, size_t stack_size) int up_use_stack(struct tcb_s *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;
@ -146,7 +146,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4; size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (uint32_t*)top_of_stack; tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -126,8 +126,8 @@
pid_t up_vfork(const struct vfork_s *context) pid_t up_vfork(const struct vfork_s *context)
{ {
_TCB *parent = (FAR _TCB *)g_readytorun.head; struct tcb_s *parent = (FAR struct tcb_s *)g_readytorun.head;
_TCB *child; struct tcb_s *child;
size_t stacksize; size_t stacksize;
uint32_t newsp; uint32_t newsp;
uint32_t newfp; uint32_t newfp;

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_block_task(_TCB *tcb, tstate_t task_state) void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -95,7 +95,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@ -138,7 +138,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -153,7 +153,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -78,7 +78,7 @@
* *
****************************************************************************/ ****************************************************************************/
size_t up_check_tcbstack(FAR _TCB *tcb) size_t up_check_tcbstack(FAR struct tcb_s *tcb)
{ {
FAR uint8_t *ptr; FAR uint8_t *ptr;
size_t mark; size_t mark;
@ -135,7 +135,7 @@ size_t up_check_tcbstack(FAR _TCB *tcb)
size_t up_check_stack(void) size_t up_check_stack(void)
{ {
return up_check_tcbstack((FAR _TCB*)g_readytorun.head); return up_check_tcbstack((FAR struct tcb_s*)g_readytorun.head);
} }
#endif /* CONFIG_DEBUG && CONFIG_DEBUG_STACK */ #endif /* CONFIG_DEBUG && CONFIG_DEBUG_STACK */

View file

@ -87,7 +87,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_create_stack(_TCB *tcb, size_t stack_size) int up_create_stack(struct tcb_s *tcb, size_t stack_size)
{ {
/* Is there already a stack allocated of a different size? */ /* Is there already a stack allocated of a different size? */
@ -137,7 +137,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
top_of_stack = (size_t)tcb->stack_alloc_ptr + stack_size - 1; top_of_stack = (size_t)tcb->stack_alloc_ptr + stack_size - 1;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (FAR void *)top_of_stack; tcb->adj_stack_ptr = (FAR void *)top_of_stack;
tcb->adj_stack_size = stack_size; tcb->adj_stack_size = stack_size;

View file

@ -168,8 +168,8 @@ static inline void up_registerdump(void)
void up_dumpstate(void) void up_dumpstate(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint16_t sp = up_getsp(); uint16_t sp = up_getsp();
uint16_t ustackbase; uint16_t ustackbase;
uint16_t ustacksize; uint16_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 0 #if CONFIG_ARCH_INTERRUPTSTACK > 0

View file

@ -79,7 +79,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_initial_state(_TCB *tcb) void up_initial_state(struct tcb_s *tcb)
{ {
struct xcptcontext *xcp = &tcb->xcp; struct xcptcontext *xcp = &tcb->xcp;

View file

@ -75,7 +75,7 @@
void up_release_pending(void) void up_release_pending(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("From TCB=%p\n", rtcb); slldbg("From TCB=%p\n", rtcb);
@ -101,7 +101,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -117,7 +117,7 @@ void up_release_pending(void)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_reprioritize_rtr(_TCB *tcb, uint8_t priority) void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
{ {
/* Verify that the caller is sane */ /* Verify that the caller is sane */
@ -102,7 +102,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority); slldbg("TCB=%p PRI=%d\n", tcb, priority);
@ -156,7 +156,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -172,7 +172,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -101,7 +101,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{ {
/* Refuse to handle nested signal actions */ /* Refuse to handle nested signal actions */
@ -121,7 +121,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
if (tcb == (_TCB*)g_readytorun.head) if (tcb == (struct tcb_s*)g_readytorun.head)
{ {
/* CASE 1: We are not in an interrupt handler and /* CASE 1: We are not in an interrupt handler and
* a task is signalling itself for some reason. * a task is signalling itself for some reason.

View file

@ -81,7 +81,7 @@
void up_sigdeliver(void) void up_sigdeliver(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint8_t regs[XCPTCONTEXT_REGS]; uint8_t regs[XCPTCONTEXT_REGS];
sig_deliver_t sigdeliver; sig_deliver_t sigdeliver;

View file

@ -79,7 +79,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_unblock_task(_TCB *tcb) void up_unblock_task(struct tcb_s *tcb)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -90,7 +90,7 @@ void up_unblock_task(_TCB *tcb)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@ -128,7 +128,7 @@ void up_unblock_task(_TCB *tcb)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -143,7 +143,7 @@ void up_unblock_task(_TCB *tcb)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -82,7 +82,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_use_stack(_TCB *tcb, void *stack, size_t stack_size) int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
{ {
size_t top_of_stack; size_t top_of_stack;
@ -115,7 +115,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
top_of_stack = (size_t)tcb->stack_alloc_ptr + stack_size - 1; top_of_stack = (size_t)tcb->stack_alloc_ptr + stack_size - 1;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (FAR void *)top_of_stack; tcb->adj_stack_ptr = (FAR void *)top_of_stack;
tcb->adj_stack_size = stack_size; tcb->adj_stack_size = stack_size;

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_block_task(_TCB *tcb, tstate_t task_state) void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -95,7 +95,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@ -138,7 +138,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -153,7 +153,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -86,7 +86,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_create_stack(_TCB *tcb, size_t stack_size) int up_create_stack(struct tcb_s *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)
@ -124,7 +124,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
top_of_stack &= ~3; top_of_stack &= ~3;
size_of_stack = top_of_stack - (size_t)tcb->stack_alloc_ptr + 4; size_of_stack = top_of_stack - (size_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (FAR void *)top_of_stack; tcb->adj_stack_ptr = (FAR void *)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -145,8 +145,8 @@ static inline void up_registerdump(void)
void up_dumpstate(void) void up_dumpstate(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint32_t sp = up_getsp(); uint32_t sp = up_getsp();
uint32_t ustackbase; uint32_t ustackbase;
uint32_t ustacksize; uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3 #if CONFIG_ARCH_INTERRUPTSTACK > 3

View file

@ -77,7 +77,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_initial_state(_TCB *tcb) void up_initial_state(struct tcb_s *tcb)
{ {
struct xcptcontext *xcp = &tcb->xcp; struct xcptcontext *xcp = &tcb->xcp;

View file

@ -75,7 +75,7 @@
void up_release_pending(void) void up_release_pending(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("From TCB=%p\n", rtcb); slldbg("From TCB=%p\n", rtcb);
@ -101,7 +101,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -117,7 +117,7 @@ void up_release_pending(void)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_reprioritize_rtr(_TCB *tcb, uint8_t priority) void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
{ {
/* Verify that the caller is sane */ /* Verify that the caller is sane */
@ -102,7 +102,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority); slldbg("TCB=%p PRI=%d\n", tcb, priority);
@ -156,7 +156,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -172,7 +172,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -101,7 +101,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{ {
/* Refuse to handle nested signal actions */ /* Refuse to handle nested signal actions */
@ -121,7 +121,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
if (tcb == (_TCB*)g_readytorun.head) if (tcb == (struct tcb_s*)g_readytorun.head)
{ {
/* CASE 1: We are not in an interrupt handler and /* CASE 1: We are not in an interrupt handler and
* a task is signalling itself for some reason. * a task is signalling itself for some reason.

View file

@ -81,7 +81,7 @@
void up_sigdeliver(void) void up_sigdeliver(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#if 0 #if 0
uint32_t regs[XCPTCONTEXT_REGS+3]; /* Why +3? See below */ uint32_t regs[XCPTCONTEXT_REGS+3]; /* Why +3? See below */
#else #else

View file

@ -79,7 +79,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_unblock_task(_TCB *tcb) void up_unblock_task(struct tcb_s *tcb)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -90,7 +90,7 @@ void up_unblock_task(_TCB *tcb)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@ -128,7 +128,7 @@ void up_unblock_task(_TCB *tcb)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -143,7 +143,7 @@ void up_unblock_task(_TCB *tcb)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -82,7 +82,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_use_stack(_TCB *tcb, void *stack, size_t stack_size) int up_use_stack(struct tcb_s *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;
@ -113,7 +113,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
top_of_stack &= ~3; top_of_stack &= ~3;
size_of_stack = top_of_stack - (size_t)tcb->stack_alloc_ptr + 4; size_of_stack = top_of_stack - (size_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (FAR void *)top_of_stack; tcb->adj_stack_ptr = (FAR void *)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -95,7 +95,7 @@ static void _up_assert(int errorcode)
{ {
/* Are we in an interrupt handler or the idle task? */ /* Are we in an interrupt handler or the idle task? */
if (current_regs || ((_TCB*)g_readytorun.head)->pid == 0) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0)
{ {
(void)irqsave(); (void)irqsave();
for(;;) for(;;)
@ -125,7 +125,7 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno) void up_assert(const uint8_t *filename, int lineno)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
@ -147,7 +147,7 @@ void up_assert(const uint8_t *filename, int lineno)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode) void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);

View file

@ -73,7 +73,7 @@
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG) #if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg) static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
{ {
#if CONFIG_NFILE_DESCRIPTORS > 0 #if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct filelist *filelist; FAR struct filelist *filelist;
@ -136,7 +136,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
void _exit(int status) void _exit(int status)
{ {
_TCB* tcb; struct tcb_s* tcb;
/* Disable interrupts. They will be restored when the next /* Disable interrupts. They will be restored when the next
* task is started. * task is started.
@ -159,7 +159,7 @@ void _exit(int status)
* head of the list. * head of the list.
*/ */
tcb = (_TCB*)g_readytorun.head; tcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -67,7 +67,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_release_stack(_TCB *dtcb) void up_release_stack(struct tcb_s *dtcb)
{ {
if (dtcb->stack_alloc_ptr) if (dtcb->stack_alloc_ptr)
{ {

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_block_task(_TCB *tcb, tstate_t task_state) void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -95,7 +95,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@ -138,7 +138,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -156,7 +156,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -83,7 +83,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_create_stack(_TCB *tcb, size_t stack_size) int up_create_stack(struct tcb_s *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)
{ {
@ -118,7 +118,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
top_of_stack &= ~1; top_of_stack &= ~1;
size_of_stack = top_of_stack - (size_t)tcb->stack_alloc_ptr; size_of_stack = top_of_stack - (size_t)tcb->stack_alloc_ptr;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (uint32_t*)top_of_stack; tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -73,7 +73,7 @@
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG) #if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg) static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
{ {
#if CONFIG_NFILE_DESCRIPTORS > 0 #if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct filelist *filelist; FAR struct filelist *filelist;
@ -136,7 +136,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
void _exit(int status) void _exit(int status)
{ {
_TCB* tcb; struct tcb_s* tcb;
/* Disable interrupts. They will be restored when the next /* Disable interrupts. They will be restored when the next
* task is started. * task is started.
@ -159,7 +159,7 @@ void _exit(int status)
* head of the list. * head of the list.
*/ */
tcb = (_TCB*)g_readytorun.head; tcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -74,7 +74,7 @@
void up_release_pending(void) void up_release_pending(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("From TCB=%p\n", rtcb); slldbg("From TCB=%p\n", rtcb);
@ -100,7 +100,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -120,7 +120,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -68,7 +68,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_release_stack(_TCB *dtcb) void up_release_stack(struct tcb_s *dtcb)
{ {
if (dtcb->stack_alloc_ptr) if (dtcb->stack_alloc_ptr)
{ {

View file

@ -84,7 +84,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_reprioritize_rtr(_TCB *tcb, uint8_t priority) void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
{ {
/* Verify that the caller is sane */ /* Verify that the caller is sane */
@ -102,7 +102,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority); slldbg("TCB=%p PRI=%d\n", tcb, priority);
@ -156,7 +156,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -175,7 +175,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */

View file

@ -79,7 +79,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_unblock_task(_TCB *tcb) void up_unblock_task(struct tcb_s *tcb)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -90,7 +90,7 @@ void up_unblock_task(_TCB *tcb)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@ -128,7 +128,7 @@ void up_unblock_task(_TCB *tcb)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -148,7 +148,7 @@ void up_unblock_task(_TCB *tcb)
* g_readytorun task list. * g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -80,7 +80,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_use_stack(_TCB *tcb, void *stack, size_t stack_size) int up_use_stack(struct tcb_s *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;
@ -112,7 +112,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
top_of_stack &= ~1; top_of_stack &= ~1;
size_of_stack = top_of_stack - (size_t)tcb->stack_alloc_ptr; size_of_stack = top_of_stack - (size_t)tcb->stack_alloc_ptr;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (uint32_t*)top_of_stack; tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -156,8 +156,8 @@ static inline void up_registerdump(void)
#ifdef CONFIG_ARCH_STACKDUMP #ifdef CONFIG_ARCH_STACKDUMP
static void up_dumpstate(void) static void up_dumpstate(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint16_t sp = up_getsp(); uint16_t sp = up_getsp();
uint16_t ustackbase; uint16_t ustackbase;
uint16_t ustacksize; uint16_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3 #if CONFIG_ARCH_INTERRUPTSTACK > 3
@ -252,7 +252,7 @@ static void _up_assert(int errorcode)
{ {
/* Are we in an interrupt handler or the idle task? */ /* Are we in an interrupt handler or the idle task? */
if (current_regs || ((_TCB*)g_readytorun.head)->pid == 0) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0)
{ {
(void)irqsave(); (void)irqsave();
for(;;) for(;;)
@ -282,7 +282,7 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno) void up_assert(const uint8_t *filename, int lineno)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
@ -304,7 +304,7 @@ void up_assert(const uint8_t *filename, int lineno)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode) void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);

View file

@ -76,7 +76,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_initial_state(_TCB *tcb) void up_initial_state(struct tcb_s *tcb)
{ {
struct xcptcontext *xcp = &tcb->xcp; struct xcptcontext *xcp = &tcb->xcp;

View file

@ -84,7 +84,7 @@
* must be allocated. * must be allocated.
****************************************************************************/ ****************************************************************************/
int up_create_stack(_TCB *tcb, size_t stack_size) int up_create_stack(struct tcb_s *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)
@ -124,7 +124,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
top_of_stack &= ~3; top_of_stack &= ~3;
size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4; size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (uint32_t*)top_of_stack; tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -75,7 +75,7 @@
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG) #if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg) static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
{ {
#if CONFIG_NFILE_DESCRIPTORS > 0 #if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct filelist *filelist; FAR struct filelist *filelist;
@ -138,7 +138,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
void _exit(int status) void _exit(int status)
{ {
_TCB* tcb; struct tcb_s* tcb;
/* Disable interrupts. They will be restored when the next /* Disable interrupts. They will be restored when the next
* task is started. * task is started.
@ -161,7 +161,7 @@ void _exit(int status)
* head of the list. * head of the list.
*/ */
tcb = (_TCB*)g_readytorun.head; tcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -67,7 +67,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_release_stack(_TCB *dtcb) void up_release_stack(struct tcb_s *dtcb)
{ {
if (dtcb->stack_alloc_ptr) if (dtcb->stack_alloc_ptr)
{ {

View file

@ -82,7 +82,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_use_stack(_TCB *tcb, void *stack, size_t stack_size) int up_use_stack(struct tcb_s *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;
@ -113,7 +113,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
top_of_stack &= ~3; top_of_stack &= ~3;
size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4; size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (uint32_t*)top_of_stack; tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -95,7 +95,7 @@ static void _up_assert(int errorcode)
{ {
/* Are we in an interrupt handler or the idle task? */ /* Are we in an interrupt handler or the idle task? */
if (current_regs || ((_TCB*)g_readytorun.head)->pid == 0) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0)
{ {
(void)irqsave(); (void)irqsave();
for(;;) for(;;)
@ -125,7 +125,7 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno) void up_assert(const uint8_t *filename, int lineno)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
@ -147,7 +147,7 @@ void up_assert(const uint8_t *filename, int lineno)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode) void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{ {
#ifdef CONFIG_PRINT_TASKNAME #ifdef CONFIG_PRINT_TASKNAME
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);

View file

@ -85,7 +85,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_block_task(_TCB *tcb, tstate_t task_state) void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -96,7 +96,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@ -139,7 +139,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -154,7 +154,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -154,8 +154,8 @@ static inline void up_registerdump(void)
void up_dumpstate(void) void up_dumpstate(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint32_t sp = up_getsp(); uint32_t sp = up_getsp();
uint32_t ustackbase; uint32_t ustackbase;
uint32_t ustacksize; uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3 #if CONFIG_ARCH_INTERRUPTSTACK > 3

View file

@ -80,7 +80,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_initial_state(_TCB *tcb) void up_initial_state(struct tcb_s *tcb)
{ {
struct xcptcontext *xcp = &tcb->xcp; struct xcptcontext *xcp = &tcb->xcp;
uint32_t regval; uint32_t regval;

View file

@ -77,7 +77,7 @@
void up_release_pending(void) void up_release_pending(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("From TCB=%p\n", rtcb); slldbg("From TCB=%p\n", rtcb);
@ -103,7 +103,7 @@ void up_release_pending(void)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -119,7 +119,7 @@ void up_release_pending(void)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -86,7 +86,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_reprioritize_rtr(_TCB *tcb, uint8_t priority) void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
{ {
/* Verify that the caller is sane */ /* Verify that the caller is sane */
@ -104,7 +104,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority); slldbg("TCB=%p PRI=%d\n", tcb, priority);
@ -158,7 +158,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", rtcb); slldbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */ /* Then switch contexts */
@ -174,7 +174,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -101,7 +101,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{ {
uint32_t status; uint32_t status;
@ -123,7 +123,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs); sdbg("rtcb=0x%p current_regs=0x%p\n", g_readytorun.head, current_regs);
if (tcb == (_TCB*)g_readytorun.head) if (tcb == (struct tcb_s*)g_readytorun.head)
{ {
/* CASE 1: We are not in an interrupt handler and /* CASE 1: We are not in an interrupt handler and
* a task is signalling itself for some reason. * a task is signalling itself for some reason.

View file

@ -82,7 +82,7 @@
void up_sigdeliver(void) void up_sigdeliver(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
uint32_t regs[XCPTCONTEXT_REGS]; uint32_t regs[XCPTCONTEXT_REGS];
sig_deliver_t sigdeliver; sig_deliver_t sigdeliver;

View file

@ -139,9 +139,9 @@ static void up_registerdump(const uint32_t *regs)
#ifdef CONFIG_NUTTX_KERNEL #ifdef CONFIG_NUTTX_KERNEL
static inline void dispatch_syscall(uint32_t *regs) static inline void dispatch_syscall(uint32_t *regs)
{ {
uint32_t cmd = regs[REG_A0]; uint32_t cmd = regs[REG_A0];
FAR _TCB *rtcb = sched_self(); FAR struct tcb_s *rtcb = sched_self();
uintptr_t ret = (uintptr_t)ERROR; uintptr_t ret = (uintptr_t)ERROR;
/* Verify the the SYS call number is within range */ /* Verify the the SYS call number is within range */

View file

@ -81,7 +81,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_unblock_task(_TCB *tcb) void up_unblock_task(struct tcb_s *tcb)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -92,7 +92,7 @@ void up_unblock_task(_TCB *tcb)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
@ -130,7 +130,7 @@ void up_unblock_task(_TCB *tcb)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -145,7 +145,7 @@ void up_unblock_task(_TCB *tcb)
* ready to run list. * ready to run list.
*/ */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
/* up_switchcontext forces a context switch to the task at the /* up_switchcontext forces a context switch to the task at the

View file

@ -113,8 +113,8 @@
pid_t up_vfork(const struct vfork_s *context) pid_t up_vfork(const struct vfork_s *context)
{ {
_TCB *parent = (FAR _TCB *)g_readytorun.head; struct tcb_s *parent = (FAR struct tcb_s *)g_readytorun.head;
_TCB *child; struct tcb_s *child;
size_t stacksize; size_t stacksize;
uint32_t newsp; uint32_t newsp;
#if CONFIG_MIPS32_FRAMEPOINTER #if CONFIG_MIPS32_FRAMEPOINTER

View file

@ -48,10 +48,10 @@
struct up_wait { struct up_wait {
struct up_wait *next; struct up_wait *next;
_TCB *task; struct tcb_s *task;
}; };
extern _TCB *current_task; extern struct tcb_s *current_task;
void up_sigentry(void); void up_sigentry(void);

View file

@ -55,7 +55,7 @@ void nuttx_arch_exit(void)
} }
void up_initial_state(_TCB *tcb) void up_initial_state(struct tcb_s *tcb)
{ {
struct Trapframe *tf; struct Trapframe *tf;

View file

@ -54,7 +54,7 @@
#include <arch/arch.h> #include <arch/arch.h>
#include <os_internal.h> #include <os_internal.h>
_TCB *current_task = NULL; struct tcb_s *current_task = NULL;
/** /**
@ -62,7 +62,7 @@ _TCB *current_task = NULL;
* to switch tasks. * to switch tasks.
* Assumption: global interrupt is disabled. * Assumption: global interrupt is disabled.
*/ */
static inline void up_switchcontext(_TCB *ctcb, _TCB *ntcb) static inline void up_switchcontext(struct tcb_s *ctcb, struct tcb_s *ntcb)
{ {
// do nothing if two tasks are the same // do nothing if two tasks are the same
if (ctcb == ntcb) if (ctcb == ntcb)
@ -111,7 +111,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
*heap_size = KERNBASE + kmem_size - (uint32_t)boot_freemem; *heap_size = KERNBASE + kmem_size - (uint32_t)boot_freemem;
} }
int up_create_stack(_TCB *tcb, size_t stack_size) int up_create_stack(struct tcb_s *tcb, size_t stack_size)
{ {
int ret = ERROR; int ret = ERROR;
size_t *adj_stack_ptr; size_t *adj_stack_ptr;
@ -139,7 +139,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
return ret; return ret;
} }
int up_use_stack(_TCB *tcb, void *stack, size_t stack_size) int up_use_stack(struct tcb_s *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 */
@ -158,7 +158,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
return OK; return OK;
} }
void up_release_stack(_TCB *dtcb) void up_release_stack(struct tcb_s *dtcb)
{ {
if (dtcb->stack_alloc_ptr) { if (dtcb->stack_alloc_ptr) {
free(dtcb->stack_alloc_ptr); free(dtcb->stack_alloc_ptr);
@ -192,7 +192,7 @@ void up_release_stack(_TCB *dtcb)
* hold the blocked task TCB. * hold the blocked task TCB.
* *
****************************************************************************/ ****************************************************************************/
void up_block_task(_TCB *tcb, tstate_t task_state) void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
if ((tcb->task_state < FIRST_READY_TO_RUN_STATE) || if ((tcb->task_state < FIRST_READY_TO_RUN_STATE) ||
@ -201,7 +201,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
return; return;
} }
else { else {
_TCB *rtcb = current_task; struct tcb_s *rtcb = current_task;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@ -217,7 +217,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
/* Now, perform the context switch if one is needed */ /* Now, perform the context switch if one is needed */
if (switch_needed) { if (switch_needed) {
_TCB *nexttcb; struct tcb_s *nexttcb;
// this part should not be executed in interrupt context // this part should not be executed in interrupt context
if (up_interrupt_context()) { if (up_interrupt_context()) {
panic("%s: %d\n", __func__, __LINE__); panic("%s: %d\n", __func__, __LINE__);
@ -230,7 +230,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
warn("Disable preemption failed for task block itself\n"); warn("Disable preemption failed for task block itself\n");
sched_mergepending(); sched_mergepending();
} }
nexttcb = (_TCB*)g_readytorun.head; nexttcb = (struct tcb_s*)g_readytorun.head;
// context switch // context switch
up_switchcontext(rtcb, nexttcb); up_switchcontext(rtcb, nexttcb);
} }
@ -252,7 +252,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* ready to run taks, executed. * ready to run taks, executed.
* *
****************************************************************************/ ****************************************************************************/
void up_unblock_task(_TCB *tcb) void up_unblock_task(struct tcb_s *tcb)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
if ((tcb->task_state < FIRST_BLOCKED_STATE) || if ((tcb->task_state < FIRST_BLOCKED_STATE) ||
@ -261,7 +261,7 @@ void up_unblock_task(_TCB *tcb)
return; return;
} }
else { else {
_TCB *rtcb = current_task; struct tcb_s *rtcb = current_task;
/* Remove the task from the blocked task list */ /* Remove the task from the blocked task list */
sched_removeblocked(tcb); sched_removeblocked(tcb);
@ -277,7 +277,7 @@ void up_unblock_task(_TCB *tcb)
// g_readytorun task list. // g_readytorun task list.
if (sched_addreadytorun(tcb) && !up_interrupt_context()) { if (sched_addreadytorun(tcb) && !up_interrupt_context()) {
/* The currently active task has changed! */ /* The currently active task has changed! */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
// context switch // context switch
up_switchcontext(rtcb, nexttcb); up_switchcontext(rtcb, nexttcb);
} }
@ -290,20 +290,20 @@ void up_unblock_task(_TCB *tcb)
*/ */
void up_release_pending(void) void up_release_pending(void)
{ {
_TCB *rtcb = current_task; struct tcb_s *rtcb = current_task;
/* Merge the g_pendingtasks list into the g_readytorun task list */ /* Merge the g_pendingtasks list into the g_readytorun task list */
if (sched_mergepending()) { if (sched_mergepending()) {
/* The currently active task has changed! */ /* The currently active task has changed! */
_TCB *nexttcb = (_TCB*)g_readytorun.head; struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
// context switch // context switch
up_switchcontext(rtcb, nexttcb); up_switchcontext(rtcb, nexttcb);
} }
} }
void up_reprioritize_rtr(_TCB *tcb, uint8_t priority) void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
{ {
/* Verify that the caller is sane */ /* Verify that the caller is sane */
@ -320,7 +320,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
return; return;
} }
else { else {
_TCB *rtcb = current_task; struct tcb_s *rtcb = current_task;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. /* Remove the tcb task from the ready-to-run list.
@ -343,7 +343,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
/* Now, perform the context switch if one is needed */ /* Now, perform the context switch if one is needed */
if (switch_needed && !up_interrupt_context()) { if (switch_needed && !up_interrupt_context()) {
_TCB *nexttcb; struct tcb_s *nexttcb;
// If there are any pending tasks, then add them to the g_readytorun // If there are any pending tasks, then add them to the g_readytorun
// task list now. It should be the up_realease_pending() called from // task list now. It should be the up_realease_pending() called from
// sched_unlock() to do this for disable preemption. But it block // sched_unlock() to do this for disable preemption. But it block
@ -353,7 +353,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
sched_mergepending(); sched_mergepending();
} }
nexttcb = (_TCB*)g_readytorun.head; nexttcb = (struct tcb_s*)g_readytorun.head;
// context switch // context switch
up_switchcontext(rtcb, nexttcb); up_switchcontext(rtcb, nexttcb);
} }
@ -362,7 +362,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
void _exit(int status) void _exit(int status)
{ {
_TCB* tcb; struct tcb_s* tcb;
/* Destroy the task at the head of the ready to run list. */ /* Destroy the task at the head of the ready to run list. */
@ -372,7 +372,7 @@ void _exit(int status)
* head of the list. * head of the list.
*/ */
tcb = (_TCB*)g_readytorun.head; tcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -413,7 +413,7 @@ void up_assert_code(const uint8_t *filename, int line, int code)
#ifndef CONFIG_DISABLE_SIGNALS #ifndef CONFIG_DISABLE_SIGNALS
void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
{ {
/* Refuse to handle nested signal actions */ /* Refuse to handle nested signal actions */
if (!tcb->xcp.sigdeliver) { if (!tcb->xcp.sigdeliver) {

View file

@ -101,14 +101,14 @@ void rtos_exit_interrupt(void)
local_irq_disable(); local_irq_disable();
nest_irq--; nest_irq--;
if (!nest_irq) { if (!nest_irq) {
_TCB *rtcb = current_task; struct tcb_s *rtcb = current_task;
_TCB *ntcb; struct tcb_s *ntcb;
if (rtcb->xcp.sigdeliver) { if (rtcb->xcp.sigdeliver) {
rtcb->xcp.ctx.tf = current_regs; rtcb->xcp.ctx.tf = current_regs;
push_xcptcontext(&rtcb->xcp); push_xcptcontext(&rtcb->xcp);
} }
ntcb = (_TCB*)g_readytorun.head; ntcb = (struct tcb_s*)g_readytorun.head;
// switch needed // switch needed
if (rtcb != ntcb) { if (rtcb != ntcb) {
rtcb->xcp.ctx.tf = current_regs; rtcb->xcp.ctx.tf = current_regs;

View file

@ -71,7 +71,7 @@ void nuttx_arch_exit(void)
} }
void up_initial_state(_TCB *tcb) void up_initial_state(struct tcb_s *tcb)
{ {
struct Trapframe *tf; struct Trapframe *tf;

View file

@ -81,7 +81,7 @@ static void _up_assert(int errorcode)
{ {
/* Are we in an interrupt handler or the idle task? */ /* Are we in an interrupt handler or the idle task? */
if (current_regs || ((_TCB*)g_readytorun.head)->pid == 0) if (current_regs || ((struct tcb_s*)g_readytorun.head)->pid == 0)
{ {
(void)irqsave(); (void)irqsave();
for(;;) for(;;)
@ -111,7 +111,7 @@ static void _up_assert(int errorcode)
void up_assert(const uint8_t *filename, int lineno) void up_assert(const uint8_t *filename, int lineno)
{ {
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG) #if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG)
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);
@ -133,7 +133,7 @@ void up_assert(const uint8_t *filename, int lineno)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode) void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{ {
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG) #if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG)
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
#endif #endif
up_ledon(LED_ASSERTION); up_ledon(LED_ASSERTION);

View file

@ -83,7 +83,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_block_task(_TCB *tcb, tstate_t task_state) void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{ {
/* Verify that the context switch can be performed */ /* Verify that the context switch can be performed */
@ -94,7 +94,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
} }
else else
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head;
bool switch_needed; bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we /* Remove the tcb task from the ready-to-run list. If we
@ -137,7 +137,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */
@ -155,7 +155,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* of the g_readytorun task list. * of the g_readytorun task list.
*/ */
rtcb = (_TCB*)g_readytorun.head; rtcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

View file

@ -83,7 +83,7 @@
* must be allocated. * must be allocated.
****************************************************************************/ ****************************************************************************/
int up_create_stack(_TCB *tcb, size_t stack_size) int up_create_stack(struct tcb_s *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)
@ -119,7 +119,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
top_of_stack &= ~3; top_of_stack &= ~3;
size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4; size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */ /* Save the adjusted stack values in the struct tcb_s */
tcb->adj_stack_ptr = (uint32_t*)top_of_stack; tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack; tcb->adj_stack_size = size_of_stack;

View file

@ -74,7 +74,7 @@
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG) #if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg) static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
{ {
#if CONFIG_NFILE_DESCRIPTORS > 0 #if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct filelist *filelist; FAR struct filelist *filelist;
@ -137,7 +137,7 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
void _exit(int status) void _exit(int status)
{ {
_TCB* tcb; struct tcb_s* tcb;
/* Disable interrupts. They will be restored when the next /* Disable interrupts. They will be restored when the next
* task is started. * task is started.
@ -160,7 +160,7 @@ void _exit(int status)
* head of the list. * head of the list.
*/ */
tcb = (_TCB*)g_readytorun.head; tcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */ /* Then switch contexts */

Some files were not shown because too many files have changed in this diff Show more