@@ -24,6 +24,22 @@
DECLARE_BITMAP(cpu_hwcaps, ARM_NCAPS);
+void update_cpu_capabilities(const struct arm_cpu_capabilities *caps,
+ const char *info)
+{
+ int i;
+
+ for ( i = 0; caps[i].matches; i++ )
+ {
+ if ( !caps[i].matches(&caps[i]) )
+ continue;
+
+ if ( !cpus_have_cap(caps[i].capability) && caps[i].desc )
+ printk(XENLOG_INFO "%s: %s\n", info, caps[i].desc);
+ cpus_set_cap(caps[i].capability);
+ }
+}
+
/*
* Local variables:
* mode: C
@@ -62,6 +62,15 @@ static inline void cpus_set_cap(unsigned int num)
__set_bit(num, cpu_hwcaps);
}
+struct arm_cpu_capabilities {
+ const char *desc;
+ u16 capability;
+ bool_t (*matches)(const struct arm_cpu_capabilities *);
+};
+
+void update_cpu_capabilities(const struct arm_cpu_capabilities *caps,
+ const char *info);
+
#endif /* __ASSEMBLY__ */
#endif