diff MasterLoop.c @ 62:dd3e60aeae26

Middle of fixing for -O3.. works -O0 still -- hard-code field offsets in assbly
author Me
date Fri, 12 Nov 2010 07:36:01 -0800
parents 3bac84e4e56e
children a6c442d52590 9c3107044f86
line diff
     1.1 --- a/MasterLoop.c	Mon Nov 08 03:57:46 2010 -0800
     1.2 +++ b/MasterLoop.c	Fri Nov 12 07:36:01 2010 -0800
     1.3 @@ -170,8 +170,35 @@
     1.4     saveLowTimeStampCountInto( masterPr->endMasterTSCLow );
     1.5     #endif
     1.6  
     1.7 -   
     1.8 -   masterSwitchToCoreLoop( masterPr )
     1.9 +
    1.10 +
    1.11 +/* VirtProcr  offsets:
    1.12 + * 0xc  stackPtr
    1.13 + * 0x10 framePtr
    1.14 + * 0x14 nextInstrPt
    1.15 + * 0x1c coreLoopFramePtr
    1.16 + * 0x20 coreLoopStackPtr
    1.17 + *
    1.18 + * _VMSMasterEnv  offsets:
    1.19 + * 0x24 coreLoopStartPt
    1.20 + * 0x28 coreLoopEndPt
    1.21 + * 0x30 masterLock
    1.22 + */
    1.23 +//   masterSwitchToCoreLoop( masterPr )
    1.24 +   asm volatile("movl         %0,       %%ebx;  \
    1.25 +                 movl         %1,       %%ecx;  \
    1.26 +                 movl      %%esp,  0x0c(%%ecx); \
    1.27 +                 movl      %%ebp,  0x10(%%ecx); \
    1.28 +                 movl 0x24(%%ebx),      %%eax;  \
    1.29 +                 movl 0x20(%%ecx),      %%esp;  \
    1.30 +                 movl 0x1c(%%ecx),      %%ebp;  \
    1.31 +                 movl $0x0,        0x30(%%ebx); \
    1.32 +                 jmp                    %%eax"  \
    1.33 +   /* outputs */ :                              \
    1.34 +   /* inputs  */ : "g"(_VMSMasterEnv), "g"(masterPr)                        \
    1.35 +   /* clobber */ : "memory", "%eax", "%ebx", "%ecx", "%edx", "%edi", "%esi" \
    1.36 +                );
    1.37 +
    1.38   }
    1.39  
    1.40