From bf650d4fe50cf364bd279acd80b3b4df37f23961 Mon Sep 17 00:00:00 2001 From: Yonattan Louise Date: Mon, 27 Apr 2015 10:28:21 -0500 Subject: [PATCH] Rename K_TaskList to _k_task_list 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: I4c27dd98967dedbb15e28618f5dd8f26b919579d Signed-off-by: Yonattan Louise --- kernel/microkernel/include/minik.h | 2 +- kernel/microkernel/k_task.c | 8 ++++---- kernel/nanokernel/core/nanoinit.c | 6 +++--- scripts/sysgen.py | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/microkernel/include/minik.h b/kernel/microkernel/include/minik.h index 65be05fa2b..b6f8a06706 100644 --- a/kernel/microkernel/include/minik.h +++ b/kernel/microkernel/include/minik.h @@ -39,7 +39,7 @@ #define KERNEL_ENTRY(A) K_taskcall(A) extern const knode_t K_ThisNode; -extern struct k_proc K_TaskList[]; +extern struct k_proc _k_task_list[]; extern struct k_tqhd _k_task_priority_list[]; extern int K_TaskCount; diff --git a/kernel/microkernel/k_task.c b/kernel/microkernel/k_task.c index afdda2d2e1..d4878855d3 100644 --- a/kernel/microkernel/k_task.c +++ b/kernel/microkernel/k_task.c @@ -250,7 +250,7 @@ void task_abort_handler_set(void (*func)(void) /* abort handler */ void K_taskop(struct k_args *A) { ktask_t Tid = A->Args.g1.task; - struct k_proc *X = K_TaskList + OBJ_INDEX(Tid); + struct k_proc *X = _k_task_list + OBJ_INDEX(Tid); switch (A->Args.g1.opt) { case TASK_START: @@ -318,7 +318,7 @@ void K_groupop(struct k_args *A) K_DebugHalt = 0; #endif - for (i = 0, X = K_TaskList; i < K_TaskCount; i++, X++) { + for (i = 0, X = _k_task_list; i < K_TaskCount; i++, X++) { if (X->Group & grp) { switch (opt) { case GROUP_TASK_START: @@ -374,7 +374,7 @@ void _task_group_ioctl(ktask_group_t group, /* task group */ void K_set_prio(struct k_args *A) { ktask_t Tid = A->Args.g1.task; - struct k_proc *X = K_TaskList + OBJ_INDEX(Tid); + struct k_proc *X = _k_task_list + OBJ_INDEX(Tid); set_state_bit(X, TF_PRIO); X->Prio = A->Args.g1.prio; @@ -471,6 +471,6 @@ void task_entry_set(ktask_t task, /* task */ void (*func)(void) /* entry point */ ) { - K_TaskList[OBJ_INDEX(task)].fstart = func; + _k_task_list[OBJ_INDEX(task)].fstart = func; } diff --git a/kernel/nanokernel/core/nanoinit.c b/kernel/nanokernel/core/nanoinit.c index 5a3836ee17..fbb9c5df95 100644 --- a/kernel/nanokernel/core/nanoinit.c +++ b/kernel/nanokernel/core/nanoinit.c @@ -170,11 +170,11 @@ void _nano_init(tCCS *dummyOutContext, int argc, char *argv[], char *envp[]) _NanoKernel.task->flags |= ESSENTIAL; #if defined(CONFIG_MICROKERNEL) - /* fill in microkernel's TCB, which is the last element in K_TaskList[] + /* fill in microkernel's TCB, which is the last element in _k_task_list[] */ - K_TaskList[K_TaskCount].workspace = (char *)_NanoKernel.task; - K_TaskList[K_TaskCount].worksize = CONFIG_MAIN_STACK_SIZE; + _k_task_list[K_TaskCount].workspace = (char *)_NanoKernel.task; + _k_task_list[K_TaskCount].worksize = CONFIG_MAIN_STACK_SIZE; #endif /* diff --git a/scripts/sysgen.py b/scripts/sysgen.py index 9b36567a06..bd5d9ddf30 100755 --- a/scripts/sysgen.py +++ b/scripts/sysgen.py @@ -378,7 +378,7 @@ def kernel_main_c_tasks(): # task descriptors (including one for idle task) kernel_main_c_out("\n" + - "struct k_proc K_TaskList[%d] =\n" % (total_tasks) + + "struct k_proc _k_task_list[%d] =\n" % (total_tasks) + "{\n") ident = 0x00010000 for task in task_list: @@ -419,7 +419,7 @@ def kernel_main_c_tasks(): # currently scheduled task (idle task) kernel_main_c_out("\n" + - "struct k_proc * K_Task = &K_TaskList[%d];\n" % (total_tasks - 1)) + "struct k_proc * K_Task = &_k_task_list[%d];\n" % (total_tasks - 1)) def kernel_main_c_priorities(): @@ -437,7 +437,7 @@ def kernel_main_c_priorities(): kernel_main_c_out( " {NULL, (struct k_proc *)&_k_task_priority_list[%d]},\n" % (i - 1)) kernel_main_c_out( - " {&K_TaskList[%d], &K_TaskList[%d]}\n" % + " {&_k_task_list[%d], &_k_task_list[%d]}\n" % (total_tasks - 1, total_tasks - 1) + "};\n")