_TestGlobalV86Mem

include vmm.inc

VMMcall _TestGlobalV86Mem, <VMLinAddr, nBytes, flags>

mov [Result], eax ; 0 if local, 1 if global, 2 if mixed,

; 3 if includes instance data region


The _TestGlobalV86Mem service tests whether a V86 address range is global, local, or instanced.

Parameters

VMLinAddr

Specifies the ring-0 linear address of the first byte of the V86 address range. For example, the linear address of the V86 address 02C1h:0FC5h is 3BD5h (02C10h + 0FC5h).

nBytes

Specifies the size (in bytes) of the V86 address range.

flags

Specifies the operation flags. This parameter must be set to 0.

Return Value

The EAX register contains one of the following values:

Value Meaning

0 Address range either contains local memory, or is not a valid V86 address range.
1 Address range contains global memory.
2 Address range contains both local and global memory.
3 Address range contains global memory, but also includes an instance data region.

Comments

Global V86 memory has addresses that are valid and identical in all virtual machines. Local memory has addresses that are only valid in one virtual machine. Instanced memory has addresses that are valid in all virtual machines, but the content of the memory varies with each virtual machine.

This service may incorrectly report the type of memory in addresses above page 0A0h (in the device adapter area). If this service returns global for memory in this area, it is global. If the service returns local, however, the memory may actually be global. Generally, this region is local.

Operations involving global address ranges typically do not need to be virtualized since the range is valid and addressable in all virtual machines. Operations involving local address ranges may have to be virtualized since it is possible for software, such as an interrupt handler, to use a local address in the wrong virtual machine.

Uses

EAX