Hypercall Details
Each hypercall interface function can be accessed in either of the following ways:
- Wrapper interface
-
The recommended high-level (C-language style) calling convention that is typically provided by a wrapper library that runs in the guest operating system.
- Native interface
-
Assembly-language style interface that the hypervisor provides.
The following is an example of a declaration of a wrapper interface for the hypothetical HvAssignWidgets hypercall:
HV_STATUS HvAssignWidgets( __in HV_PARTITION_ID PartitionId, __in UINT64 Flags, __inout PUINT32 RepCount, __in PCHV_WIDGET WidgetList );
The native interface is defined in memory-based data structures. The hypervisor can define up to the following four data structures for each native interface function:
-
Input parameter header
-
Input list element (for rep hypercalls)
-
Output parameter header
-
Output list element (for rep hypercalls)
The following is an example of the definition of the native interface for the hypothetical HvAssignWidgets rep hypercall. As input, HvAssignWidgets has two fixed parameters and an input list that consists of one or more elements. The first list element can be found at offset 16. The list element is described by using offsets within the element itself, starting with 0.
HvAssignWidgets [rep] | |
---|---|
Call Code = 0xBADD | |
Input Parameter Header | |
0 |
PartitionId (8 bytes) |
8 |
Flags (8 bytes) |
Input List Element | |
0 |
WidgetId (8 bytes) |
8 |
WidgetType (4 bytes) Padding (4 bytes) |
Send comments about this topic to Microsoft
Build date: 11/16/2013