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
20 #include "../threads/thread.h"
26 void asm_perform_threadswitch (u1 **from, u1 **to, u1 **stackTop);
27 u1* asm_initialize_thread_stack (void *func, u1 *stack);
28 void asm_switchstackandcall (void *stack, void *func, void **stacktopsave);
32 #define THREADSTACKSIZE (32 * 1024)
34 #define THREADSWITCH(to, from) asm_perform_threadswitch(&(from)->restorePoint,\
35 &(to)->restorePoint, &(from)->usedStackTop)
37 #define THREADINIT(to, func) (to)->restorePoint = \
38 asm_initialize_thread_stack((u1*)(func), \
41 #define THREADINFO(e) \
43 (e)->restorePoint = 0; \
44 (e)->flags = THREAD_FLAGS_NOSTACKALLOC; \