# HG changeset patch # User Me # Date 1277235463 25200 # Node ID 734c665500e4b0be760521977212df46dfa78b5b # Parent 030fceb7e9b994f550800f5e485c10768102d435 Kinda have test working -- assembly looks right for saving core loop frame and stack and restoring them But have a bug that looks timing-related, so thinking maybe some threads are going to completion? The whole test isn't quite right yet -- it throws exception because the suspended virtual processors never have a continuation put back into the workQ (is this right? Is that why it throws exception?) Want to move to full code to finish debugging diff -r 030fceb7e9b9 -r 734c665500e4 VMS.c --- a/VMS.c Tue Jun 22 12:37:32 2010 -0700 +++ b/VMS.c Tue Jun 22 12:37:43 2010 -0700 @@ -200,24 +200,26 @@ callingPr->schedSlot->workIsDone = TRUE; // coreIdx = callingPr->coreAnimatedBy; -// stackPtrAddr = &(callingPr->stackPtr); -// framePtrAddr = &(callingPr->framePtr); + stackPtrAddr = &(callingPr->stackPtr); + framePtrAddr = &(callingPr->framePtr); jmpPt = callingPr->coreLoopStartPt; coreLoopFramePtr = callingPr->coreLoopFramePtr;//need this only - coreLoopStackPtr = callingPr->coreLoopStackPtr; -// coreLoopStackPtr = coreLoopThdParams[ coreIdx ]->stackPtr;//prob dont need + coreLoopStackPtr = callingPr->coreLoopStackPtr;//shouldn't need -- safety //Save the virt procr's stack and frame ptrs, restore coreloop's frame // ptr, then jump back to "start" of core loop - asm volatile("movl %%esp, %0; \ - movl %%ebp, %1; \ - movl %3, %%eax; \ - movl %2, %%ebp; \ - jmp %%eax " \ - /* outputs */ : "=g" (callingPr->stackPtr), "=g" (callingPr->framePtr) \ - /* inputs */ : "g"(coreLoopFramePtr), "g" (jmpPt) \ - /* clobber */ : "memory", "%eax", "%ebx", "%ecx", "%edx", "%edi","%esi" \ + asm volatile("movl %0, %%eax; \ + movl %%esp, (%%eax); \ + movl %1, %%eax; \ + movl %%ebp, (%%eax); \ + movl %2, %%eax; \ + movl %3, %%esp; \ + movl %4, %%ebp; \ + jmp %%eax " \ + /* outputs */ : "=g" (stackPtrAddr), "=g" (framePtrAddr) \ + /* inputs */ : "g" (jmpPt), "g"(coreLoopStackPtr), "g"(coreLoopFramePtr)\ + /* clobber */ : "memory", "%eax", "%ebx", "%ecx", "%edx", "%edi","%esi" \ ); //list everything as clobbered to force GCC to save all // live vars that are in regs on stack before this // assembly, so that stack pointer is correct, before jmp