summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/vmbus
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-10-10 16:25:53 +0000
committerdim <dim@FreeBSD.org>2013-10-10 16:25:53 +0000
commitee09e09e18dadec88f8003162abd4820c128df3f (patch)
treeb83245d0c490fc27fc2c4a3adbf7b37352827c9e /sys/dev/hyperv/vmbus
parent83e71fe4f722622edac7f1b6b79ea5e801a75ea8 (diff)
downloadFreeBSD-src-ee09e09e18dadec88f8003162abd4820c128df3f.zip
FreeBSD-src-ee09e09e18dadec88f8003162abd4820c128df3f.tar.gz
In sys/dev/hyperv, fix a number of gcc warnings about usage of anonymous
union members in strict C99, by giving them names. While here, add some FreeBSD keywords where they were missing. Approved by: re (gjb) Reviewed by: grehan
Diffstat (limited to 'sys/dev/hyperv/vmbus')
-rw-r--r--sys/dev/hyperv/vmbus/hv_channel.c5
-rw-r--r--sys/dev/hyperv/vmbus/hv_hv.c34
-rw-r--r--sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c4
-rw-r--r--sys/dev/hyperv/vmbus/hv_vmbus_priv.h20
4 files changed, 35 insertions, 28 deletions
diff --git a/sys/dev/hyperv/vmbus/hv_channel.c b/sys/dev/hyperv/vmbus/hv_channel.c
index 17dfd76..c467c22 100644
--- a/sys/dev/hyperv/vmbus/hv_channel.c
+++ b/sys/dev/hyperv/vmbus/hv_channel.c
@@ -26,6 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
#include <sys/malloc.h>
#include <sys/systm.h>
@@ -70,7 +73,7 @@ vmbus_channel_set_event(hv_vmbus_channel *channel)
synch_set_bit(channel->monitor_bit,
(uint32_t *)&monitor_page->
- trigger_group[channel->monitor_group].pending);
+ trigger_group[channel->monitor_group].u.pending);
} else {
hv_vmbus_set_event(channel->offer_msg.child_rel_id);
}
diff --git a/sys/dev/hyperv/vmbus/hv_hv.c b/sys/dev/hyperv/vmbus/hv_hv.c
index c316732..77d3b0b 100644
--- a/sys/dev/hyperv/vmbus/hv_hv.c
+++ b/sys/dev/hyperv/vmbus/hv_hv.c
@@ -240,8 +240,8 @@ hv_vmbus_init(void)
if (virt_addr == NULL)
goto cleanup;
- hypercall_msr.enable = 1;
- hypercall_msr.guest_physical_address =
+ hypercall_msr.u.enable = 1;
+ hypercall_msr.u.guest_physical_address =
(hv_get_phys_addr(virt_addr) >> PAGE_SHIFT);
wrmsr(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64_t);
@@ -251,7 +251,7 @@ hv_vmbus_init(void)
hypercall_msr.as_uint64_t = 0;
hypercall_msr.as_uint64_t = rdmsr(HV_X64_MSR_HYPERCALL);
- if (!hypercall_msr.enable)
+ if (!hypercall_msr.u.enable)
goto cleanup;
hv_vmbus_g_context.hypercall_page = virt_addr;
@@ -284,7 +284,7 @@ hv_vmbus_init(void)
cleanup:
if (virt_addr != NULL) {
- if (hypercall_msr.enable) {
+ if (hypercall_msr.u.enable) {
hypercall_msr.as_uint64_t = 0;
wrmsr(HV_X64_MSR_HYPERCALL,
hypercall_msr.as_uint64_t);
@@ -426,8 +426,8 @@ hv_vmbus_synic_init(void *arg)
*/
simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP);
- simp.simp_enabled = 1;
- simp.base_simp_gpa = ((hv_get_phys_addr(
+ simp.u.simp_enabled = 1;
+ simp.u.base_simp_gpa = ((hv_get_phys_addr(
hv_vmbus_g_context.syn_ic_msg_page[cpu])) >> PAGE_SHIFT);
wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t);
@@ -436,23 +436,23 @@ hv_vmbus_synic_init(void *arg)
* Setup the Synic's event page
*/
siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP);
- siefp.siefp_enabled = 1;
- siefp.base_siefp_gpa = ((hv_get_phys_addr(
+ siefp.u.siefp_enabled = 1;
+ siefp.u.base_siefp_gpa = ((hv_get_phys_addr(
hv_vmbus_g_context.syn_ic_event_page[cpu])) >> PAGE_SHIFT);
wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t);
/*HV_SHARED_SINT_IDT_VECTOR + 0x20; */
- shared_sint.vector = setup_args->vector;
- shared_sint.masked = FALSE;
- shared_sint.auto_eoi = FALSE;
+ shared_sint.u.vector = setup_args->vector;
+ shared_sint.u.masked = FALSE;
+ shared_sint.u.auto_eoi = FALSE;
wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT,
shared_sint.as_uint64_t);
/* Enable the global synic bit */
sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL);
- sctrl.enable = 1;
+ sctrl.u.enable = 1;
wrmsr(HV_X64_MSR_SCONTROL, sctrl.as_uint64_t);
@@ -480,7 +480,7 @@ void hv_vmbus_synic_cleanup(void *arg)
shared_sint.as_uint64_t = rdmsr(
HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT);
- shared_sint.masked = 1;
+ shared_sint.u.masked = 1;
/*
* Disable the interrupt
@@ -490,14 +490,14 @@ void hv_vmbus_synic_cleanup(void *arg)
shared_sint.as_uint64_t);
simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP);
- simp.simp_enabled = 0;
- simp.base_simp_gpa = 0;
+ simp.u.simp_enabled = 0;
+ simp.u.base_simp_gpa = 0;
wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t);
siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP);
- siefp.siefp_enabled = 0;
- siefp.base_siefp_gpa = 0;
+ siefp.u.siefp_enabled = 0;
+ siefp.u.base_siefp_gpa = 0;
wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t);
}
diff --git a/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c b/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
index 08c6112..fb9e147 100644
--- a/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
+++ b/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
@@ -29,6 +29,8 @@
/*
* VM Bus Driver Implementation
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/bus.h>
@@ -113,7 +115,7 @@ vmbus_msg_swintr(void *dummy)
*/
wmb();
- if (msg->header.message_flags.message_pending) {
+ if (msg->header.message_flags.u.message_pending) {
/*
* This will cause message queue rescan to possibly
* deliver another msg from the hypervisor
diff --git a/sys/dev/hyperv/vmbus/hv_vmbus_priv.h b/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
index 4607d50..6bc875d 100644
--- a/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
+++ b/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
@@ -24,6 +24,8 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
#ifndef __HYPERV_PRIV_H__
@@ -285,7 +287,7 @@ typedef union {
struct {
uint8_t message_pending:1;
uint8_t reserved:7;
- };
+ } u;
} hv_vmbus_msg_flags;
typedef uint64_t hv_vmbus_partition_id;
@@ -393,7 +395,7 @@ typedef union {
*/
uint64_t os_id : 8;
uint64_t vendor_id : 16;
- };
+ } u;
} hv_vmbus_x64_msr_guest_os_id_contents;
/*
@@ -407,7 +409,7 @@ typedef union {
uint64_t enable :1;
uint64_t reserved :11;
uint64_t guest_physical_address :52;
- };
+ } u;
} hv_vmbus_x64_msr_hypercall_contents;
typedef union {
@@ -415,7 +417,7 @@ typedef union {
struct {
uint32_t group_enable :4;
uint32_t rsvd_z :28;
- };
+ } u;
} hv_vmbus_monitor_trigger_state;
typedef union {
@@ -423,7 +425,7 @@ typedef union {
struct {
uint32_t pending;
uint32_t armed;
- };
+ } u;
} hv_vmbus_monitor_trigger_group;
typedef struct {
@@ -499,7 +501,7 @@ typedef union {
uint64_t simp_enabled : 1;
uint64_t preserved : 11;
uint64_t base_simp_gpa : 52;
- };
+ } u;
} hv_vmbus_synic_simp;
/*
@@ -511,7 +513,7 @@ typedef union {
uint64_t siefp_enabled : 1;
uint64_t preserved : 11;
uint64_t base_siefp_gpa : 52;
- };
+ } u;
} hv_vmbus_synic_siefp;
/*
@@ -525,7 +527,7 @@ typedef union {
uint64_t masked : 1;
uint64_t auto_eoi : 1;
uint64_t reserved2 : 46;
- };
+ } u;
} hv_vmbus_synic_sint;
/*
@@ -536,7 +538,7 @@ typedef union _hv_vmbus_synic_scontrol {
struct {
uint64_t enable : 1;
uint64_t reserved : 63;
- };
+ } u;
} hv_vmbus_synic_scontrol;
/*
OpenPOWER on IntegriCloud