Files
codezero/conts/libl4thread/include/l4thread/thread.h
Bora Sahin 682c62f8bb A fix and a helper macro for the thread library.
The fix solves the problem of giving the last slice from a pool.

The helper macro makes utcb space creation easy for the user because we have to
consider a few things like alignment and total allocated space.
2009-11-16 21:49:37 +02:00

23 lines
650 B
C

/*
* Thread creation userspace helpers
*
* Copyright (C) 2009 B Labs Ltd.
*/
#ifndef __LIB_THREAD_H__
#define __LIB_THREAD_H__
/* A helper macro easing utcb space creation. */
#define DECLARE_UTCB_SPACE(name, entries) \
char name[(entries + PAGE_SIZE / UTCB_SIZE) * UTCB_SIZE] ALIGN(PAGE_SIZE);
int l4_set_stack_params(unsigned long stack_top,
unsigned long stack_bottom,
unsigned long stack_size);
int l4_set_utcb_params(unsigned long utcb_start, unsigned long utcb_end);
int l4_thread_create(struct task_ids *ids, unsigned int flags,
int (*func)(void *), void *arg);
void l4_thread_exit(int retval);
#endif /* __LIB_THREAD_H__ */