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
This commit is contained in:
hsc
2012-04-19 18:02:10 +00:00
parent dde01c4e92
commit 8a306f8931
2 changed files with 10 additions and 9 deletions

View File

@ -33,7 +33,7 @@
// Just a dummy function to define a join-point. This function is // Just a dummy function to define a join-point. This function is
// *just* called once within bx_cpu_c::cpu_loop(...). // *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 */ /* 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 // 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. // 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) { if (BX_CPU_THIS_PTR activity_state) {
// For one processor, pass the time as quickly as possible until // For one processor, pass the time as quickly as possible until
// an interrupt wakes up the CPU. // 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. // setting kill_bochs_request causes the cpu loop to return ASAP.
return 1; // Return to caller of cpu_loop. 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. // VMLAUNCH/VMRESUME cannot be executed with interrupts inhibited.
// Save inhibit interrupts state into shadow bits after clearing // Save inhibit interrupts state into shadow bits after clearing

View File

@ -22,7 +22,7 @@ aspect Breakpoints
// BX_CPU(0) otherwise // BX_CPU(0) otherwise
BX_CPU_C* pThis = *(tjp->arg<0>()); BX_CPU_C* pThis = *(tjp->arg<0>());
// Points to the *current* bxInstruction-object // 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: // report this event to the Bochs controller:
sal::simulator.onInstrPtrChanged(pThis->get_instruction_pointer()); sal::simulator.onInstrPtrChanged(pThis->get_instruction_pointer());