From 8a306f8931d63271066f8c24efadc469dd1013c9 Mon Sep 17 00:00:00 2001 From: hsc Date: Thu, 19 Apr 2012 18:02:10 +0000 Subject: [PATCH] Bochs-internal hacks - CPU-loop function loses unused pInstr parameter - restore functionality in handleAsyncEvent moves *before* idle loop to make sure we catch restore requests right before falling asleep git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1120 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- bochs/cpu/cpu.cc | 17 +++++++++-------- core/SAL/bochs/Breakpoints.ah | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bochs/cpu/cpu.cc b/bochs/cpu/cpu.cc index 346a564b..7153a294 100644 --- a/bochs/cpu/cpu.cc +++ b/bochs/cpu/cpu.cc @@ -33,7 +33,7 @@ // Just a dummy function to define a join-point. This function is // *just* called once within bx_cpu_c::cpu_loop(...). -static inline void defineCPULoopJoinPoint(BX_CPU_C* pThis, bxInstruction_c* pInstr) +static inline void defineCPULoopJoinPoint(BX_CPU_C* pThis) { /* nothing to do here */ } @@ -156,7 +156,7 @@ void BX_CPU_C::cpu_loop(Bit32u max_instr_count) * */ - defineCPULoopJoinPoint(BX_CPU_THIS, i); + defineCPULoopJoinPoint(BX_CPU_THIS); /****************************************************************/ // instruction decoding completed -> continue with execution @@ -447,6 +447,13 @@ unsigned BX_CPU_C::handleAsyncEvent(void) // // This area is where we process special conditions and events. // + + //DanceOS +#ifdef DANCEOS_RESTORE + if (sal::restore_bochs_request) { + return 1; + } +#endif if (BX_CPU_THIS_PTR activity_state) { // For one processor, pass the time as quickly as possible until // an interrupt wakes up the CPU. @@ -501,12 +508,6 @@ unsigned BX_CPU_C::handleAsyncEvent(void) // setting kill_bochs_request causes the cpu loop to return ASAP. return 1; // Return to caller of cpu_loop. } - //DanceOS -#ifdef DANCEOS_RESTORE - else if (sal::restore_bochs_request) { - return 1; - } -#endif // VMLAUNCH/VMRESUME cannot be executed with interrupts inhibited. // Save inhibit interrupts state into shadow bits after clearing diff --git a/core/SAL/bochs/Breakpoints.ah b/core/SAL/bochs/Breakpoints.ah index ef23510d..72e3a7cf 100644 --- a/core/SAL/bochs/Breakpoints.ah +++ b/core/SAL/bochs/Breakpoints.ah @@ -22,7 +22,7 @@ aspect Breakpoints // BX_CPU(0) otherwise BX_CPU_C* pThis = *(tjp->arg<0>()); // Points to the *current* bxInstruction-object - bxInstruction_c* pInstr = *(tjp->arg<1>()); + //bxInstruction_c* pInstr = *(tjp->arg<1>()); // report this event to the Bochs controller: sal::simulator.onInstrPtrChanged(pThis->get_instruction_pointer());