From 93a1d7ca892fc85cf43bf29812ef57804c724a8e Mon Sep 17 00:00:00 2001 From: Yonattan Louise Date: Mon, 27 Apr 2015 10:28:29 -0500 Subject: [PATCH] Rename K_Args to _k_command_stack Updating global variable's name to follow a consistent naming convention. Change accomplished with the following script: #!/bin/bash echo "Searching for ${1} to replace with ${2}" find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \ ! -path "./host/src/genIdt/*" \ ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g'; Change-Id: I5e249e34ee9666666e31db6b9f71fe2abcc22400 Signed-off-by: Yonattan Louise --- arch/arm/core/task_abort.c | 2 +- arch/arm/timer/systick.c | 14 +++++++------- arch/x86/timer/hpet.c | 10 +++++----- arch/x86/timer/loApicTimer.c | 10 +++++----- drivers/timer/i8253.c | 10 +++++----- kernel/microkernel/core/global.c | 4 ++-- kernel/microkernel/core/taskcall.c | 2 +- kernel/microkernel/include/minik.h | 4 ++-- kernel/microkernel/k_event.c | 2 +- kernel/microkernel/k_mbox.c | 2 +- kernel/microkernel/k_mempool.c | 4 ++-- kernel/microkernel/k_sema.c | 2 +- kernel/microkernel/k_timer.c | 2 +- kernel/microkernel/timer/ticker.c | 2 +- kernel/nanokernel/core/microk.c | 4 ++-- 15 files changed, 37 insertions(+), 37 deletions(-) diff --git a/arch/arm/core/task_abort.c b/arch/arm/core/task_abort.c index 765ce9bed1..f5a2456204 100644 --- a/arch/arm/core/task_abort.c +++ b/arch/arm/core/task_abort.c @@ -79,7 +79,7 @@ void _TaskAbort(void) cmdpacket.Args.g1.opt = taskAbortCode; cmdpacket.alloc = false; _k_current_task->Args = &cmdpacket; - nano_isr_stack_push(&K_Args, (uint32_t) &cmdpacket); + nano_isr_stack_push(&_k_command_stack, (uint32_t) &cmdpacket); _ScbPendsvSet(); } } diff --git a/arch/arm/timer/systick.c b/arch/arm/timer/systick.c index a189fc2723..56a9bfbb79 100644 --- a/arch/arm/timer/systick.c +++ b/arch/arm/timer/systick.c @@ -64,7 +64,7 @@ conjunction with a microkernel. #include #include -extern struct nano_stack K_Args; +extern struct nano_stack _k_command_stack; #endif /* CONFIG_MICROKERNEL */ @@ -317,7 +317,7 @@ void _TIMER_INT_HANDLER(void *unused) idleMode = IDLE_NOT_TICKLESS; _SysIdleElapsedTicks = idleOrigTicks + 1; /* actual # of idle ticks */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } else { /* * Increment the tick because _timer_idle_exit does not @@ -335,7 +335,7 @@ void _TIMER_INT_HANDLER(void *unused) */ if (_SysIdleElapsedTicks == 1) { - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } } @@ -348,7 +348,7 @@ void _TIMER_INT_HANDLER(void *unused) */ accumulatedCount += sys_clock_hw_cycles_per_tick; - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); #endif /* CONFIG_TICKLESS_IDLE */ numIdleTicks = _NanoIdleValGet(); /* get # of idle ticks requested */ @@ -376,7 +376,7 @@ void _TIMER_INT_HANDLER(void *unused) * one more tick has occurred -- don't need to do anything special since * timer is already configured to interrupt on the following tick */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); #else _nano_ticks++; @@ -587,7 +587,7 @@ void _timer_idle_exit(void) * so _SysIdleElapsedTicks is adjusted to account for it. */ _SysIdleElapsedTicks = idleOrigTicks - 1; - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } else { uint32_t elapsed; /* elapsed "counter time" */ uint32_t remaining; /* remaining "counter time" */ @@ -619,7 +619,7 @@ void _timer_idle_exit(void) if (_SysIdleElapsedTicks) { /* Announce elapsed ticks to the microkernel */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } } diff --git a/arch/x86/timer/hpet.c b/arch/x86/timer/hpet.c index 227c723602..7807d0e314 100644 --- a/arch/x86/timer/hpet.c +++ b/arch/x86/timer/hpet.c @@ -76,7 +76,7 @@ In a nanokernel-only system this device driver omits more complex capabilities #include #include -extern struct nano_stack K_Args; +extern struct nano_stack _k_command_stack; #ifdef CONFIG_TICKLESS_IDLE #define TIMER_SUPPORTS_TICKLESS @@ -298,7 +298,7 @@ void _timer_int_handler(void *unused) * timer is already configured to interrupt on the following tick */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); #else @@ -335,7 +335,7 @@ void _timer_int_handler(void *unused) */ if (_SysIdleElapsedTicks == 1) { - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } #endif /* !TIMER_SUPPORTS_TICKLESS */ @@ -440,7 +440,7 @@ void _timer_idle_exit(void) * is * serviced. */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); /* timer interrupt handler reprograms the timer for the next * tick */ @@ -491,7 +491,7 @@ void _timer_idle_exit(void) if (_SysIdleElapsedTicks) { /* Announce elapsed ticks to the microkernel */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } /* diff --git a/arch/x86/timer/loApicTimer.c b/arch/x86/timer/loApicTimer.c index e6aec7dca4..e74ac6a9ce 100644 --- a/arch/x86/timer/loApicTimer.c +++ b/arch/x86/timer/loApicTimer.c @@ -144,7 +144,7 @@ static unsigned char _TimerMode = TIMER_MODE_PERIODIC; /* externs */ #ifdef CONFIG_MICROKERNEL -extern struct nano_stack K_Args; +extern struct nano_stack _k_command_stack; #endif /* CONFIG_MICROKERNEL */ /******************************************************************************* @@ -331,7 +331,7 @@ void _timer_int_handler(void *unused /* parameter is not used */ */ if (_SysIdleElapsedTicks == 1) { - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } #else @@ -340,7 +340,7 @@ void _timer_int_handler(void *unused /* parameter is not used */ #if defined(CONFIG_MICROKERNEL) /* announce tick into the microkernel */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); #endif #endif /*TIMER_SUPPORTS_TICKLESS*/ @@ -528,7 +528,7 @@ void _timer_idle_exit(void) * is * serviced. */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } else { uint32_t elapsed; /* elapsed "counter time" */ uint32_t remaining; /* remaining "counter time" */ @@ -552,7 +552,7 @@ void _timer_idle_exit(void) if (_SysIdleElapsedTicks) { /* Announce elapsed ticks to the microkernel */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } } _loApicTimerStart(); diff --git a/drivers/timer/i8253.c b/drivers/timer/i8253.c index 38b5f26ddd..f23fdab00d 100644 --- a/drivers/timer/i8253.c +++ b/drivers/timer/i8253.c @@ -154,7 +154,7 @@ static uint32_t oldAcc = 0; /* previous accumulated value value */ /* externs */ #ifdef CONFIG_MICROKERNEL -extern struct nano_stack K_Args; +extern struct nano_stack _k_command_stack; #endif /* ! CONFIG_MICROKERNEL */ #ifdef __DCC__ @@ -297,7 +297,7 @@ void _timer_int_handler(void *unusedArg /* not used */ */ if (_SysIdleElapsedTicks == 1) { - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } /* accumulate total counter value */ @@ -306,7 +306,7 @@ void _timer_int_handler(void *unusedArg /* not used */ #else #if defined(CONFIG_MICROKERNEL) /* announce tick into the microkernel */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); #endif /* accumulate total counter value */ @@ -476,7 +476,7 @@ void _timer_idle_exit(void) * is * serviced. */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } else { uint16_t elapsed; /* elapsed "counter time" */ uint16_t remaining; /* remaing "counter time" */ @@ -499,7 +499,7 @@ void _timer_idle_exit(void) if (_SysIdleElapsedTicks) { /* Announce elapsed ticks to the microkernel */ - nano_isr_stack_push(&K_Args, TICK_EVENT); + nano_isr_stack_push(&_k_command_stack, TICK_EVENT); } } } diff --git a/kernel/microkernel/core/global.c b/kernel/microkernel/core/global.c index 9454865d15..53149f6afc 100644 --- a/kernel/microkernel/core/global.c +++ b/kernel/microkernel/core/global.c @@ -51,7 +51,7 @@ extern char _k_server_stack[]; /* generated by SYSGEN */ */ uint32_t _k_task_priority_bitmap[2] = {0, (1u << 31)}; -struct nano_stack __noinit K_Args; +struct nano_stack __noinit _k_command_stack; #ifdef CONFIG_TASK_DEBUG @@ -87,7 +87,7 @@ void kernel_init(void) #ifdef CONFIG_INIT_STACKS k_memset((char *)_k_server_command_stack_storage, 0xaa, sizeof(_k_server_command_stack_storage)); #endif - nano_stack_init(&K_Args, _k_server_command_stack_storage); + nano_stack_init(&_k_command_stack, _k_server_command_stack_storage); task_fiber_start((char *)_k_server_stack, K_StackSize, diff --git a/kernel/microkernel/core/taskcall.c b/kernel/microkernel/core/taskcall.c index eef0f0a72b..62f3de0c9d 100644 --- a/kernel/microkernel/core/taskcall.c +++ b/kernel/microkernel/core/taskcall.c @@ -49,5 +49,5 @@ void K_taskcall(struct k_args *cmdpacket) { cmdpacket->alloc = false; _k_current_task->Args = cmdpacket; - nano_task_stack_push(&K_Args, (uint32_t)cmdpacket); + nano_task_stack_push(&_k_command_stack, (uint32_t)cmdpacket); } diff --git a/kernel/microkernel/include/minik.h b/kernel/microkernel/include/minik.h index c1fea8eb24..06121bed4d 100644 --- a/kernel/microkernel/include/minik.h +++ b/kernel/microkernel/include/minik.h @@ -69,7 +69,7 @@ extern K_TIMER *_k_timer_list_tail; #endif extern int64_t _k_sys_clock_tick_count; -extern struct nano_stack K_Args; +extern struct nano_stack _k_command_stack; extern struct nano_lifo LinkIn[6]; extern struct nano_lifo LinkOut[6]; extern struct nano_lifo K_DataFree; @@ -249,6 +249,6 @@ extern void wlMonitorCalibrate(void); #define TO_ALIST(L, A) _Cpsh((L), (uint32_t)(A)) -#define SENDARGS(A) _Cpsh(&K_Args, (uint32_t)(A)) +#define SENDARGS(A) _Cpsh(&_k_command_stack, (uint32_t)(A)) #endif diff --git a/kernel/microkernel/k_event.c b/kernel/microkernel/k_event.c index 2560dbfd11..35aa619dd8 100644 --- a/kernel/microkernel/k_event.c +++ b/kernel/microkernel/k_event.c @@ -295,5 +295,5 @@ FUNC_ALIAS(isr_event_send, fiber_event_send, void); void isr_event_send(kevent_t event /* event to signal */ ) { - nano_isr_stack_push(&K_Args, (uint32_t)event); + nano_isr_stack_push(&_k_command_stack, (uint32_t)event); } diff --git a/kernel/microkernel/k_mbox.c b/kernel/microkernel/k_mbox.c index 84a8d08540..0694f49ea4 100644 --- a/kernel/microkernel/k_mbox.c +++ b/kernel/microkernel/k_mbox.c @@ -884,7 +884,7 @@ int _task_mbox_data_get_async_block(struct k_msg *message, __ASSERT_NO_MSG(NULL == Writer->Forw); Writer->Args.m1.mess.tx_block.poolid = (uint32_t)(-1); - nano_task_stack_push(&K_Args, (uint32_t)Writer); + nano_task_stack_push(&_k_command_stack, (uint32_t)Writer); #ifdef ACTIV_ASSERTS struct k_args *Dummy; diff --git a/kernel/microkernel/k_mempool.c b/kernel/microkernel/k_mempool.c index e1e0e4d0d0..a9e9743a38 100644 --- a/kernel/microkernel/k_mempool.c +++ b/kernel/microkernel/k_mempool.c @@ -221,7 +221,7 @@ void K_Defrag(struct k_args *A) GETARGS(NewGet); *NewGet = *A; NewGet->Comm = GET_BLOCK_WAIT; - TO_ALIST(&K_Args, NewGet); /*push on command stack */ + TO_ALIST(&_k_command_stack, NewGet); /*push on command stack */ } } @@ -645,7 +645,7 @@ void K_RelBlock(struct k_args *A) GETARGS(NewGet); *NewGet = *A; NewGet->Comm = GET_BLOCK_WAIT; - TO_ALIST(&K_Args, NewGet); /* push on command stack */ + TO_ALIST(&_k_command_stack, NewGet); /* push on command stack */ } if (A->alloc) { FREEARGS(A); diff --git a/kernel/microkernel/k_sema.c b/kernel/microkernel/k_sema.c index 1bf2b49f46..a05401a970 100644 --- a/kernel/microkernel/k_sema.c +++ b/kernel/microkernel/k_sema.c @@ -581,7 +581,7 @@ void isr_sem_give(ksem_t sema, /* semaphore to signal */ pCommand->Comm = SIGNALS; pCommand->Args.s1.sema = sema; - nano_isr_stack_push(&K_Args, (uint32_t)pCommand); + nano_isr_stack_push(&_k_command_stack, (uint32_t)pCommand); } /******************************************************************************* diff --git a/kernel/microkernel/k_timer.c b/kernel/microkernel/k_timer.c index c22558aab7..8d3d626325 100644 --- a/kernel/microkernel/k_timer.c +++ b/kernel/microkernel/k_timer.c @@ -172,7 +172,7 @@ void force_timeout(struct k_args *A) if (T->Ti != -1) { delist_timer(T); - TO_ALIST(&K_Args, A); + TO_ALIST(&_k_command_stack, A); } } diff --git a/kernel/microkernel/timer/ticker.c b/kernel/microkernel/timer/ticker.c index 9ae17270af..7dbc9c2c0f 100644 --- a/kernel/microkernel/timer/ticker.c +++ b/kernel/microkernel/timer/ticker.c @@ -114,7 +114,7 @@ static inline void _HandleExpiredTimers(int ticks) } else { T->Ti = -1; } - TO_ALIST(&K_Args, T->Args); + TO_ALIST(&_k_command_stack, T->Args); ticks = 0; /* don't decrement Ti for subsequent timer(s) */ } diff --git a/kernel/nanokernel/core/microk.c b/kernel/nanokernel/core/microk.c index 0f2774d27a..ca108968e8 100644 --- a/kernel/nanokernel/core/microk.c +++ b/kernel/nanokernel/core/microk.c @@ -86,7 +86,7 @@ FUNC_NORETURN void K_swapper(int parameter1, /* not used */ while (1) { /* forever */ pArgs = (struct k_args *)nano_fiber_stack_pop_wait( - &K_Args); /* will schedule */ + &_k_command_stack); /* will schedule */ do { kevent_t event; /* if event < K_max_eventnr, it's a well-known event */ @@ -113,7 +113,7 @@ FUNC_NORETURN void K_swapper(int parameter1, /* not used */ if (_NanoKernel.fiber) { fiber_yield(); } - } while (nano_fiber_stack_pop(&K_Args, (void *)&pArgs)); + } while (nano_fiber_stack_pop(&_k_command_stack, (void *)&pArgs)); /* * Always check higher priorities (lower numbers) first.