Commit 98d9fac4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: cleanup coding style issues in Hv.h

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a51ed7d6
...@@ -224,10 +224,7 @@ HvDoHypercall ( ...@@ -224,10 +224,7 @@ HvDoHypercall (
before any other routines in here are called before any other routines in here are called
--*/ --*/
static int int HvInit (void)
HvInit (
void
)
{ {
int ret=0; int ret=0;
int maxLeaf; int maxLeaf;
...@@ -346,10 +343,7 @@ HvInit ( ...@@ -346,10 +343,7 @@ HvInit (
Cleanup routine. This routine is called normally during driver unloading or exiting. Cleanup routine. This routine is called normally during driver unloading or exiting.
--*/ --*/
static void void HvCleanup (void)
HvCleanup (
void
)
{ {
HV_X64_MSR_HYPERCALL_CONTENTS hypercallMsr; HV_X64_MSR_HYPERCALL_CONTENTS hypercallMsr;
...@@ -388,8 +382,7 @@ HvCleanup ( ...@@ -388,8 +382,7 @@ HvCleanup (
involves a hypercall. involves a hypercall.
--*/ --*/
static HV_STATUS HV_STATUS HvPostMessage(
HvPostMessage(
HV_CONNECTION_ID connectionId, HV_CONNECTION_ID connectionId,
HV_MESSAGE_TYPE messageType, HV_MESSAGE_TYPE messageType,
void * payload, void * payload,
...@@ -442,8 +435,7 @@ HvPostMessage( ...@@ -442,8 +435,7 @@ HvPostMessage(
involves a hypercall. involves a hypercall.
--*/ --*/
static HV_STATUS HV_STATUS HvSignalEvent(void)
HvSignalEvent(void)
{ {
HV_STATUS status; HV_STATUS status;
...@@ -464,10 +456,7 @@ HvSignalEvent(void) ...@@ -464,10 +456,7 @@ HvSignalEvent(void)
Otherwise, we create and initialize the message and event pages. Otherwise, we create and initialize the message and event pages.
--*/ --*/
static int int HvSynicInit (u32 irqVector)
HvSynicInit (
u32 irqVector
)
{ {
u64 version; u64 version;
HV_SYNIC_SIMP simp; HV_SYNIC_SIMP simp;
...@@ -607,10 +596,7 @@ HvSynicInit ( ...@@ -607,10 +596,7 @@ HvSynicInit (
Cleanup routine for HvSynicInit(). Cleanup routine for HvSynicInit().
--*/ --*/
static void void HvSynicCleanup(void)
HvSynicCleanup(
void
)
{ {
HV_SYNIC_SINT sharedSint; HV_SYNIC_SINT sharedSint;
HV_SYNIC_SIMP simp; HV_SYNIC_SIMP simp;
......
...@@ -29,48 +29,41 @@ ...@@ -29,48 +29,41 @@
#include "include/HvTypes.h" #include "include/HvTypes.h"
#include "include/HvStatus.h" #include "include/HvStatus.h"
/* #include "HvVmApi.h" */
/* #include "HvKeApi.h" */
/* #include "HvMmApi.h" */
/* #include "HvCpuApi.h" */
#include "include/HvHalApi.h" #include "include/HvHalApi.h"
#include "include/HvVpApi.h" #include "include/HvVpApi.h"
/* #include "HvTrApi.h" */
#include "include/HvSynicApi.h" #include "include/HvSynicApi.h"
/* #include "HvAmApi.h" */
/* #include "HvHkApi.h" */
/* #include "HvValApi.h" */
#include "include/HvHcApi.h" #include "include/HvHcApi.h"
#include "include/HvPtApi.h" #include "include/HvPtApi.h"
enum enum {
{ VMBUS_MESSAGE_CONNECTION_ID = 1,
VMBUS_MESSAGE_CONNECTION_ID = 1, VMBUS_MESSAGE_PORT_ID = 1,
VMBUS_MESSAGE_PORT_ID = 1, VMBUS_EVENT_CONNECTION_ID = 2,
VMBUS_EVENT_CONNECTION_ID = 2, VMBUS_EVENT_PORT_ID = 2,
VMBUS_EVENT_PORT_ID = 2, VMBUS_MONITOR_CONNECTION_ID = 3,
VMBUS_MONITOR_CONNECTION_ID = 3, VMBUS_MONITOR_PORT_ID = 3,
VMBUS_MONITOR_PORT_ID = 3, VMBUS_MESSAGE_SINT = 2,
VMBUS_MESSAGE_SINT = 2
}; };
/* #defines */ /* #defines */
#define HV_PRESENT_BIT 0x80000000 #define HV_PRESENT_BIT 0x80000000
#define HV_XENLINUX_GUEST_ID_LO 0x00000000 #define HV_XENLINUX_GUEST_ID_LO 0x00000000
#define HV_XENLINUX_GUEST_ID_HI 0x0B00B135 #define HV_XENLINUX_GUEST_ID_HI 0x0B00B135
#define HV_XENLINUX_GUEST_ID (((u64)HV_XENLINUX_GUEST_ID_HI << 32) | HV_XENLINUX_GUEST_ID_LO) #define HV_XENLINUX_GUEST_ID (((u64)HV_XENLINUX_GUEST_ID_HI << 32) \
| HV_XENLINUX_GUEST_ID_LO)
#define HV_LINUX_GUEST_ID_LO 0x00000000 #define HV_LINUX_GUEST_ID_LO 0x00000000
#define HV_LINUX_GUEST_ID_HI 0xB16B00B5 #define HV_LINUX_GUEST_ID_HI 0xB16B00B5
#define HV_LINUX_GUEST_ID (((u64)HV_LINUX_GUEST_ID_HI << 32) | HV_LINUX_GUEST_ID_LO) #define HV_LINUX_GUEST_ID (((u64)HV_LINUX_GUEST_ID_HI << 32) | \
HV_LINUX_GUEST_ID_LO)
#define HV_CPU_POWER_MANAGEMENT (1 << 0) #define HV_CPU_POWER_MANAGEMENT (1 << 0)
#define HV_RECOMMENDATIONS_MAX 4 #define HV_RECOMMENDATIONS_MAX 4
#define HV_X64_MAX 5 #define HV_X64_MAX 5
#define HV_CAPS_MAX 8 #define HV_CAPS_MAX 8
#define HV_HYPERCALL_PARAM_ALIGN sizeof(u64) #define HV_HYPERCALL_PARAM_ALIGN sizeof(u64)
...@@ -78,46 +71,60 @@ enum ...@@ -78,46 +71,60 @@ enum
/* Service definitions */ /* Service definitions */
#define HV_SERVICE_PARENT_PORT (0) #define HV_SERVICE_PARENT_PORT (0)
#define HV_SERVICE_PARENT_CONNECTION (0) #define HV_SERVICE_PARENT_CONNECTION (0)
#define HV_SERVICE_CONNECT_RESPONSE_SUCCESS (0) #define HV_SERVICE_CONNECT_RESPONSE_SUCCESS (0)
#define HV_SERVICE_CONNECT_RESPONSE_INVALID_PARAMETER (1) #define HV_SERVICE_CONNECT_RESPONSE_INVALID_PARAMETER (1)
#define HV_SERVICE_CONNECT_RESPONSE_UNKNOWN_SERVICE (2) #define HV_SERVICE_CONNECT_RESPONSE_UNKNOWN_SERVICE (2)
#define HV_SERVICE_CONNECT_RESPONSE_CONNECTION_REJECTED (3) #define HV_SERVICE_CONNECT_RESPONSE_CONNECTION_REJECTED (3)
#define HV_SERVICE_CONNECT_REQUEST_MESSAGE_ID (1) #define HV_SERVICE_CONNECT_REQUEST_MESSAGE_ID (1)
#define HV_SERVICE_CONNECT_RESPONSE_MESSAGE_ID (2) #define HV_SERVICE_CONNECT_RESPONSE_MESSAGE_ID (2)
#define HV_SERVICE_DISCONNECT_REQUEST_MESSAGE_ID (3) #define HV_SERVICE_DISCONNECT_REQUEST_MESSAGE_ID (3)
#define HV_SERVICE_DISCONNECT_RESPONSE_MESSAGE_ID (4) #define HV_SERVICE_DISCONNECT_RESPONSE_MESSAGE_ID (4)
#define HV_SERVICE_MAX_MESSAGE_ID (4) #define HV_SERVICE_MAX_MESSAGE_ID (4)
#define HV_SERVICE_PROTOCOL_VERSION (0x0010) #define HV_SERVICE_PROTOCOL_VERSION (0x0010)
#define HV_CONNECT_PAYLOAD_BYTE_COUNT 64 #define HV_CONNECT_PAYLOAD_BYTE_COUNT 64
/* #define VMBUS_REVISION_NUMBER 6 */ /* #define VMBUS_REVISION_NUMBER 6 */
/* #define VMBUS_PORT_ID 11 // Our local vmbus's port and connection id. Anything >0 is fine */
/* Our local vmbus's port and connection id. Anything >0 is fine */
/* #define VMBUS_PORT_ID 11 */
/* 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 */ /* 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 */
static const GUID VMBUS_SERVICE_ID = {.Data = {0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c, 0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4} }; static const GUID VMBUS_SERVICE_ID = {
.Data = {
0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c,
0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4
},
};
#define MAX_NUM_CPUS 1 #define MAX_NUM_CPUS 1
typedef struct { typedef struct {
u64 Align8; u64 Align8;
HV_INPUT_SIGNAL_EVENT Event; HV_INPUT_SIGNAL_EVENT Event;
} HV_INPUT_SIGNAL_EVENT_BUFFER; } HV_INPUT_SIGNAL_EVENT_BUFFER;
typedef struct { typedef struct {
u64 GuestId; /* XenLinux or native Linux. If XenLinux, the hypercall and synic pages has already been initialized */ /* XenLinux or native Linux. If XenLinux, the hypercall and synic pages
void* HypercallPage; * has already been initialized */
u64 GuestId;
void *HypercallPage;
bool SynICInitialized; bool SynICInitialized;
/* This is used as an input param to HvCallSignalEvent hypercall. The input param is immutable */
/* in our usage and must be dynamic mem (vs stack or global). */ /*
* This is used as an input param to HvCallSignalEvent hypercall. The
* input param is immutable in our usage and must be dynamic mem (vs
* stack or global). */
HV_INPUT_SIGNAL_EVENT_BUFFER *SignalEventBuffer; HV_INPUT_SIGNAL_EVENT_BUFFER *SignalEventBuffer;
HV_INPUT_SIGNAL_EVENT *SignalEventParam; /* 8-bytes aligned of the buffer above */ /* 8-bytes aligned of the buffer above */
HV_INPUT_SIGNAL_EVENT *SignalEventParam;
void *synICMessagePage[MAX_NUM_CPUS]; void *synICMessagePage[MAX_NUM_CPUS];
void *synICEventPage[MAX_NUM_CPUS]; void *synICEventPage[MAX_NUM_CPUS];
...@@ -128,37 +135,19 @@ extern HV_CONTEXT gHvContext; ...@@ -128,37 +135,19 @@ extern HV_CONTEXT gHvContext;
/* Hv Interface */ /* Hv Interface */
static int extern int HvInit(void);
HvInit(
void extern void HvCleanup(void);
);
extern HV_STATUS HvPostMessage(HV_CONNECTION_ID connectionId,
static void HV_MESSAGE_TYPE messageType,
HvCleanup( void *payload,
void size_t payloadSize);
);
extern HV_STATUS HvSignalEvent(void);
static HV_STATUS
HvPostMessage( extern int HvSynicInit(u32 irqVector);
HV_CONNECTION_ID connectionId,
HV_MESSAGE_TYPE messageType, extern void HvSynicCleanup(void);
void * payload,
size_t payloadSize
);
static HV_STATUS
HvSignalEvent(
void
);
static int
HvSynicInit(
u32 irqVector
);
static void
HvSynicCleanup(
void
);
#endif /* __HV_H__ */ #endif /* __HV_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment