include vmm.inc
mov eax, Flags
mov ebx, VMHandle
mov ecx, Foreground
mov edx, Background
VMMCall Set_Time_Slice_Priority
Sets the time-slice execution flags and the foreground and background priorities for the specified virtual machine. Uses EAX and Flags.
VMStat_Exclusive | Virtual machine is executing to the exclusion of all other threads |
VMStat_Background | Virtual machine is executing in the background |
VMStat_High_Pri_Back | Virtual machine is executing in the background, but with a boost in time-slice priority |
To change the time-slice priority, a virtual machine should retrieve the current time-slice priority using the Get_Time_Slice_Priority service, modify the returned values, and use the modified values as input parameters to this service. The following example assigns a virtual machine to the background:
mov ebx, [VMHandle]
VMMCall Get_Time_Slice_Priority
or eax, VMStat_Background
VMMCall Set_Time_Slice_Priority
Get_Time_Slice_Priority, Set_Time_Slice_Granularity