diff MasterLoop.c @ 71:5ff1631c26ed

working O3 version
author Merten Sach <msach@mailbox.tu-berlin.de>
date Mon, 30 May 2011 18:28:41 +0200
parents 11bfe9d136ed
children fe5ec83f1baf
line diff
     1.1 --- a/MasterLoop.c	Wed May 11 16:13:24 2011 +0200
     1.2 +++ b/MasterLoop.c	Mon May 30 18:28:41 2011 +0200
     1.3 @@ -10,6 +10,7 @@
     1.4  #include <stddef.h>
     1.5  
     1.6  #include "VMS.h"
     1.7 +#include "SwitchAnimators.h"
     1.8  
     1.9  
    1.10  //===========================================================================
    1.11 @@ -93,7 +94,7 @@
    1.12        // of setup code.. (VP creator sets up the stack as if this function
    1.13        // was called normally, but actually get here by jmp)
    1.14        //So, setup values about stack ptr, jmp pt and all that
    1.15 -   masterPr->nextInstrPt = &&masterLoopStartPt;
    1.16 +   //masterPr->nextInstrPt = &&masterLoopStartPt;
    1.17  
    1.18  
    1.19        //Note, got rid of writing the stack and frame ptr up here, because
    1.20 @@ -104,7 +105,9 @@
    1.21        //Also got rid of the busy-wait.
    1.22  
    1.23     
    1.24 -   masterLoopStartPt:
    1.25 +   //masterLoopStartPt:
    1.26 +   while(1){
    1.27 +       
    1.28     //============================= MEASUREMENT STUFF ========================
    1.29     #ifdef MEAS__TIME_MASTER
    1.30        //Total Master time includes one coreloop time -- just assume the core
    1.31 @@ -185,35 +188,11 @@
    1.32     saveLowTimeStampCountInto( masterPr->endMasterTSCLow );
    1.33     #endif
    1.34  
    1.35 +   masterSwitchToCoreLoop(animatingPr);
    1.36 +   flushRegisters();
    1.37 +   }//MasterLoop
    1.38  
    1.39  
    1.40 -/* VirtProcr  offsets:
    1.41 - * 0xc  stackPtr
    1.42 - * 0x10 framePtr
    1.43 - * 0x14 nextInstrPt
    1.44 - * 0x1c coreLoopFramePtr
    1.45 - * 0x20 coreLoopStackPtr
    1.46 - *
    1.47 - * _VMSMasterEnv  offsets:
    1.48 - * 0x24 coreLoopStartPt
    1.49 - * 0x28 coreLoopEndPt
    1.50 - * 0x30 masterLock
    1.51 - */
    1.52 -//   masterSwitchToCoreLoop( masterPr )
    1.53 -   asm volatile("movl         %0,       %%ebx;  \
    1.54 -                 movl         %1,       %%ecx;  \
    1.55 -                 movl      %%esp,  0x0c(%%ecx); \
    1.56 -                 movl      %%ebp,  0x10(%%ecx); \
    1.57 -                 movl 0x24(%%ebx),      %%eax;  \
    1.58 -                 movl 0x20(%%ecx),      %%esp;  \
    1.59 -                 movl 0x1c(%%ecx),      %%ebp;  \
    1.60 -                 movl $0x0,        0x30(%%ebx); \
    1.61 -                 jmp                    %%eax"  \
    1.62 -   /* outputs */ :                              \
    1.63 -   /* inputs  */ : "g"(_VMSMasterEnv), "g"(masterPr)                        \
    1.64 -   /* clobber */ : "memory", "%eax", "%ebx", "%ecx", "%edx", "%edi", "%esi" \
    1.65 -                );
    1.66 -
    1.67   }
    1.68  
    1.69