diff contextSwitch.s @ 73:d8f12351f7cc

generic VMS lib
author Merten Sach <msach@mailbox.tu-berlin.de>
date Thu, 02 Jun 2011 12:36:14 +0200
parents 5ff1631c26ed
children f6990e1ba998
line diff
     1.1 --- a/contextSwitch.s	Mon May 30 18:28:41 2011 +0200
     1.2 +++ b/contextSwitch.s	Thu Jun 02 12:36:14 2011 +0200
     1.3 @@ -1,5 +1,3 @@
     1.4 -#include "VMS.h"
     1.5 -
     1.6  .data
     1.7  
     1.8  
     1.9 @@ -26,9 +24,8 @@
    1.10   * 0x20 coreLoopStackPtr
    1.11   *
    1.12   * _VMSMasterEnv  offsets:
    1.13 - * 0x24 coreLoopStartPt
    1.14 - * 0x28 coreLoopEndPt
    1.15 - * 0x30 masterLock
    1.16 + * 0x24 coreLoopReturnPt
    1.17 + * 0x2c masterLock
    1.18   */
    1.19  .globl switchToVP
    1.20  switchToVP:
    1.21 @@ -52,9 +49,9 @@
    1.22   * 0x20 coreLoopStackPtr
    1.23   *
    1.24   * _VMSMasterEnv  offsets:
    1.25 - * 0x24 coreLoopStartPt
    1.26 + * 0x24 coreLoopReturnPt
    1.27   * 0x28 coreLoopEndPt
    1.28 - * 0x30 masterLock
    1.29 + * 0x2c masterLock
    1.30   */
    1.31  .globl switchToCoreLoop
    1.32  switchToCoreLoop:
    1.33 @@ -74,6 +71,7 @@
    1.34  
    1.35  
    1.36  //switches to core loop from master. saves return address
    1.37 +//Releases masterLock so the next MasterLoop can be executed
    1.38  /* VirtProcr  offsets:
    1.39   * 0xc  stackPtr
    1.40   * 0x10 framePtr
    1.41 @@ -82,9 +80,8 @@
    1.42   * 0x20 coreLoopStackPtr
    1.43   *
    1.44   * _VMSMasterEnv  offsets:
    1.45 - * 0x24 coreLoopStartPt
    1.46 - * 0x28 coreLoopEndPt
    1.47 - * 0x30 masterLock
    1.48 + * 0x24 coreLoopReturnPt
    1.49 + * 0x2c masterLock
    1.50   */
    1.51  .globl masterSwitchToCoreLoop
    1.52  masterSwitchToCoreLoop:
    1.53 @@ -97,15 +94,16 @@
    1.54      movl    $_VMSMasterEnv, %ecx
    1.55      movl    (%ecx)    , %ecx
    1.56      movl    0x24(%ecx), %eax         #get CoreLoopStartPt
    1.57 -    movl    $0x0      , 0x30(%ecx)   #release lock
    1.58 +    movl    $0x0      , 0x2c(%ecx)   #release lock
    1.59      jmp     *%eax                    #jmp to CoreLoop
    1.60  MasterReturn:
    1.61      ret
    1.62  
    1.63  
    1.64  //Switch to terminateCoreLoop
    1.65 -//no need to call because the stack is already set up for switchVP
    1.66 -//do not save register of VP because this function will never return
    1.67 +// no need to call because the stack is already set up for switchVP
    1.68 +// and both functions have the same argument.
    1.69 +// do not save register of VP because this function will never return
    1.70  /* VirtProcr  offsets:
    1.71   * 0xc  stackPtr
    1.72   * 0x10 framePtr
    1.73 @@ -114,9 +112,8 @@
    1.74   * 0x20 coreLoopStackPtr
    1.75   *
    1.76   * _VMSMasterEnv  offsets:
    1.77 - * 0x24 coreLoopStartPt
    1.78 - * 0x28 coreLoopEndPt
    1.79 - * 0x30 masterLock
    1.80 + * 0x24 coreLoopReturnPt
    1.81 + * 0x2c masterLock
    1.82   */
    1.83  .globl asmTerminateCoreLoop
    1.84  asmTerminateCoreLoop: