renaming of thread functions
authorcacao <none@none>
Thu, 19 Nov 1998 21:16:04 +0000 (21:16 +0000)
committercacao <none@none>
Thu, 19 Nov 1998 21:16:04 +0000 (21:16 +0000)
alpha/asmpart.c
alpha/threads.h
headers.c
src/cacaoh/headers.c

index 3fbde67348733087934c078d08d4ce3501162bf5..ac62d1cf6b62445a8f30a4e56aedece03f07667d 100644 (file)
@@ -99,8 +99,8 @@
        .globl asm_builtin_irem
        .globl asm_builtin_ldiv
        .globl asm_builtin_lrem
-       .globl perform_alpha_threadswitch
-       .globl initialize_thread_stack
+       .globl asm_perform_threadswitch
+       .globl asm_initialize_thread_stack
        .globl asm_switchstackandcall
 
 
@@ -860,14 +860,14 @@ nb_aastore_throw:
        .end    asm_builtin_aastore
 
 
-/********************** function initialize_thread_stack ***********************
+/******************* function asm_initialize_thread_stack **********************
 *                                                                              *
 *   initialized a thread stack                                                 *
 *                                                                              *
 *******************************************************************************/
 
-       .ent    initialize_thread_stack
-initialize_thread_stack:
+       .ent    asm_initialize_thread_stack
+asm_initialize_thread_stack:
 
        lda     a1,-128(a1)
        stq     zero, 0(a1)
@@ -888,21 +888,21 @@ initialize_thread_stack:
        stq     a0, 120(a1)
        mov     a1, v0
        jmp     zero,(ra)
-       .end    initialize_thread_stack
+       .end    asm_initialize_thread_stack
 
 
-/******************* function perform_alpha_threadswitch ***********************
+/******************* function asm_perform_threadswitch *************************
 *                                                                              *
-*   void perform_alpha_threadswitch (u1 **from, u1 **to, u1 **stackTop);       *
+*   void asm_perform_threadswitch (u1 **from, u1 **to, u1 **stackTop);         *
 *                                                                              *
 *   performs a threadswitch                                                    *
 *                                                                              *
 *******************************************************************************/
 
-       .ent    perform_alpha_threadswitch
-perform_alpha_threadswitch:
+       .ent    asm_perform_threadswitch
+asm_perform_threadswitch:
 
-       subq    sp,128,sp                                 
+       subq    sp,128,sp
        stq     s0, 0(sp)
        stq     s1, 8(sp)
        stq     s2, 16(sp)
@@ -941,7 +941,7 @@ perform_alpha_threadswitch:
        mov     ra, t12
        addq    sp, 128, sp
        jmp     zero,(ra)
-       .end    perform_alpha_threadswitch
+       .end    asm_perform_threadswitch
 
 
 /********************* function asm_switchstackandcall *************************
@@ -958,18 +958,18 @@ perform_alpha_threadswitch:
 
        .ent    asm_switchstackandcall
 asm_switchstackandcall:
-       lda     a0,-2*8(a0)             /* allocate new stack                                 */
-       stq     ra,0(a0)                /* save return address on new stack                   */
-       stq     sp,1*8(a0)              /* save old stack pointer on new stack                */
-       stq sp,0(a2)            /* save old stack pointer to variable                 */
-       mov     a0,sp                   /* switch to new stack                                */
+       lda     a0,-2*8(a0)     /* allocate new stack                                 */
+       stq     ra,0(a0)        /* save return address on new stack                   */
+       stq     sp,1*8(a0)      /* save old stack pointer on new stack                */
+       stq sp,0(a2)        /* save old stack pointer to variable                 */
+       mov     a0,sp           /* switch to new stack                                */
        
-       mov     a1,pv                   /* load function pointer                              */
-       jmp     ra,(pv)                 /* and call function                                  */
+       mov     a1,pv           /* load function pointer                              */
+       jmp     ra,(pv)         /* and call function                                  */
 
-       ldq     ra,0(sp)                /* load return address                                */
-       ldq     sp,1*8(sp)              /* switch to old stack                                */
+       ldq     ra,0(sp)        /* load return address                                */
+       ldq     sp,1*8(sp)      /* switch to old stack                                */
 
-       jmp     zero,(ra)               /* return                                             */
+       jmp     zero,(ra)       /* return                                             */
 
        .end    asm_switchstackandcall
index 72f8c577c93fd4d84d9460b343c1ec9e8ee5566f..828f6efa0dc78a9d7743a5ba2b3d9a032e47c046 100644 (file)
@@ -1,70 +1,47 @@
-/*
- * i386/threads.h
- * i386 threading information.
- *
- * Copyright (c) 1996 T. J. Wilkinson & Associates, London, UK.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
- * 
- * See file COPYRIGHT for information on usage and disclaimer of warranties
- *
- * Written by Tim Wilkinson <tim@tjwassoc.demon.co.uk>, 1996.
- */
-
-#ifndef __alpha_threads_h
-#define __alpha_threads_h
-
-/**/
-/* Thread handling */
-/**/
+/****************************** 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"
 
-void perform_alpha_threadswitch (u1 **from, u1 **to, u1 **stackTop);
-u1* initialize_thread_stack (void *func, u1 *stack);
+/* 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);
 
-#define        THREADSTACKSIZE         (32 * 1024)
+/* access macros */
 
-#define        THREADSWITCH(to, from)     perform_alpha_threadswitch(&(from)->restorePoint,\
-                                                              &(to)->restorePoint, &(from)->usedStackTop)
+#define        THREADSTACKSIZE         (32 * 1024)
 
-#define THREADINIT(to, func)       (to)->restorePoint = \
-                                     initialize_thread_stack((u1*)(func), \
-                                                             (to)->stackEnd)
+#define        THREADSWITCH(to, from)  asm_perform_threadswitch(&(from)->restorePoint,\
+                                    &(to)->restorePoint, &(from)->usedStackTop)
 
-#define        THREADINFO(ee)                                          \
-               do {                                            \
-                       (ee)->restorePoint = 0;                 \
-                       (ee)->flags = THREAD_FLAGS_NOSTACKALLOC;\
-               } while(0)
+#define THREADINIT(to, func)    (to)->restorePoint =                         \
+                                    asm_initialize_thread_stack((u1*)(func), \
+                                                            (to)->stackEnd)
 
-/*
-                       void* ptr;                              \
-                       asm("addq $30,$31,%0" : "=r" (ptr));    \
-                       (ee)->stackEnd = ptr;                   \
-                       (ee)->stackBase = (ee)->stackEnd - threadStackSize;\
-*/
-
-/*
-#define        THREADFRAMES(tid, cnt)                                  \
-               do {                                            \
-                       void** ptr;                             \
-                       cnt = 0;                                \
-                       if (tid == currentThread) {             \
-                               asm("movl %%ebp,%0" : "=r" (ptr));\
-                       }                                       \
-                       else {                                  \
-                               ptr = ((void***)tid->PrivateInfo->restorePoint)[2];\
-                       }                                       \
-                       while (*ptr != 0) {                     \
-                               cnt++;                          \
-                               ptr = (void**)*ptr;             \
-                       }                                       \
-               } while (0)
-*/
+#define        THREADINFO(e)                               \
+               do {                                        \
+                       (e)->restorePoint = 0;                  \
+                       (e)->flags = THREAD_FLAGS_NOSTACKALLOC; \
+               } while(0)
 
 #endif
index 6f95bdca5868fca891cc39aaf42f030eb53e3160..6184efb09a71f83c23f00fb58a504e4ff1ae81e4 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -66,8 +66,8 @@ u1 *oldcreatenativestub (functionptr f, methodinfo *m) {return NULL;}
 void removecompilerstub (u1 *stub) {}
 void removenativestub (u1 *stub) {}
 
-void perform_alpha_threadswitch (u1 **from, u1 **to) {}
-u1* initialize_thread_stack (void *func, u1 *stack) { return NULL; }
+void asm_perform_threadswitch (u1 **from, u1 **to) {}
+u1* asm_initialize_thread_stack (void *func, u1 *stack) { return NULL; }
 void asm_switchstackandcall () { }
 
 java_objectheader *native_new_and_init (void *p) { return NULL; }
index 6f95bdca5868fca891cc39aaf42f030eb53e3160..6184efb09a71f83c23f00fb58a504e4ff1ae81e4 100644 (file)
@@ -66,8 +66,8 @@ u1 *oldcreatenativestub (functionptr f, methodinfo *m) {return NULL;}
 void removecompilerstub (u1 *stub) {}
 void removenativestub (u1 *stub) {}
 
-void perform_alpha_threadswitch (u1 **from, u1 **to) {}
-u1* initialize_thread_stack (void *func, u1 *stack) { return NULL; }
+void asm_perform_threadswitch (u1 **from, u1 **to) {}
+u1* asm_initialize_thread_stack (void *func, u1 *stack) { return NULL; }
 void asm_switchstackandcall () { }
 
 java_objectheader *native_new_and_init (void *p) { return NULL; }