Call_Global_Event

include vmm.inc

mov esi, OFFSET32 EventCallback ; points to callback procedure

mov edx, OFFSET32 RefData ; points to reference data

VMMcall Call_Global_Event

mov [Event], esi ; event handle or zero if not scheduled


The Call_Global_Event service either calls the event callback procedure immediately, or schedules a global event. This service schedules the event if the virtual device is processing a hardware interrupt that interrupted the VMM. In all other cases, the service calls the callback procedure without scheduling an event.

This is an asynchronous service.

Parameters

EventCallback

Points to the callback procedure to install. For more information about the callback procedure, see the following “Comments” section.

RefData

Points to reference data to be passed to the event callback procedure.

Return Value

The ESI register is zero if the service calls the callback procedure. Otherwise, the ESI register contains the event handle. The event handle can be used in subsequent calls to the Cancel_Global_Event service to cancel the event.

Comments

If the service schedules a global event, the system calls the event callback procedure immediately before the returning from the current interrupt. Any virtual machine can process the event, so the system does not switch tasks before calling the procedure.

The callback procedure can carry out any actions, and use any VMM services. The system calls the event callback procedure as follows:

mov ebx, VM ; current VM handle

mov edx, OFFSET32 RefData ; points to reference data

mov ebp, OFFSET32 crs ; points to a Client_Reg_Struc

call [EventCallback]

The VM parameter is a handle identifying the current virtual machine, the RefData parameter points to reference data supplied by the virtual machine that scheduled the event, and the crs parameter points to a Client_Reg_Struc structure containing the contents of the virtual machine's registers.

The callback procedure can modify the EAX, EBX, ECX, EDX, ESI, and EDI registers.

Uses

Flags

See Also

Cancel_Global_Event, Schedule_Global_Event