]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/hv/hv_api.h
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / staging / hv / hv_api.h
index 9eb818ee07ba6cadfb175956dd53ed3b0642a09f..70e863ad0464a4cac5e4ac4af61d7bee34ad8ef7 100644 (file)
 
 /*
  * The below CPUID leaves are present if VersionAndFeatures.HypervisorPresent
- * is set by CPUID(HvCpuIdFunctionVersionAndFeatures).
+ * is set by CPUID(HVCPUID_VERSION_FEATURES).
  */
 enum hv_cpuid_function {
-       HvCpuIdFunctionVersionAndFeatures               = 0x00000001,
-       HvCpuIdFunctionHvVendorAndMaxFunction           = 0x40000000,
-       HvCpuIdFunctionHvInterface                      = 0x40000001,
+       HVCPUID_VERSION_FEATURES                = 0x00000001,
+       HVCPUID_VENDOR_MAXFUNCTION              = 0x40000000,
+       HVCPUID_INTERFACE                       = 0x40000001,
 
        /*
         * The remaining functions depend on the value of
-        * HvCpuIdFunctionInterface
+        * HVCPUID_INTERFACE
         */
-       HvCpuIdFunctionMsHvVersion                      = 0x40000002,
-       HvCpuIdFunctionMsHvFeatures                     = 0x40000003,
-       HvCpuIdFunctionMsHvEnlightenmentInformation     = 0x40000004,
-       HvCpuIdFunctionMsHvImplementationLimits         = 0x40000005,
+       HVCPUID_VERSION                 = 0x40000002,
+       HVCPUID_FEATURES                        = 0x40000003,
+       HVCPUID_ENLIGHTENMENT_INFO      = 0x40000004,
+       HVCPUID_IMPLEMENTATION_LIMITS           = 0x40000005,
 };
 
 /* Define the virtual APIC registers */
@@ -575,30 +575,30 @@ enum hv_cpuid_function {
 
 /* Define hypervisor message types. */
 enum hv_message_type {
-       HvMessageTypeNone                       = 0x00000000,
+       HVMSG_NONE                      = 0x00000000,
 
        /* Memory access messages. */
-       HvMessageTypeUnmappedGpa                = 0x80000000,
-       HvMessageTypeGpaIntercept               = 0x80000001,
+       HVMSG_UNMAPPED_GPA              = 0x80000000,
+       HVMSG_GPA_INTERCEPT             = 0x80000001,
 
        /* Timer notification messages. */
-       HvMessageTimerExpired                   = 0x80000010,
+       HVMSG_TIMER_EXPIRED                     = 0x80000010,
 
        /* Error messages. */
-       HvMessageTypeInvalidVpRegisterValue     = 0x80000020,
-       HvMessageTypeUnrecoverableException     = 0x80000021,
-       HvMessageTypeUnsupportedFeature         = 0x80000022,
+       HVMSG_INVALID_VP_REGISTER_VALUE = 0x80000020,
+       HVMSG_UNRECOVERABLE_EXCEPTION   = 0x80000021,
+       HVMSG_UNSUPPORTED_FEATURE               = 0x80000022,
 
        /* Trace buffer complete messages. */
-       HvMessageTypeEventLogBufferComplete     = 0x80000040,
+       HVMSG_EVENTLOG_BUFFERCOMPLETE   = 0x80000040,
 
        /* Platform-specific processor intercept messages. */
-       HvMessageTypeX64IoPortIntercept         = 0x80010000,
-       HvMessageTypeX64MsrIntercept            = 0x80010001,
-       HvMessageTypeX64CpuidIntercept          = 0x80010002,
-       HvMessageTypeX64ExceptionIntercept      = 0x80010003,
-       HvMessageTypeX64ApicEoi                 = 0x80010004,
-       HvMessageTypeX64LegacyFpError           = 0x80010005
+       HVMSG_X64_IOPORT_INTERCEPT              = 0x80010000,
+       HVMSG_X64_MSR_INTERCEPT         = 0x80010001,
+       HVMSG_X64_CPUID_INTERCEPT               = 0x80010002,
+       HVMSG_X64_EXCEPTION_INTERCEPT   = 0x80010003,
+       HVMSG_X64_APIC_EOI                      = 0x80010004,
+       HVMSG_X64_LEGACY_FP_ERROR               = 0x80010005
 };
 
 /* Define the number of synthetic interrupt sources. */
@@ -610,103 +610,103 @@ enum hv_message_type {
 
 /* Define connection identifier type. */
 union hv_connection_id {
-       u32 Asu32;
+       u32 asu32;
        struct {
-               u32 Id:24;
-               u32 Reserved:8;
+               u32 id:24;
+               u32 reserved:8;
        } u;
 };
 
 /* Define port identifier type. */
 union hv_port_id {
-       u32 Asu32;
+       u32 asu32;
        struct {
-               u32 Id:24;
-               u32 Reserved:8;
+               u32 id:24;
+               u32 reserved:8;
        } u ;
 };
 
 /* Define port type. */
 enum hv_port_type {
-       HvPortTypeMessage       = 1,
-       HvPortTypeEvent         = 2,
-       HvPortTypeMonitor       = 3
+       HVPORT_MSG      = 1,
+       HVPORT_EVENT            = 2,
+       HVPORT_MONITOR  = 3
 };
 
 /* Define port information structure. */
 struct hv_port_info {
-       enum hv_port_type PortType;
-       u32 Padding;
+       enum hv_port_type port_type;
+       u32 padding;
        union {
                struct {
-                       u32 TargetSint;
-                       u32 TargetVp;
-                       u64 RsvdZ;
-               } MessagePortInfo;
+                       u32 target_sint;
+                       u32 target_vp;
+                       u64 rsvdz;
+               } message_port_info;
                struct {
-                       u32 TargetSint;
-                       u32 TargetVp;
-                       u16 BaseFlagNumber;
-                       u16 FlagCount;
-                       u32 RsvdZ;
-               } EventPortInfo;
+                       u32 target_sint;
+                       u32 target_vp;
+                       u16 base_flag_bumber;
+                       u16 flag_count;
+                       u32 rsvdz;
+               } event_port_info;
                struct {
-                       u64 MonitorAddress;
-                       u64 RsvdZ;
-               } MonitorPortInfo;
+                       u64 monitor_address;
+                       u64 rsvdz;
+               } monitor_port_info;
        };
 };
 
 struct hv_connection_info {
-       enum hv_port_type PortType;
-       u32 Padding;
+       enum hv_port_type port_type;
+       u32 padding;
        union {
                struct {
-                       u64 RsvdZ;
-               } MessageConnectionInfo;
+                       u64 rsvdz;
+               } message_connection_info;
                struct {
-                       u64 RsvdZ;
-               } EventConnectionInfo;
+                       u64 rsvdz;
+               } event_connection_info;
                struct {
-                       u64 MonitorAddress;
-               } MonitorConnectionInfo;
+                       u64 monitor_address;
+               } monitor_connection_info;
        };
 };
 
 /* Define synthetic interrupt controller message flags. */
 union hv_message_flags {
-       u8 Asu8;
+       u8 asu8;
        struct {
-               u8 MessagePending:1;
-               u8 Reserved:7;
+               u8 msg_pending:1;
+               u8 reserved:7;
        };
 };
 
 /* Define synthetic interrupt controller message header. */
 struct hv_message_header {
-       enum hv_message_type MessageType;
-       u8 PayloadSize;
-       union hv_message_flags MessageFlags;
-       u8 Reserved[2];
+       enum hv_message_type message_type;
+       u8 payload_size;
+       union hv_message_flags message_flags;
+       u8 reserved[2];
        union {
-               u64 Sender;
-               union hv_port_id Port;
+               u64 sender;
+               union hv_port_id port;
        };
 };
 
 /* Define timer message payload structure. */
 struct hv_timer_message_payload {
-       u32 TimerIndex;
-       u32 Reserved;
-       u64 ExpirationTime;     /* When the timer expired */
-       u64 DeliveryTime;       /* When the message was delivered */
+       u32 timer_index;
+       u32 reserved;
+       u64 expiration_time;    /* When the timer expired */
+       u64 delivery_time;      /* When the message was delivered */
 };
 
 /* Define synthetic interrupt controller message format. */
 struct hv_message {
-       struct hv_message_header Header;
+       struct hv_message_header header;
        union {
-               u64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
+               u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
        } u ;
 };
 
@@ -715,82 +715,82 @@ struct hv_message {
 
 /* Define the synthetic interrupt message page layout. */
 struct hv_message_page {
-       struct hv_message SintMessage[HV_SYNIC_SINT_COUNT];
+       struct hv_message sint_message[HV_SYNIC_SINT_COUNT];
 };
 
 /* Define the synthetic interrupt controller event flags format. */
 union hv_synic_event_flags {
-       u8 Flags8[HV_EVENT_FLAGS_BYTE_COUNT];
-       u32 Flags32[HV_EVENT_FLAGS_DWORD_COUNT];
+       u8 flags8[HV_EVENT_FLAGS_BYTE_COUNT];
+       u32 flags32[HV_EVENT_FLAGS_DWORD_COUNT];
 };
 
 /* Define the synthetic interrupt flags page layout. */
 struct hv_synic_event_flags_page {
-       union hv_synic_event_flags SintEventFlags[HV_SYNIC_SINT_COUNT];
+       union hv_synic_event_flags sintevent_flags[HV_SYNIC_SINT_COUNT];
 };
 
 /* Define SynIC control register. */
 union hv_synic_scontrol {
-       u64 AsUINT64;
+       u64 as_uint64;
        struct {
-               u64 Enable:1;
-               u64 Reserved:63;
+               u64 enable:1;
+               u64 reserved:63;
        };
 };
 
 /* Define synthetic interrupt source. */
 union hv_synic_sint {
-       u64 AsUINT64;
+       u64 as_uint64;
        struct {
-               u64 Vector:8;
-               u64 Reserved1:8;
-               u64 Masked:1;
-               u64 AutoEoi:1;
-               u64 Reserved2:46;
+               u64 vector:8;
+               u64 reserved1:8;
+               u64 masked:1;
+               u64 auto_eoi:1;
+               u64 reserved2:46;
        };
 };
 
 /* Define the format of the SIMP register */
 union hv_synic_simp {
-       u64 AsUINT64;
+       u64 as_uint64;
        struct {
-               u64 SimpEnabled:1;
-               u64 Preserved:11;
-               u64 BaseSimpGpa:52;
+               u64 simp_enabled:1;
+               u64 preserved:11;
+               u64 base_simp_gpa:52;
        };
 };
 
 /* Define the format of the SIEFP register */
 union hv_synic_siefp {
-       u64 AsUINT64;
+       u64 as_uint64;
        struct {
-               u64 SiefpEnabled:1;
-               u64 Preserved:11;
-               u64 BaseSiefpGpa:52;
+               u64 siefp_enabled:1;
+               u64 preserved:11;
+               u64 base_siefp_gpa:52;
        };
 };
 
 /* Definitions for the monitored notification facility */
 union hv_monitor_trigger_group {
-       u64 AsUINT64;
+       u64 as_uint64;
        struct {
-               u32 Pending;
-               u32 Armed;
+               u32 pending;
+               u32 armed;
        };
 };
 
 struct hv_monitor_parameter {
-       union hv_connection_id ConnectionId;
-       u16 FlagNumber;
-       u16 RsvdZ;
+       union hv_connection_id connectionid;
+       u16 flagnumber;
+       u16 rsvdz;
 };
 
 union hv_monitor_trigger_state {
-       u32 Asu32;
+       u32 asu32;
 
        struct {
-               u32 GroupEnable:4;
-               u32 RsvdZ:28;
+               u32 group_enable:4;
+               u32 rsvdz:28;
        };
 };
 
@@ -814,42 +814,42 @@ union hv_monitor_trigger_state {
 /* | 840 | Rsvd4[0]                                     | */
 /* ------------------------------------------------------ */
 struct hv_monitor_page {
-       union hv_monitor_trigger_state TriggerState;
-       u32 RsvdZ1;
+       union hv_monitor_trigger_state trigger_state;
+       u32 rsvdz1;
 
-       union hv_monitor_trigger_group TriggerGroup[4];
-       u64 RsvdZ2[3];
+       union hv_monitor_trigger_group trigger_group[4];
+       u64 rsvdz2[3];
 
-       s32 NextCheckTime[4][32];
+       s32 next_checktime[4][32];
 
-       u16 Latency[4][32];
-       u64 RsvdZ3[32];
+       u16 latency[4][32];
+       u64 rsvdz3[32];
 
-       struct hv_monitor_parameter Parameter[4][32];
+       struct hv_monitor_parameter parameter[4][32];
 
-       u8 RsvdZ4[1984];
+       u8 rsvdz4[1984];
 };
 
 /* Declare the various hypercall operations. */
 enum hv_call_code {
-       HvCallPostMessage       = 0x005c,
-       HvCallSignalEvent       = 0x005d,
+       HVCALL_POST_MESSAGE     = 0x005c,
+       HVCALL_SIGNAL_EVENT     = 0x005d,
 };
 
-/* Definition of the HvPostMessage hypercall input structure. */
+/* Definition of the hv_post_message hypercall input structure. */
 struct hv_input_post_message {
-       union hv_connection_id ConnectionId;
-       u32 Reserved;
-       enum hv_message_type MessageType;
-       u32 PayloadSize;
-       u64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
+       union hv_connection_id connectionid;
+       u32 reserved;
+       enum hv_message_type message_type;
+       u32 payload_size;
+       u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
 };
 
-/* Definition of the HvSignalEvent hypercall input structure. */
+/* Definition of the hv_signal_event hypercall input structure. */
 struct hv_input_signal_event {
-       union hv_connection_id ConnectionId;
-       u16 FlagNumber;
-       u16 RsvdZ;
+       union hv_connection_id connectionid;
+       u16 flag_number;
+       u16 rsvdz;
 };
 
 /*
@@ -859,16 +859,16 @@ struct hv_input_signal_event {
 
 /* Version info reported by guest OS's */
 enum hv_guest_os_vendor {
-       HvGuestOsVendorMicrosoft        = 0x0001
+       HVGUESTOS_VENDOR_MICROSOFT      = 0x0001
 };
 
 enum hv_guest_os_microsoft_ids {
-       HvGuestOsMicrosoftUndefined     = 0x00,
-       HvGuestOsMicrosoftMSDOS         = 0x01,
-       HvGuestOsMicrosoftWindows3x     = 0x02,
-       HvGuestOsMicrosoftWindows9x     = 0x03,
-       HvGuestOsMicrosoftWindowsNT     = 0x04,
-       HvGuestOsMicrosoftWindowsCE     = 0x05
+       HVGUESTOS_MICROSOFT_UNDEFINED   = 0x00,
+       HVGUESTOS_MICROSOFT_MSDOS               = 0x01,
+       HVGUESTOS_MICROSOFT_WINDOWS3X   = 0x02,
+       HVGUESTOS_MICROSOFT_WINDOWS9X   = 0x03,
+       HVGUESTOS_MICROSOFT_WINDOWSNT   = 0x04,
+       HVGUESTOS_MICROSOFT_WINDOWSCE   = 0x05
 };
 
 /*
@@ -877,14 +877,14 @@ enum hv_guest_os_microsoft_ids {
 #define HV_X64_MSR_GUEST_OS_ID 0x40000000
 
 union hv_x64_msr_guest_os_id_contents {
-       u64 AsUINT64;
+       u64 as_uint64;
        struct {
-               u64 BuildNumber:16;
-               u64 ServiceVersion:8; /* Service Pack, etc. */
-               u64 MinorVersion:8;
-               u64 MajorVersion:8;
-               u64 OsId:8; /* enum hv_guest_os_microsoft_ids (if Vendor=MS) */
-               u64 VendorId:16; /* enum hv_guest_os_vendor */
+               u64 build_number:16;
+               u64 service_version:8; /* Service Pack, etc. */
+               u64 minor_version:8;
+               u64 major_version:8;
+               u64 os_id:8; /* enum hv_guest_os_microsoft_ids (if Vendor=MS) */
+               u64 vendor_id:16; /* enum hv_guest_os_vendor */
        };
 };
 
@@ -894,11 +894,11 @@ union hv_x64_msr_guest_os_id_contents {
 #define HV_X64_MSR_HYPERCALL   0x40000001
 
 union hv_x64_msr_hypercall_contents {
-       u64 AsUINT64;
+       u64 as_uint64;
        struct {
-               u64 Enable:1;
-               u64 Reserved:11;
-               u64 GuestPhysicalAddress:52;
+               u64 enable:1;
+               u64 reserved:11;
+               u64 guest_physical_address:52;
        };
 };