VID_IRET_Proc

include vpicd.inc

clc

cmp [TimeOut],0

jz no_timeout

stc ; carry flag set if interrupt timed out

no_timeout:

mov eax, IRQHand ; IRQ handle

mov ebx, VM ; current VM handle

call VID_IRET_Proc


The VID_IRET_Proc procedure handles attempts by a virtual machine to return from an interrupt. The system calls this procedure whenever a virtual machine executes an iret instruction, or whenever a time out occurs for a simulated interrupt.

The system disables interrupts before calling this procedure. The procedure can re-enable interrupts if necessary.

Parameters

IRQHand

Specifies the handle identifying the interrupt request.

VM

Specifies the handle identifying the current virtual machine.

Return Value

This procedure has no return value.

Comments

This procedure is useful for devices that must simulate large numbers of interrupts in a short period of time. For example, the virtual COM device simulates an interrupt, allows one character to be read from the COM port, and waits for the virtual machine to execute an iret instruction before putting more data into the virtual COM receive buffer.

This procedure may modify the EAX, EBX, ECX, EDX, ESI, and Flags registers.