1 /****************************** threads.h **************************************
3 Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
5 See file COPYRIGHT for information on usage and disclaimer of warranties
7 System dependent part of thread header file.
9 Authors: Mark Probst EMAIL: cacao@complang.tuwien.ac.at
10 Andreas Krall EMAIL: cacao@complang.tuwien.ac.at
12 Last Change: 1998/11/19
14 *******************************************************************************/
17 #ifndef __sysdep_threads_h
18 #define __sysdep_threads_h
21 #include "threads/thread.h"
27 void asm_perform_threadswitch (u1 **from, u1 **to, u1 **stackTop);
28 u1* asm_initialize_thread_stack (void *func, u1 *stack);
29 void asm_switchstackandcall (void *stack, void *func, void **stacktopsave);
33 #define THREADSTACKSIZE (32 * 1024)
35 #define THREADSWITCH(to, from) asm_perform_threadswitch(&(from)->restorePoint,\
36 &(to)->restorePoint, &(from)->usedStackTop)
38 #define THREADINIT(to, func) (to)->restorePoint = \
39 asm_initialize_thread_stack((u1*)(func), \
42 #define THREADINFO(e) \
44 (e)->restorePoint = 0; \
45 (e)->flags = THREAD_FLAGS_NOSTACKALLOC; \