initial mips threads.h
authorcacao <none@none>
Thu, 19 Nov 1998 21:13:04 +0000 (21:13 +0000)
committercacao <none@none>
Thu, 19 Nov 1998 21:13:04 +0000 (21:13 +0000)
mips/threads.h [new file with mode: 0644]

diff --git a/mips/threads.h b/mips/threads.h
new file mode 100644 (file)
index 0000000..828f6ef
--- /dev/null
@@ -0,0 +1,47 @@
+/****************************** threads.h **************************************
+
+       Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
+
+       See file COPYRIGHT for information on usage and disclaimer of warranties
+
+       System dependent part of thread header file.
+
+       Authors: Mark Probst         EMAIL: cacao@complang.tuwien.ac.at
+                Andreas  Krall      EMAIL: cacao@complang.tuwien.ac.at
+
+       Last Change: 1998/11/19
+
+*******************************************************************************/
+
+
+#ifndef __sysdep_threads_h
+#define __sysdep_threads_h
+
+#include "../threads/thread.h"
+
+/* Thread handling */
+
+/* prototypes */
+
+void asm_perform_threadswitch (u1 **from, u1 **to, u1 **stackTop);
+u1*  asm_initialize_thread_stack (void *func, u1 *stack);
+void asm_switchstackandcall (void *stack, void *func, void **stacktopsave);
+
+/* access macros */
+
+#define        THREADSTACKSIZE         (32 * 1024)
+
+#define        THREADSWITCH(to, from)  asm_perform_threadswitch(&(from)->restorePoint,\
+                                    &(to)->restorePoint, &(from)->usedStackTop)
+
+#define THREADINIT(to, func)    (to)->restorePoint =                         \
+                                    asm_initialize_thread_stack((u1*)(func), \
+                                                            (to)->stackEnd)
+
+#define        THREADINFO(e)                               \
+               do {                                        \
+                       (e)->restorePoint = 0;                  \
+                       (e)->flags = THREAD_FLAGS_NOSTACKALLOC; \
+               } while(0)
+
+#endif