Locking is added to the thread library.

Now, we support thread trees which are spanning more than one level depth. Any
thread can create any number of threads provided that they are under the limits
which are enforced by the kernel.

Also with this commit, we have almost finished supporting SHARED space thread
creation in which stack and utcb space are allocated statically.
This commit is contained in:
Bora Sahin
2009-11-11 21:33:15 +02:00
parent 3149356ffc
commit 0e6dec0fee
6 changed files with 144 additions and 69 deletions

View File

@@ -6,11 +6,14 @@
#ifndef __LIB_STACK_H__
#define __LIB_STACK_H__
/* Symbolic constants and macros */
#define IS_STACK_SETUP() (lib_stack_size)
int stack_pool_init(unsigned long stack_start,
unsigned long stack_end,
unsigned long stack_size);
void *stack_new_space(int nitems, int size);
int stack_delete_space(void *stack_address, int nitems, int size);
void *get_stack_space(int nitems, int size);
int delete_stack_space(void *stack_address, int nitems, int size);
#endif /* __LIB_STACK_H__ */

View File

@@ -6,13 +6,13 @@
#ifndef __LIB_THREAD_H__
#define __LIB_THREAD_H__
int set_stack_params(unsigned long stack_top,
int l4_set_stack_params(unsigned long stack_top,
unsigned long stack_bottom,
unsigned long stack_size);
int set_utcb_params(unsigned long utcb_start, unsigned long utcb_end);
int l4_set_utcb_params(unsigned long utcb_start, unsigned long utcb_end);
int l4thread_create(struct task_ids *ids, unsigned int flags,
int (*func)(void *), void *arg);
void l4thread_kill(struct task_ids *ids);
int l4_thread_create(struct task_ids *ids, unsigned int flags,
void *(*func)(void *), void *arg);
void l4_thread_exit(void *retval);
#endif /* __LIB_THREAD_H__ */