mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
![Paul Gortmaker](/assets/img/avatar_default.png)
Code that uses no modular facilities whatsoever should not be sourcing module.h at all, since that header drags in a bunch of other headers with it. Similarly, code that is not explicitly using modular facilities like module_init() but only is declaring module_param setup variables should be using moduleparam.h and not the larger module.h file for that. In making this change, we also uncover an implicit use of BUG() in inline fcns within arch/arm/include/asm/xen/hypercall.h so we explicitly source <linux/bug.h> for that file now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
33 lines
762 B
C
33 lines
762 B
C
/******************************************************************************
|
|
* features.c
|
|
*
|
|
* Xen feature flags.
|
|
*
|
|
* Copyright (c) 2006, Ian Campbell, XenSource Inc.
|
|
*/
|
|
#include <linux/types.h>
|
|
#include <linux/cache.h>
|
|
#include <linux/export.h>
|
|
|
|
#include <asm/xen/hypercall.h>
|
|
|
|
#include <xen/interface/xen.h>
|
|
#include <xen/interface/version.h>
|
|
#include <xen/features.h>
|
|
|
|
u8 xen_features[XENFEAT_NR_SUBMAPS * 32] __read_mostly;
|
|
EXPORT_SYMBOL_GPL(xen_features);
|
|
|
|
void xen_setup_features(void)
|
|
{
|
|
struct xen_feature_info fi;
|
|
int i, j;
|
|
|
|
for (i = 0; i < XENFEAT_NR_SUBMAPS; i++) {
|
|
fi.submap_idx = i;
|
|
if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
|
|
break;
|
|
for (j = 0; j < 32; j++)
|
|
xen_features[i * 32 + j] = !!(fi.submap & 1<<j);
|
|
}
|
|
}
|