changeset 67:2377967a2732

Fixed sequential coreLoop, where switchVPs was broken
author Me
date Tue, 16 Nov 2010 16:00:32 +0100
parents 13b22ffb8a2f
children 9c3107044f86
files CoreLoop.c SwitchAnimators.h VMS.h
diffstat 3 files changed, 30 insertions(+), 28 deletions(-) [+]
line diff
     1.1 --- a/CoreLoop.c	Sun Nov 14 11:17:52 2010 -0800
     1.2 +++ b/CoreLoop.c	Tue Nov 16 16:00:32 2010 +0100
     1.3 @@ -158,30 +158,9 @@
     1.4        //=====================================================================
     1.5  
     1.6      }
     1.7 -/* VirtProcr  offsets:
     1.8 - * 0xc  stackPtr
     1.9 - * 0x10 framePtr
    1.10 - * 0x14 nextInstrPt
    1.11 - * 0x1c coreLoopFramePtr
    1.12 - * 0x20 coreLoopStackPtr
    1.13 - *
    1.14 - * _VMSMasterEnv  offsets:
    1.15 - * 0x24 coreLoopStartPt
    1.16 - * 0x28 coreLoopEndPt
    1.17 - * 0x30 masterLock
    1.18 - */
    1.19 -//   SwitchToVP( currPr )
    1.20 -   asm volatile("movl         %0,      %%ebx;  \
    1.21 -                 movl      %%esp, 0x20(%%ebx); \
    1.22 -                 movl      %%ebp, 0x1c(%%ebx); \
    1.23 -                 movl 0x14(%%ebx),     %%eax;  \
    1.24 -                 movl 0x0c(%%ebx),     %%esp;  \
    1.25 -                 movl 0x10(%%ebx),     %%ebp;  \
    1.26 -                 jmp                  *%%eax"  \
    1.27 -   /* outputs */ :                             \
    1.28 -   /* inputs  */ : "g"(currPr)                 \
    1.29 -   /* clobber */ : "memory", "%eax", "%ebx", "%ecx", "%edx", "%edi", "%esi" \
    1.30 -                );
    1.31 +
    1.32 +   
    1.33 +   SwitchToVP( currPr )
    1.34  
    1.35  
    1.36     //=========== jmp to here when want to shut down the VMS system ==========
     2.1 --- a/SwitchAnimators.h	Sun Nov 14 11:17:52 2010 -0800
     2.2 +++ b/SwitchAnimators.h	Tue Nov 16 16:00:32 2010 +0100
     2.3 @@ -185,9 +185,32 @@
     2.4  
     2.5  
     2.6        //switch to virt procr's stack and frame ptr then jump to virt procr fn
     2.7 +/* VirtProcr  offsets:
     2.8 + * 0xc  stackPtr
     2.9 + * 0x10 framePtr
    2.10 + * 0x14 nextInstrPt
    2.11 + * 0x1c coreLoopFramePtr
    2.12 + * 0x20 coreLoopStackPtr
    2.13 + *
    2.14 + * _VMSMasterEnv  offsets:
    2.15 + * 0x24 coreLoopStartPt
    2.16 + * 0x28 coreLoopEndPt
    2.17 + * 0x30 masterLock
    2.18 + */
    2.19 +#define SwitchToVP( currPr ) \
    2.20 +   asm volatile("movl         %0,      %%ebx;  \
    2.21 +                 movl      %%esp, 0x20(%%ebx); \
    2.22 +                 movl      %%ebp, 0x1c(%%ebx); \
    2.23 +                 movl 0x14(%%ebx),     %%eax;  \
    2.24 +                 movl 0x0c(%%ebx),     %%esp;  \
    2.25 +                 movl 0x10(%%ebx),     %%ebp;  \
    2.26 +                 jmp                  *%%eax"  \
    2.27 +   /* outputs */ :                             \
    2.28 +   /* inputs  */ : "g"(currPr)                 \
    2.29 +   /* clobber */ : "memory", "%eax", "%ebx", "%ecx", "%edx", "%edi", "%esi" \
    2.30 +                );
    2.31  
    2.32 -#define SwitchToVP( currPr ) \
    2.33 -   void *stackPtr, *framePtr, *jmpPt; \
    2.34 +//   void *stackPtr, *framePtr, *jmpPt; \
    2.35  \
    2.36     stackPtr = currPr->stackPtr; \
    2.37     framePtr = currPr->framePtr; \
     3.1 --- a/VMS.h	Sun Nov 14 11:17:52 2010 -0800
     3.2 +++ b/VMS.h	Tue Nov 16 16:00:32 2010 +0100
     3.3 @@ -63,8 +63,8 @@
     3.4     // rollover of low portion into high portion.
     3.5  //#define MEAS__TIME_STAMP_SUSP
     3.6  //#define MEAS__TIME_MASTER
     3.7 -//#define MEAS__TIME_PLUGIN
     3.8 -//#define MEAS__TIME_MALLOC
     3.9 +#define MEAS__TIME_PLUGIN
    3.10 +#define MEAS__TIME_MALLOC
    3.11  #define MEAS__TIME_MASTER_LOCK
    3.12  #define MEAS__NUM_TIMES_TO_RUN 100000
    3.13