mirror of
https://github.com/drasko/codezero.git
synced 2026-03-05 03:53:13 +01:00
The second step in creating a thread library.
UTCB support has beed added. It has the same drawback as in the stack support: the area in question has to be already mapped-in. There are also some minor fixes for the stack support and the utcb common helper routines.
This commit is contained in:
@@ -6,13 +6,21 @@
|
||||
#ifndef __LIB_THREAD_H__
|
||||
#define __LIB_THREAD_H__
|
||||
|
||||
#define STACK_TOP_ADDR(stack) ((unsigned long)(stack))
|
||||
#define STACK_BOTTOM_ADDR(stack) \
|
||||
((unsigned long)((stack) + (sizeof(stack))))
|
||||
#define START_ADDR(addr) ((unsigned long)(addr))
|
||||
#define END_ADDR(addr) ((unsigned long)((addr) + (sizeof(addr))))
|
||||
|
||||
#define STACK_TOP_ADDR(stack) (START_ADDR(stack))
|
||||
#define STACK_BOTTOM_ADDR(stack) (END_ADDR(stack))
|
||||
|
||||
#define UTCB_START_ADDR(utcb) (START_ADDR(utcb))
|
||||
#define UTCB_END_ADDR(utcb) (END_ADDR(utcb))
|
||||
|
||||
int set_stack_params(unsigned long stack_top_addr,
|
||||
unsigned long stack_bottom_addr,
|
||||
unsigned long stack_size);
|
||||
int set_utcb_params(unsigned long utcb_start_addr,
|
||||
unsigned long utcb_end_addr);
|
||||
|
||||
int thread_create(struct task_ids *ids, unsigned int flags,
|
||||
int (*func)(void *), void *arg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user