Changed the makefile system to autoconf/automake.
[cacao.git] / alpha / threads.h
1 /****************************** threads.h **************************************
2
3         Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
4
5         See file COPYRIGHT for information on usage and disclaimer of warranties
6
7         System dependent part of thread header file.
8
9         Authors: Mark Probst         EMAIL: cacao@complang.tuwien.ac.at
10                  Andreas  Krall      EMAIL: cacao@complang.tuwien.ac.at
11
12         Last Change: 1998/11/19
13
14 *******************************************************************************/
15
16
17 #ifndef __sysdep_threads_h
18 #define __sysdep_threads_h
19
20 #include "config.h"
21 #include "threads/thread.h"
22
23 /* Thread handling */
24
25 /* prototypes */
26
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);
30
31 /* access macros */
32
33 #define THREADSTACKSIZE         (32 * 1024)
34
35 #define THREADSWITCH(to, from)  asm_perform_threadswitch(&(from)->restorePoint,\
36                                     &(to)->restorePoint, &(from)->usedStackTop)
37
38 #define THREADINIT(to, func)    (to)->restorePoint =                         \
39                                     asm_initialize_thread_stack((u1*)(func), \
40                                                             (to)->stackEnd)
41
42 #define THREADINFO(e)                               \
43                 do {                                        \
44                         (e)->restorePoint = 0;                  \
45                         (e)->flags = THREAD_FLAGS_NOSTACKALLOC; \
46                 } while(0)
47
48 #endif