mirror of
https://github.com/drasko/codezero.git
synced 2026-01-22 07:43:21 +01:00
The first step in creating a thread library.
The difference between this thread library and the existing ones like pthreads is the necessity of informing the library about the address range of the stack and the l4 specific utcb. Utcb has not been supported yet. As for stack, there is also a drawback: library does not support mapping. In other words, the stack area in question has to be already mapped-in. Thus, for now we only support threads sharing their address spaces: TC_SHARE_SPACE. In this respect, it is very similar to pthreads.
This commit is contained in:
@@ -1,9 +1,19 @@
|
||||
/*
|
||||
* Thread creation userspace helpers
|
||||
*
|
||||
* Copyright (C) 2009 B Labs Ltd.
|
||||
*/
|
||||
#ifndef __LIB_THREAD_H__
|
||||
#define __LIB_THREAD_H__
|
||||
|
||||
void l4thread_print(void);
|
||||
#define STACK_TOP_ADDR(stack) ((unsigned long)(stack))
|
||||
#define STACK_BOTTOM_ADDR(stack) \
|
||||
((unsigned long)((stack) + (sizeof(stack))))
|
||||
|
||||
int set_stack_params(unsigned long stack_top_addr,
|
||||
unsigned long stack_bottom_addr,
|
||||
unsigned long stack_size);
|
||||
int thread_create(struct task_ids *ids, unsigned int flags,
|
||||
int (*func)(void *), void *arg);
|
||||
|
||||
#endif /* __LIB_THREAD_H__ */
|
||||
|
||||
Reference in New Issue
Block a user