From 8419b87c6bd7be468239d0f68155631dfb5db103 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Mon, 31 Dec 2012 13:55:56 +0100 Subject: Fixed FPU support. Selecting proper FPU flags in build_rules and enabling FPU during startup. --- startup/entry.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'startup') diff --git a/startup/entry.cpp b/startup/entry.cpp index d7385f8..64aac37 100644 --- a/startup/entry.cpp +++ b/startup/entry.cpp @@ -1,5 +1,6 @@ #include #include +#include int main(); @@ -35,6 +36,11 @@ void __attribute__((naked)) entry() { *wp++ = 0; } + // Enable FPU before calling any functions that can invoke FPU instructions. + #ifdef HAS_FPU + COPROC.CPAC |= (3 << 22) | (3 << 20); + #endif + // Call constructors. funcp_t* fp = &_init_array_start; -- cgit v1.2.3