Adjust_Exec_Priority

include vmm.inc

mov     eax, PriorityBoost
mov     ebx, VMHandle
VMMCall Adjust_Exec_Priority
 

Raises or lowers the execution priority of the specified virtual machine. The service adds the specified boost to the virtual machine's current execution priority. Uses Flags.

PriorityBoost
A signed integer value representing the positive or negative priority boost for the virtual machine. This parameter must be a value such that when added to the current execution priority, the result is within the range Reserved_Low_Boost to Reserved_High_Boost. The following lists some common priority boost values, from lowest to highest:
Value Meaning
Reserved_Low_Boost Reserved for use by system.
Cur_Run_VM_Boost Use to boost the priority of each virtual machine, in turn, forcing them to run for their allotted time slices.
Low_Pri_Device_Boost Use for operations that need timely processing but are not time critical.
High_Pri_Device_Boost Use for time-critical operations that should not circumvent the critical section boost.
Critical_Section_Boost Use to boost the priority of the virtual machine whenever it enters a critical section (calls Begin_Critical_Section).
Time_Critical_Boost Use for operations that require immediate processing, even when another virtual machine is in a critical section. For example, VPICD uses this when simulating hardware interrupts.
Reserved_High_Boost Reserved for use by system.

VMHandle
Handle of the virtual machine.

Because the nonsuspended virtual machine with the highest execution priority is always the current virtual machine, this service causes a task switch under two circumstances:

  1. The execution priority of the current virtual machine is lowered (EAX is negative), and there is another virtual machine with a higher priority that is not suspended.
  2. The execution of a nonsuspended virtual machine which is not the current virtual machine is raised (EAX is positive) higher than the current virtual machine's execution priority.

Even if the current virtual machine is in a critical section, a task switch will still occur if the priority of another nonsuspended virtual machine is raised higher than the current virtual machine's priority. However, this will only occur when a virtual machine is given a time-critical boost, for example, to simulate a hardware interrupt.

It is often more convenient to call the Call_Priority_VM_Event service than to call this service directly.

See Also

Adjust_Thread_Exec_Priority, Begin_Critical_Section, Call_Priority_VM_Event