summaryrefslogtreecommitdiff
path: root/nuttx/arch/rgmp
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-04 18:46:28 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-04 18:46:28 +0000
commit7071ca9d21d783827f93fcd25631aa2da8df8fe4 (patch)
tree1fab8982b4f2438b1b135fd6c43e7b8a8af78d48 /nuttx/arch/rgmp
parent09afe06037de8f89b2cfa4f1765be407bf1783a2 (diff)
downloadnuttx-7071ca9d21d783827f93fcd25631aa2da8df8fe4.tar.gz
nuttx-7071ca9d21d783827f93fcd25631aa2da8df8fe4.tar.bz2
nuttx-7071ca9d21d783827f93fcd25631aa2da8df8fe4.zip
Rename _TCB to struct tcb_s
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5610 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/rgmp')
-rw-r--r--nuttx/arch/rgmp/include/arch.h4
-rw-r--r--nuttx/arch/rgmp/src/arm/arch_nuttx.c2
-rw-r--r--nuttx/arch/rgmp/src/nuttx.c42
-rw-r--r--nuttx/arch/rgmp/src/rgmp.c6
-rw-r--r--nuttx/arch/rgmp/src/x86/arch_nuttx.c2
5 files changed, 28 insertions, 28 deletions
diff --git a/nuttx/arch/rgmp/include/arch.h b/nuttx/arch/rgmp/include/arch.h
index 32eb16ee3..af99356ea 100644
--- a/nuttx/arch/rgmp/include/arch.h
+++ b/nuttx/arch/rgmp/include/arch.h
@@ -48,10 +48,10 @@
struct up_wait {
struct up_wait *next;
- _TCB *task;
+ struct tcb_s *task;
};
-extern _TCB *current_task;
+extern struct tcb_s *current_task;
void up_sigentry(void);
diff --git a/nuttx/arch/rgmp/src/arm/arch_nuttx.c b/nuttx/arch/rgmp/src/arm/arch_nuttx.c
index cb946bfd1..e916c5520 100644
--- a/nuttx/arch/rgmp/src/arm/arch_nuttx.c
+++ b/nuttx/arch/rgmp/src/arm/arch_nuttx.c
@@ -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;
diff --git a/nuttx/arch/rgmp/src/nuttx.c b/nuttx/arch/rgmp/src/nuttx.c
index 7deb959a2..6cb300f82 100644
--- a/nuttx/arch/rgmp/src/nuttx.c
+++ b/nuttx/arch/rgmp/src/nuttx.c
@@ -54,7 +54,7 @@
#include <arch/arch.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.
* 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
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;
}
-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;
size_t *adj_stack_ptr;
@@ -139,7 +139,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
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 */
@@ -158,7 +158,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
return OK;
}
-void up_release_stack(_TCB *dtcb)
+void up_release_stack(struct tcb_s *dtcb)
{
if (dtcb->stack_alloc_ptr) {
free(dtcb->stack_alloc_ptr);
@@ -192,7 +192,7 @@ void up_release_stack(_TCB *dtcb)
* 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 */
if ((tcb->task_state < FIRST_READY_TO_RUN_STATE) ||
@@ -201,7 +201,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
return;
}
else {
- _TCB *rtcb = current_task;
+ struct tcb_s *rtcb = current_task;
bool switch_needed;
/* 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 */
if (switch_needed) {
- _TCB *nexttcb;
+ struct tcb_s *nexttcb;
// this part should not be executed in interrupt context
if (up_interrupt_context()) {
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");
sched_mergepending();
}
- nexttcb = (_TCB*)g_readytorun.head;
+ nexttcb = (struct tcb_s*)g_readytorun.head;
// context switch
up_switchcontext(rtcb, nexttcb);
}
@@ -252,7 +252,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
* 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 */
if ((tcb->task_state < FIRST_BLOCKED_STATE) ||
@@ -261,7 +261,7 @@ void up_unblock_task(_TCB *tcb)
return;
}
else {
- _TCB *rtcb = current_task;
+ struct tcb_s *rtcb = current_task;
/* Remove the task from the blocked task list */
sched_removeblocked(tcb);
@@ -277,7 +277,7 @@ void up_unblock_task(_TCB *tcb)
// g_readytorun task list.
if (sched_addreadytorun(tcb) && !up_interrupt_context()) {
/* The currently active task has changed! */
- _TCB *nexttcb = (_TCB*)g_readytorun.head;
+ struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
// context switch
up_switchcontext(rtcb, nexttcb);
}
@@ -290,20 +290,20 @@ void up_unblock_task(_TCB *tcb)
*/
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 */
if (sched_mergepending()) {
/* The currently active task has changed! */
- _TCB *nexttcb = (_TCB*)g_readytorun.head;
+ struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
// context switch
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 */
@@ -320,7 +320,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
return;
}
else {
- _TCB *rtcb = current_task;
+ struct tcb_s *rtcb = current_task;
bool switch_needed;
/* 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 */
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
// task list now. It should be the up_realease_pending() called from
// 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();
}
- nexttcb = (_TCB*)g_readytorun.head;
+ nexttcb = (struct tcb_s*)g_readytorun.head;
// context switch
up_switchcontext(rtcb, nexttcb);
}
@@ -362,7 +362,7 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
void _exit(int status)
{
- _TCB* tcb;
+ struct tcb_s* tcb;
/* Destroy the task at the head of the ready to run list. */
@@ -372,7 +372,7 @@ void _exit(int status)
* head of the list.
*/
- tcb = (_TCB*)g_readytorun.head;
+ tcb = (struct tcb_s*)g_readytorun.head;
/* Then switch contexts */
@@ -413,7 +413,7 @@ void up_assert_code(const uint8_t *filename, int line, int code)
#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 */
if (!tcb->xcp.sigdeliver) {
diff --git a/nuttx/arch/rgmp/src/rgmp.c b/nuttx/arch/rgmp/src/rgmp.c
index 479696fb5..db5dd955e 100644
--- a/nuttx/arch/rgmp/src/rgmp.c
+++ b/nuttx/arch/rgmp/src/rgmp.c
@@ -101,14 +101,14 @@ void rtos_exit_interrupt(void)
local_irq_disable();
nest_irq--;
if (!nest_irq) {
- _TCB *rtcb = current_task;
- _TCB *ntcb;
+ struct tcb_s *rtcb = current_task;
+ struct tcb_s *ntcb;
if (rtcb->xcp.sigdeliver) {
rtcb->xcp.ctx.tf = current_regs;
push_xcptcontext(&rtcb->xcp);
}
- ntcb = (_TCB*)g_readytorun.head;
+ ntcb = (struct tcb_s*)g_readytorun.head;
// switch needed
if (rtcb != ntcb) {
rtcb->xcp.ctx.tf = current_regs;
diff --git a/nuttx/arch/rgmp/src/x86/arch_nuttx.c b/nuttx/arch/rgmp/src/x86/arch_nuttx.c
index 04b8fa8c8..c691784d9 100644
--- a/nuttx/arch/rgmp/src/x86/arch_nuttx.c
+++ b/nuttx/arch/rgmp/src/x86/arch_nuttx.c
@@ -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;