FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Main execution loop for the emulator. We return from here when the system
 * halts, which is normally caused by a stack fault when we return from the
 * original real mode call.
 */
Main execution loop for the emulator. We return from here when the system
halts, which is normally caused by a stack fault when we return from the
original real mode call.
Main execution loop for the emulator . We return from here when the system halts which is normally caused by a stack fault when we return from the original real mode call .
void 
x86emu_exec(struct x86emu *emu)
{
	emu->x86.intr = 0;
	if (setjmp(emu->exec_state))
		return;
	for (;;) {
		if (emu->x86.intr) {
			if (((emu->x86.intr & INTR_SYNCH) &&
			    (emu->x86.intno == 0 || emu->x86.intno == 2)) ||
			    !ACCESS_FLAG(F_IF)) {
				x86emu_intr_handle(emu);
			}
		}
		if (emu->x86.R_CS == 0 && emu->x86.R_IP == 0)
			return;
		x86emu_exec_one_byte(emu);
		++emu->cur_cycles;
	}
}
void x86emu_exec ( struct x86emu * emu ) { emu -> x86 . intr = 0 ; if ( setjmp ( emu -> exec_state ) ) return ; for ( ; ; ) { if ( emu -> x86 . intr ) { if ( ( ( emu -> x86 . intr & INTR_SYNCH ) && ( emu -> x86 . intno == 0 || emu -> x86 . intno == 2 ) ) || ! ACCESS_FLAG ( F_IF ) ) { x86emu_intr_handle ( emu ) ; } } if ( emu -> x86 . R_CS == 0 && emu -> x86 . R_IP == 0 ) return ; x86emu_exec_one_byte ( emu ) ; ++ emu -> cur_cycles ; } }
REMARKS:
 Main execution loop for the emulator.
REMARKS : Main execution loop for the emulator .