microkernel: rename k_proc to k_task
k_proc was a legacy leftover that does not make any sense, since there is no concept of a "process" in the system. Rather, that data structure refers to a 'task control block', i.e. the representation of a task execution context from the microkernel's point-of-view (not to confuse with the 'struct ccs', the representation of a thread execution context, from the nanokernel's point-of-view). Change-Id: Ic29db565af023be629ce740bbcb652ece7dc359f Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
c45fc04952
commit
bed144b179
12 changed files with 37 additions and 37 deletions
|
@ -59,7 +59,7 @@ Intel-specific parts of start_task(). Only FP functionality currently.
|
|||
*/
|
||||
|
||||
void _StartTaskArch(
|
||||
struct k_proc *X, /* ptr to task control block */
|
||||
struct k_task *X, /* ptr to task control block */
|
||||
unsigned int *pOpt /* context options container */
|
||||
)
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ Intel-specific parts of start_task(). Only FP functionality currently.
|
|||
#include <nano_private.h>
|
||||
#include <microkernel/task.h>
|
||||
|
||||
extern void _StartTaskArch(struct k_proc *, unsigned int *);
|
||||
extern void _StartTaskArch(struct k_task *, unsigned int *);
|
||||
|
||||
#define _START_TASK_ARCH(pKproc, pOpt) _StartTaskArch(pKproc, pOpt)
|
||||
|
||||
|
|
|
@ -105,9 +105,9 @@ struct k_msg {
|
|||
|
||||
/* Task control block */
|
||||
|
||||
struct k_proc {
|
||||
struct k_proc *Forw;
|
||||
struct k_proc *Back;
|
||||
struct k_task {
|
||||
struct k_task *Forw;
|
||||
struct k_task *Back;
|
||||
kpriority_t Prio;
|
||||
ktask_t Ident;
|
||||
uint32_t State;
|
||||
|
|
|
@ -51,7 +51,7 @@ extern "C" {
|
|||
#define USR_GROUP 2 /* TASKGROUP SYS */
|
||||
#define FPU_GROUP 4 /* TASKGROUP FPU */
|
||||
|
||||
extern struct k_proc _k_task_list[];
|
||||
extern struct k_task _k_task_list[];
|
||||
|
||||
extern void _task_ioctl(ktask_t, int);
|
||||
extern void _task_group_ioctl(ktask_group_t, int);
|
||||
|
@ -104,7 +104,7 @@ extern void task_group_leave(uint32_t groups);
|
|||
#define isr_task_group_mask_get() task_group_mask_get()
|
||||
|
||||
/**
|
||||
* @brief Initialize a struct k_proc given parameters.
|
||||
* @brief Initialize a struct k_task given parameters.
|
||||
*
|
||||
* @param ident Numeric identifier of this task object.
|
||||
* @param priority Priority of task.
|
||||
|
@ -137,7 +137,7 @@ extern void task_group_leave(uint32_t groups);
|
|||
#define DEFINE_TASK(name, priority, entry, stack_size, groups) \
|
||||
extern void entry(void); \
|
||||
char __noinit __stack __stack_##name[stack_size]; \
|
||||
struct k_proc _k_task_obj_##name \
|
||||
struct k_task _k_task_obj_##name \
|
||||
__section(_k_task_list, private, task) = \
|
||||
__K_TASK_INITIALIZER( \
|
||||
(ktask_t)&_k_task_obj_##name, \
|
||||
|
|
|
@ -50,7 +50,7 @@ extern int _k_mem_pool_count;
|
|||
|
||||
extern const int _k_num_events;
|
||||
|
||||
extern struct k_proc *_k_current_task;
|
||||
extern struct k_task *_k_current_task;
|
||||
extern uint32_t _k_task_priority_bitmap[];
|
||||
|
||||
extern struct k_timer *_k_timer_list_head;
|
||||
|
@ -71,8 +71,8 @@ extern void _k_timer_list_update(int ticks);
|
|||
|
||||
extern void _k_do_event_signal(kevent_t event);
|
||||
|
||||
extern void _k_state_bit_set(struct k_proc *, uint32_t);
|
||||
extern void _k_state_bit_reset(struct k_proc *, uint32_t);
|
||||
extern void _k_state_bit_set(struct k_task *, uint32_t);
|
||||
extern void _k_state_bit_reset(struct k_task *, uint32_t);
|
||||
extern void _k_task_call(struct k_args *);
|
||||
|
||||
/*
|
||||
|
@ -138,7 +138,7 @@ typedef void (*k_task_monitor_hook_t)(ktask_t taskid, uint32_t timestamp);
|
|||
|
||||
extern void task_monitor_hook_set(k_task_monitor_hook_t func);
|
||||
|
||||
extern void _k_task_monitor(struct k_proc *, uint32_t d2);
|
||||
extern void _k_task_monitor(struct k_task *, uint32_t d2);
|
||||
extern void _k_task_monitor_args(struct k_args *);
|
||||
extern void _k_task_monitor_read(struct k_args *);
|
||||
|
||||
|
|
|
@ -141,8 +141,8 @@ struct k_timer {
|
|||
/* Task queue header */
|
||||
|
||||
struct k_tqhd {
|
||||
struct k_proc *Head;
|
||||
struct k_proc *Tail;
|
||||
struct k_task *Head;
|
||||
struct k_task *Tail;
|
||||
};
|
||||
|
||||
/* Monitor record */
|
||||
|
@ -232,7 +232,7 @@ struct _pipe_xfer_ack_arg {
|
|||
|
||||
typedef union {
|
||||
ktask_t task;
|
||||
struct k_proc *proc;
|
||||
struct k_task *proc;
|
||||
struct k_args *args;
|
||||
} K_CREF;
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ void _k_mbox_send_request(struct k_args *Writer)
|
|||
|
||||
bAsync = ISASYNCMSG(&Writer->Args.m1.mess);
|
||||
|
||||
struct k_proc *sender = NULL;
|
||||
struct k_task *sender = NULL;
|
||||
|
||||
/*
|
||||
* Only deschedule the task if it is not a poster
|
||||
|
|
|
@ -61,7 +61,7 @@ extern const kernelfunc _k_server_dispatch_table[];
|
|||
* @return pointer to selected task
|
||||
*/
|
||||
|
||||
static struct k_proc *next_task_select(void)
|
||||
static struct k_task *next_task_select(void)
|
||||
{
|
||||
int K_PrioListIdx;
|
||||
|
||||
|
@ -100,7 +100,7 @@ static struct k_proc *next_task_select(void)
|
|||
FUNC_NORETURN void _k_server(int unused1, int unused2)
|
||||
{
|
||||
struct k_args *pArgs;
|
||||
struct k_proc *pNextTask;
|
||||
struct k_task *pNextTask;
|
||||
|
||||
ARG_UNUSED(unused1);
|
||||
ARG_UNUSED(unused2);
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
#include <nano_private.h>
|
||||
#include <start_task_arch.h>
|
||||
|
||||
extern struct k_proc _k_task_list_start[];
|
||||
extern struct k_proc _k_task_list_end[];
|
||||
extern struct k_task _k_task_list_start[];
|
||||
extern struct k_task _k_task_list_end[];
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -69,7 +69,7 @@ ktask_t task_id_get(void)
|
|||
* @return N/A
|
||||
*/
|
||||
|
||||
void _k_state_bit_reset(struct k_proc *X, /* ptr to task */
|
||||
void _k_state_bit_reset(struct k_task *X, /* ptr to task */
|
||||
uint32_t bits /* bitmask of TF_xxx
|
||||
bits to reset */
|
||||
)
|
||||
|
@ -122,7 +122,7 @@ void _k_state_bit_reset(struct k_proc *X, /* ptr to task */
|
|||
*/
|
||||
|
||||
void _k_state_bit_set(
|
||||
struct k_proc *task_ptr,
|
||||
struct k_task *task_ptr,
|
||||
uint32_t bits /* bitmask of TF_xxx bits to set */
|
||||
)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ void _k_state_bit_set(
|
|||
#endif
|
||||
#endif
|
||||
struct k_tqhd *task_queue = _k_task_priority_list + task_ptr->Prio;
|
||||
struct k_proc *cur_task = (struct k_proc *)(&task_queue->Head);
|
||||
struct k_task *cur_task = (struct k_task *)(&task_queue->Head);
|
||||
|
||||
/*
|
||||
* Search in the list for this task priority level,
|
||||
|
@ -202,7 +202,7 @@ void _k_state_bit_set(
|
|||
* @return N/A
|
||||
*/
|
||||
|
||||
static void start_task(struct k_proc *X, /* ptr to task control block */
|
||||
static void start_task(struct k_task *X, /* ptr to task control block */
|
||||
void (*func)(void) /* entry point for task */
|
||||
)
|
||||
{
|
||||
|
@ -246,7 +246,7 @@ static void start_task(struct k_proc *X, /* ptr to task control block */
|
|||
* @return N/A
|
||||
*/
|
||||
|
||||
static void abort_task(struct k_proc *X)
|
||||
static void abort_task(struct k_task *X)
|
||||
{
|
||||
|
||||
/* Do normal context exit cleanup */
|
||||
|
@ -329,7 +329,7 @@ void task_abort_handler_set(void (*func)(void) /* abort handler */
|
|||
void _k_task_op(struct k_args *A)
|
||||
{
|
||||
ktask_t Tid = A->Args.g1.task;
|
||||
struct k_proc *X = (struct k_proc *)Tid;
|
||||
struct k_task *X = (struct k_task *)Tid;
|
||||
|
||||
switch (A->Args.g1.opt) {
|
||||
case TASK_START:
|
||||
|
@ -387,7 +387,7 @@ void _k_task_group_op(struct k_args *A)
|
|||
{
|
||||
ktask_group_t grp = A->Args.g1.group;
|
||||
int opt = A->Args.g1.opt;
|
||||
struct k_proc *X;
|
||||
struct k_task *X;
|
||||
|
||||
#ifdef CONFIG_TASK_DEBUG
|
||||
if (opt == TASK_GROUP_BLOCK)
|
||||
|
@ -500,7 +500,7 @@ kpriority_t task_priority_get(void)
|
|||
void _k_task_priority_set(struct k_args *A)
|
||||
{
|
||||
ktask_t Tid = A->Args.g1.task;
|
||||
struct k_proc *X = (struct k_proc *)Tid;
|
||||
struct k_task *X = (struct k_task *)Tid;
|
||||
|
||||
_k_state_bit_set(X, TF_PRIO);
|
||||
X->Prio = A->Args.g1.prio;
|
||||
|
@ -547,7 +547,7 @@ void task_priority_set(ktask_t task, /* task whose priority is to be set */
|
|||
void _k_task_yield(struct k_args *A)
|
||||
{
|
||||
struct k_tqhd *H = _k_task_priority_list + _k_current_task->Prio;
|
||||
struct k_proc *X = _k_current_task->Forw;
|
||||
struct k_task *X = _k_current_task->Forw;
|
||||
|
||||
ARG_UNUSED(A);
|
||||
if (X && H->Head == _k_current_task) {
|
||||
|
@ -597,7 +597,7 @@ void task_entry_set(ktask_t task, /* task */
|
|||
void (*func)(void) /* entry point */
|
||||
)
|
||||
{
|
||||
struct k_proc *X = (struct k_proc *)task;
|
||||
struct k_task *X = (struct k_task *)task;
|
||||
|
||||
X->fstart = func;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ void task_monitor_hook_set(k_task_monitor_hook_t func)
|
|||
_k_task_switch_callback = func;
|
||||
}
|
||||
|
||||
void _k_task_monitor(struct k_proc *X, uint32_t D)
|
||||
void _k_task_monitor(struct k_task *X, uint32_t D)
|
||||
{
|
||||
#ifdef CONFIG_TASK_DEBUG
|
||||
if (!_k_debug_halt)
|
||||
|
|
|
@ -424,7 +424,7 @@ void task_timer_stop(ktimer_t timer)
|
|||
void _k_task_wakeup(struct k_args *P)
|
||||
{
|
||||
struct k_timer *T;
|
||||
struct k_proc *X;
|
||||
struct k_task *X;
|
||||
|
||||
X = P->Ctxt.proc;
|
||||
T = P->Time.timer;
|
||||
|
|
|
@ -400,7 +400,7 @@ def kernel_main_c_tasks():
|
|||
group_bitmask ^= group_dictionary['SYS']
|
||||
|
||||
kernel_main_c_out(
|
||||
"struct k_proc %s " % (obj_name)+
|
||||
"struct k_task %s " % (obj_name)+
|
||||
"__section(_k_task_list, public, task) =\n" +
|
||||
" {NULL, NULL, %d, (ktask_t)&%s,\n" % (prio, obj_name) +
|
||||
" 0x00000001, %#010x,\n" % (group_bitmask) +
|
||||
|
@ -408,7 +408,7 @@ def kernel_main_c_tasks():
|
|||
" (taskabortfunction)NULL, NULL};\n")
|
||||
|
||||
kernel_main_c_out(
|
||||
"struct k_proc _k_task_idle " +
|
||||
"struct k_task _k_task_idle " +
|
||||
"__section(_k_task_list, idle, task) =\n" +
|
||||
" {NULL, NULL, %d, 0x00000000,\n" % (num_prios - 1) +
|
||||
" 0x00000000, 0x00000000,\n" +
|
||||
|
@ -419,7 +419,7 @@ def kernel_main_c_tasks():
|
|||
# currently scheduled task (idle task)
|
||||
|
||||
kernel_main_c_out("\n" +
|
||||
"struct k_proc * _k_current_task = &_k_task_idle;\n")
|
||||
"struct k_task * _k_current_task = &_k_task_idle;\n")
|
||||
|
||||
|
||||
def kernel_main_c_priorities():
|
||||
|
@ -436,7 +436,7 @@ def kernel_main_c_priorities():
|
|||
"{\n")
|
||||
for i in range(1, num_prios):
|
||||
kernel_main_c_out(
|
||||
" {NULL, (struct k_proc *)&_k_task_priority_list[%d]},\n" %
|
||||
" {NULL, (struct k_task *)&_k_task_priority_list[%d]},\n" %
|
||||
(i - 1))
|
||||
kernel_main_c_out(
|
||||
" {&_k_task_idle, &_k_task_idle}\n" +
|
||||
|
@ -957,7 +957,7 @@ def generate_zephyr_h_obj_ids():
|
|||
for task in task_list:
|
||||
name = task[0];
|
||||
zephyr_h_data += \
|
||||
"extern struct k_proc _k_task_obj_%s;\n" % (name) + \
|
||||
"extern struct k_task _k_task_obj_%s;\n" % (name) + \
|
||||
"#define %s ((ktask_t)&_k_task_obj_%s)\n" % (name, name)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue