FreeBSD/Linux Kernel Cross Reference
sys/xen/features.c
1 #include <sys/cdefs.h>
2 __FBSDID("$FreeBSD: releng/9.0/sys/xen/features.c 189699 2009-03-11 15:30:12Z dfr $");
3
4 #include <sys/param.h>
5 #include <sys/systm.h>
6
7 #include <machine/xen/xen-os.h>
8 #include <xen/hypervisor.h>
9 #include <xen/features.h>
10
11 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32] /* __read_mostly */;
12
13 void
14 setup_xen_features(void)
15 {
16 xen_feature_info_t fi;
17 int i, j;
18
19 for (i = 0; i < XENFEAT_NR_SUBMAPS; i++) {
20 fi.submap_idx = i;
21 if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
22 break;
23 for (j = 0; j < 32; j++)
24 xen_features[i*32 + j] = !!(fi.submap & 1<<j);
25 }
26 }
Cache object: afcc084b8440742379282aeac1fa6820
|