Skip to content

Commit 5a2c24c

Browse files
committed
IC: Add structure documentation
1 parent bdda517 commit 5a2c24c

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

MacHyperVSupport/IntegrationComponents/HyperVIC.hpp

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,74 @@
1717
#define kHyperVICVersionV3 VMBUS_VERSION(3, 0)
1818

1919
//
20-
// Message types.
20+
// IC message types.
2121
//
2222
typedef enum : UInt16 {
23+
// IC general negotiation.
2324
kVMBusICMessageTypeNegotiate = 0,
25+
// Heartbeat component.
2426
kVMBusICMessageTypeHeartbeat = 1,
27+
// KVP component.
2528
kVMBusICMessageTypeKVPExchange = 2,
29+
// Guest shutdown component.
2630
kVMBusICMessageTypeShutdown = 3,
31+
// Time sync component.
2732
kVMBusICMessageTypeTimeSync = 4,
33+
// Snapshot (VSS) component.
2834
kVMBusICMessageTypeSnapshot = 5,
35+
// File copy component.
2936
kVMBusICMessageTypeFileCopy = 7
3037
} VMBusICMessageType;
3138

39+
// IC message is part of a transaction.
3240
#define kVMBusICFlagTransaction 1
41+
// IC message is from host to guest.
3342
#define kVMBusICFlagRequest 2
43+
// IC message is from guest to host.
3444
#define kVMBusICFlagResponse 4
3545

3646
//
37-
// Header and common negotiation message.
47+
// IC message header common to all integration components.
3848
//
3949
typedef struct __attribute__((packed)) {
50+
// Pipe flags? Unknown field that LIS does not use.
4051
UInt32 pipeFlags;
41-
UInt32 pipeMsgs;
52+
// Pipe message size? Unknown field that LIS does not use.
53+
UInt32 pipeMsgSize;
4254

55+
// Framework version.
4356
VMBusVersion frameworkVersion;
57+
// Message type.
4458
VMBusICMessageType type;
59+
// Message version.
4560
VMBusVersion msgVersion;
61+
// Size of data excluding header.
4662
UInt16 dataSize;
63+
// Return status to Hyper-V.
4764
HyperVStatus status;
65+
// Transaction ID. Integration components seem to disregard
66+
// the VMBus transaction ID in favor of this one.
4867
UInt8 transactionId;
68+
// Message flags.
4969
UInt8 flags;
70+
// Reserved.
5071
UInt16 reserved;
5172
} VMBusICMessageHeader;
5273

74+
//
75+
// IC version negotiation message.
76+
//
5377
typedef struct __attribute__((packed)) {
78+
// IC message header.
5479
VMBusICMessageHeader header;
5580

81+
// Number of framework versions contained in message.
5682
UInt16 frameworkVersionCount;
83+
// Number of message versions contained in message.
5784
UInt16 messageVersionCount;
85+
// Reserved.
5886
UInt32 reserved;
87+
// Array containing supported framework and message versions.
5988
VMBusVersion versions[];
6089
} VMBusICMessageNegotiate;
6190

0 commit comments

Comments
 (0)