From 328040e98acd45e8387c8aa5daf9b5c21f1d1d84 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Mon, 23 Nov 2009 13:18:58 +0200 Subject: [PATCH] Renamed all thread symbols in l4lib with l4lib_ prefix. They were clasing with mm0 The threading work will be revised and prefixes changed to a more meaningful name later on. --- conts/libl4/include/l4lib/tcb.h | 16 ++++++++-------- conts/libl4/include/l4lib/utcb-common.h | 10 +++++----- conts/libl4/include/l4lib/utcb.h | 4 ++-- conts/libl4/src/tcb.c | 18 +++++++++--------- conts/libl4/src/thread.c | 22 +++++++++++----------- conts/libl4/src/utcb-common.c | 10 +++++----- conts/libl4/src/utcb.c | 14 +++++++------- 7 files changed, 47 insertions(+), 47 deletions(-) diff --git a/conts/libl4/include/l4lib/tcb.h b/conts/libl4/include/l4lib/tcb.h index 947317a..859c992 100644 --- a/conts/libl4/include/l4lib/tcb.h +++ b/conts/libl4/include/l4lib/tcb.h @@ -9,12 +9,12 @@ #include /* Keeps all the struct utcb_descs belonging to a thread group together. */ -struct utcb_head { +struct l4lib_utcb_head { struct link list; }; /* A simple thread control block for the thread library. */ -struct tcb { +struct l4lib_tcb { /* Task list */ struct link list; @@ -22,7 +22,7 @@ struct tcb { int tid; /* Chain of utcb descriptors */ - struct utcb_head *utcb_head; + struct l4lib_utcb_head *utcb_head; /* Stack and utcb address */ unsigned long utcb_addr; @@ -30,14 +30,14 @@ struct tcb { }; /* All the threads handled by the thread lib are kept in this list. */ -struct global_list { +struct l4lib_global_list { int total; struct link list; }; -struct tcb *find_task(int tid); -struct tcb *l4_tcb_alloc_init(struct tcb *parent, unsigned int flags); -void global_add_task(struct tcb *task); -void global_remove_task(struct tcb *task); +struct l4lib_tcb *l4lib_find_task(int tid); +struct l4lib_tcb *l4_tcb_alloc_init(struct l4lib_tcb *parent, unsigned int flags); +void l4lib_l4lib_global_add_task(struct l4lib_tcb *task); +void l4lib_global_remove_task(struct l4lib_tcb *task); #endif /* __LIB_TCB_H__ */ diff --git a/conts/libl4/include/l4lib/utcb-common.h b/conts/libl4/include/l4lib/utcb-common.h index 47d71f8..5fd2677 100644 --- a/conts/libl4/include/l4lib/utcb-common.h +++ b/conts/libl4/include/l4lib/utcb-common.h @@ -8,7 +8,7 @@ #include -struct utcb_desc { +struct l4lib_utcb_desc { struct link list; unsigned long utcb_base; struct id_pool *slots; @@ -16,10 +16,10 @@ struct utcb_desc { int utcb_pool_init(unsigned long utcb_start, unsigned long utcb_end); -unsigned long utcb_new_slot(struct utcb_desc *desc); -int utcb_delete_slot(struct utcb_desc *desc, unsigned long address); +unsigned long utcb_new_slot(struct l4lib_utcb_desc *desc); +int utcb_delete_slot(struct l4lib_utcb_desc *desc, unsigned long address); -struct utcb_desc *utcb_new_desc(void); -int utcb_delete_desc(struct utcb_desc *desc); +struct l4lib_utcb_desc *utcb_new_desc(void); +int utcb_delete_desc(struct l4lib_utcb_desc *desc); #endif /* __UTCB_COMMON_H__ */ diff --git a/conts/libl4/include/l4lib/utcb.h b/conts/libl4/include/l4lib/utcb.h index 3dc4ab4..682b840 100644 --- a/conts/libl4/include/l4lib/utcb.h +++ b/conts/libl4/include/l4lib/utcb.h @@ -15,8 +15,8 @@ int utcb_init(void); /* Checks if l4_set_stack_params is called. */ #define IS_UTCB_SETUP() (lib_utcb_range_size) -unsigned long get_utcb_addr(struct tcb *task); -int delete_utcb_addr(struct tcb *task); +unsigned long get_utcb_addr(struct l4lib_tcb *task); +int delete_utcb_addr(struct l4lib_tcb *task); /* Bora end */ #endif /* __UTCB_H__ */ diff --git a/conts/libl4/src/tcb.c b/conts/libl4/src/tcb.c index 052740c..e806f12 100644 --- a/conts/libl4/src/tcb.c +++ b/conts/libl4/src/tcb.c @@ -11,29 +11,29 @@ #include /* Global task list. */ -struct global_list global_tasks = { +struct l4lib_global_list global_tasks = { .list = { &global_tasks.list, &global_tasks.list }, .total = 0, }; /* Function definitions */ -void global_add_task(struct tcb *task) +void global_add_task(struct l4lib_tcb *task) { BUG_ON(!list_empty(&task->list)); list_insert_tail(&task->list, &global_tasks.list); global_tasks.total++; } -void global_remove_task(struct tcb *task) +void l4lib_global_remove_task(struct l4lib_tcb *task) { BUG_ON(list_empty(&task->list)); list_remove_init(&task->list); BUG_ON(--global_tasks.total < 0); } -struct tcb *find_task(int tid) +struct l4lib_tcb * l4lib_find_task(int tid) { - struct tcb *t; + struct l4lib_tcb *t; list_foreach_struct(t, &global_tasks.list, list) if (t->tid == tid) @@ -41,11 +41,11 @@ struct tcb *find_task(int tid) return 0; } -struct tcb *l4_tcb_alloc_init(struct tcb *parent, unsigned int flags) +struct l4lib_tcb *l4_tcb_alloc_init(struct l4lib_tcb *parent, unsigned int flags) { - struct tcb *task; + struct l4lib_tcb *task; - if (!(task = kzalloc(sizeof(struct tcb)))) + if (!(task = kzalloc(sizeof(struct l4lib_tcb)))) return PTR_ERR(-ENOMEM); link_init(&task->list); @@ -54,7 +54,7 @@ struct tcb *l4_tcb_alloc_init(struct tcb *parent, unsigned int flags) task->utcb_head = parent->utcb_head; else { /* COPY or NEW space */ - if (!(task->utcb_head = kzalloc(sizeof(struct utcb_head)))) { + if (!(task->utcb_head = kzalloc(sizeof(struct l4lib_utcb_head)))) { kfree(task); return PTR_ERR(-ENOMEM); } diff --git a/conts/libl4/src/thread.c b/conts/libl4/src/thread.c index db2f294..3c9f5f6 100644 --- a/conts/libl4/src/thread.c +++ b/conts/libl4/src/thread.c @@ -28,7 +28,7 @@ int l4_thread_create(struct task_ids *ids, unsigned int flags, { struct exregs_data exregs; unsigned long utcb_addr; - struct tcb *parent, *child; + struct l4lib_tcb *parent, *child; unsigned long stack_top_addr, stack_bot_addr; int err = 0; @@ -42,14 +42,14 @@ int l4_thread_create(struct task_ids *ids, unsigned int flags, /* Before doing any operation get the global mutex. */ l4_mutex_lock(&lib_mutex); - /* Get parent's ids and find the tcb belonging to it. */ + /* Get parent's ids and find the l4lib_tcb belonging to it. */ l4_getid(ids); - if (!(parent = find_task(ids->tid))) { + if (!(parent = l4lib_find_task(ids->tid))) { err = -ESRCH; goto out_err1; } - /* Allocate tcb for the child. */ + /* Allocate l4lib_tcb for the child. */ if (!(child = l4_tcb_alloc_init(parent, flags))) { // FIXME: What happens to utcb_head printf("libl4thread: No heap space left.\n"); @@ -118,7 +118,7 @@ int l4_thread_create(struct task_ids *ids, unsigned int flags, /* Error handling. */ out_err6: - global_remove_task(child); + l4lib_global_remove_task(child); out_err5: l4_thread_control(THREAD_DESTROY, ids); out_err4: @@ -137,7 +137,7 @@ out_err1: void l4_thread_exit(int retval) { - struct tcb *task; + struct l4lib_tcb *task; struct task_ids ids; /* Before doing any operation get the global mutex. */ @@ -146,11 +146,11 @@ void l4_thread_exit(int retval) /* Find the task. */ l4_getid(&ids); /* Cant find the thread means it wasnt added to the list. */ - if (!(task = find_task(ids.tid))) + if (!(task = l4lib_find_task(ids.tid))) BUG(); /* Remove child from the global task list. */ - global_remove_task(task); + l4lib_global_remove_task(task); /* Delete the stack space. */ if (delete_stack_space((void *)task->stack_addr) < 0) @@ -175,19 +175,19 @@ void l4_thread_exit(int retval) int l4_thread_kill(struct task_ids *ids) { - struct tcb *task; + struct l4lib_tcb *task; /* Before doing any operation get the global mutex. */ l4_mutex_lock(&lib_mutex); /* Find the task to be killed. */ - if (!(task = find_task(ids->tid))) { + if (!(task = l4lib_find_task(ids->tid))) { l4_mutex_unlock(&lib_mutex); return -ESRCH; } /* Remove child from the global task list. */ - global_remove_task(task); + l4lib_global_remove_task(task); /* Delete the stack space. */ if (delete_stack_space((void *)task->stack_addr) < 0) diff --git a/conts/libl4/src/utcb-common.c b/conts/libl4/src/utcb-common.c index eff2699..7d54253 100644 --- a/conts/libl4/src/utcb-common.c +++ b/conts/libl4/src/utcb-common.c @@ -37,7 +37,7 @@ static inline int utcb_delete_address(void *utcb_address, int nitems) } /* Return an empty utcb slot in this descriptor */ -unsigned long utcb_new_slot(struct utcb_desc *desc) +unsigned long utcb_new_slot(struct l4lib_utcb_desc *desc) { int slot; @@ -47,16 +47,16 @@ unsigned long utcb_new_slot(struct utcb_desc *desc) return desc->utcb_base + (unsigned long)slot * UTCB_SIZE; } -int utcb_delete_slot(struct utcb_desc *desc, unsigned long address) +int utcb_delete_slot(struct l4lib_utcb_desc *desc, unsigned long address) { BUG_ON(id_del(desc->slots, (address - desc->utcb_base) / UTCB_SIZE) < 0); return 0; } -struct utcb_desc *utcb_new_desc(void) +struct l4lib_utcb_desc *utcb_new_desc(void) { - struct utcb_desc *d; + struct l4lib_utcb_desc *d; /* Allocate a new descriptor */ if (!(d = kzalloc(sizeof(*d)))) @@ -81,7 +81,7 @@ struct utcb_desc *utcb_new_desc(void) return d; } -int utcb_delete_desc(struct utcb_desc *desc) +int utcb_delete_desc(struct l4lib_utcb_desc *desc) { /* Return descriptor address */ utcb_delete_address((void *)desc->utcb_base, 1); diff --git a/conts/libl4/src/utcb.c b/conts/libl4/src/utcb.c index caca0d6..dfd3f6c 100644 --- a/conts/libl4/src/utcb.c +++ b/conts/libl4/src/utcb.c @@ -13,15 +13,15 @@ #include /* Extern declarations */ -extern struct global_list global_tasks; +extern struct l4lib_global_list global_tasks; /* Global variables */ unsigned long lib_utcb_range_size; /* Function definitions */ -unsigned long get_utcb_addr(struct tcb *task) +unsigned long get_utcb_addr(struct l4lib_tcb *task) { - struct utcb_desc *udesc; + struct l4lib_utcb_desc *udesc; unsigned long slot; /* Setting this up twice is a bug. */ @@ -43,9 +43,9 @@ found: return slot; } -int delete_utcb_addr(struct tcb *task) +int delete_utcb_addr(struct l4lib_tcb *task) { - struct utcb_desc *udesc; + struct l4lib_utcb_desc *udesc; list_foreach_struct(udesc, &task->utcb_head->list, list) { /* FIXME: Use variable alignment than a page */ @@ -72,8 +72,8 @@ static int set_utcb_addr(void) { struct exregs_data exregs; struct task_ids ids; - struct tcb *task; - struct utcb_desc *udesc; + struct l4lib_tcb *task; + struct l4lib_utcb_desc *udesc; int err; /* Create a task. */