CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
endif
-CFLAGS += -march=armv7-a -mcpu=cortex-a15
+CFLAGS += -march=armv7-a -mcpu=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
check-$(gcc) = $(call cc-ver-check,CC,0x030400,"Xen requires at least gcc-3.4")
#include <xen/sched.h>
#include <xen/smp.h>
#include <xen/softirq.h>
+#include <asm/vfp.h>
#include "gic.h"
cpumask_t cpu_online_map;
WRITE_CP32((uint32_t) hyp_traps_vector, HVBAR);
mmu_init_secondary_cpu();
+ enable_vfp();
+
gic_init_secondary_cpu();
init_timer_interrupt();
gic_route_irqs();
--- /dev/null
+#ifndef __ARM_VFP_H_
+#define __ARM_VFP_H_
+
+#include <xen/types.h>
+
+#define FPEXC_EN (1u << 30)
+
+/* Save and restore FP state.
+ * Ought to be using the new vmrs/vmsr names, but older binutils has a
+ * bug where it only allows them to target fpscr (and not, say, fpexc). */
+#define READ_FP(reg) ({ \
+ uint32_t val; \
+ asm volatile ("fmrx %0, fp" #reg : "=r" (val)); \
+ val; })
+
+#define WRITE_FP(reg, val) do { \
+ asm volatile ("fmxr fp" #reg ", %0" : : "r" (val)); \
+} while (0)
+
+
+/* Start-of-day: Turn on VFP */
+static inline void enable_vfp(void)
+{
+ WRITE_FP(exc, READ_FP(exc) | FPEXC_EN);
+}
+
+#endif
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */