From ac43f34528e0ffa63b32df4686159609ba06d968 Mon Sep 17 00:00:00 2001 From: schulz Date: Sat, 6 Apr 2019 12:01:34 +0000 Subject: [PATCH] Enable VFP unit as early as possible. This has to be so since e.g. gcc9 uses vfp much more intensively, e.g. for dividing and eventually as cache for general purpose registers, used instead of stack. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@56147 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/arm-native/kernel/kernel_cpu.c | 5 +++++ arch/arm-raspi/boot/boot.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm-native/kernel/kernel_cpu.c b/arch/arm-native/kernel/kernel_cpu.c index ce728bc76d..cc99b235bf 100644 --- a/arch/arm-native/kernel/kernel_cpu.c +++ b/arch/arm-native/kernel/kernel_cpu.c @@ -49,6 +49,11 @@ asm( " beq leave_hyper \n" "mpcore_continue_boot: \n" " cps #0x13 \n" +" mrc p15,0,r4,c1,c0,2 \n" /* Enable signle and double VFP coprocessors */ +" orr r4, r4, #0x00f00000 \n" /* This is necessary since gcc might want to use vfp registers */ +" mcr p15,0,r4,c1,c0,2 \n" /* Either as cache for general purpose regs or e.g. for division. This is the case with gcc9 */ +" mov r4,#0x40000000 \n" +" fmxr fpexc,r4 \n" /* Enable VFP now */ #if AROS_BIG_ENDIAN " setend be \n" /* If AROS is big endian set the endianess of cpu here */ #endif diff --git a/arch/arm-raspi/boot/boot.c b/arch/arm-raspi/boot/boot.c index 885e9f399f..176d4c3f0b 100644 --- a/arch/arm-raspi/boot/boot.c +++ b/arch/arm-raspi/boot/boot.c @@ -59,6 +59,11 @@ asm(" .section .aros.startup \n" " setend be \n" /* Switch to big endian mode */ #endif " ldr sp, tmp_stack_ptr \n" +" mrc p15,0,r4,c1,c0,2 \n" /* Enable signle and double VFP coprocessors */ +" orr r4, r4, #0x00f00000 \n" /* This is necessary since gcc might want to use vfp registers */ +" mcr p15,0,r4,c1,c0,2 \n" /* Either as cache for general purpose regs or e.g. for division. This is the case with gcc9 */ +" mov r4,#0x40000000 \n" +" fmxr fpexc,r4 \n" /* Enable VFP now */ " b boot \n" "leave_hyper: \n" #if AROS_BIG_ENDIAN -- 2.11.4.GIT