3 * i386 threading information.
5 * Copyright (c) 1996 T. J. Wilkinson & Associates, London, UK.
7 * See the file "license.terms" for information on usage and redistribution
8 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 * Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
12 * See file COPYRIGHT for information on usage and disclaimer of warranties
14 * Written by Tim Wilkinson <tim@tjwassoc.demon.co.uk>, 1996.
17 #ifndef __alpha_threads_h
18 #define __alpha_threads_h
24 #include "../threads/thread.h"
26 void perform_alpha_threadswitch (u1 **from, u1 **to);
27 u1* initialize_thread_stack (void *func, u1 *stack);
28 u1* used_stack_top (void);
30 #define THREADSTACKSIZE (64 * 1024)
32 #define THREADSWITCH(to, from) perform_alpha_threadswitch(&(from)->restorePoint,\
35 #define THREADINIT(to, func) (to)->restorePoint = \
36 initialize_thread_stack((u1*)(func), \
39 #define USEDSTACKTOP(top) (top) = used_stack_top()
41 #define THREADINFO(ee) \
43 (ee)->restorePoint = 0; \
44 (ee)->flags = THREAD_FLAGS_NOSTACKALLOC;\
49 asm("addq $30,$31,%0" : "=r" (ptr)); \
50 (ee)->stackEnd = ptr; \
51 (ee)->stackBase = (ee)->stackEnd - threadStackSize;\
55 #define THREADFRAMES(tid, cnt) \
59 if (tid == currentThread) { \
60 asm("movl %%ebp,%0" : "=r" (ptr));\
63 ptr = ((void***)tid->PrivateInfo->restorePoint)[2];\