nuttx/arch/arm/src/armv7-a/arm_fpuconfig.S

88 lines
2.8 KiB
ArmAsm
Raw Normal View History

2013-07-21 20:52:38 +02:00
/****************************************************************************
* arch/arm/src/armv7-a/arm_fpuconfig.S
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
2013-07-21 20:52:38 +02:00
*
* http://www.apache.org/licenses/LICENSE-2.0
2013-07-21 20:52:38 +02:00
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
2013-07-21 20:52:38 +02:00
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include "cp15.h"
#ifdef CONFIG_ARCH_FPU
2013-07-21 20:52:38 +02:00
/****************************************************************************
* Pre-processor Definitions
2013-07-21 20:52:38 +02:00
****************************************************************************/
/****************************************************************************
* Public Symbols
****************************************************************************/
.globl arm_fpuconfig
.file "arm_fpuconfig.S"
2013-07-21 20:52:38 +02:00
/****************************************************************************
* Assembly Macros
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
.text
.syntax unified
.arm
2013-07-21 20:52:38 +02:00
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: arm_fpuconfig
2013-07-21 20:52:38 +02:00
*
* Description:
* Configure the FPU. Enables access to CP10 and CP11
*
****************************************************************************/
.globl arm_fpuconfig
.type arm_fpuconfig, %function
arm_fpuconfig:
/* Enable access to CP10 and CP11 in CP15.CACR */
mrc CP15_CPACR(r0)
orr r0, r0, #0xf00000
mcr CP15_CPACR(r0)
/* Enable access to CP10 and CP11 in CP15.NSACR */
/* REVISIT: Do we need to do this? */
/* Set FPEXC.EN (B30) */
fmrx r0, fpexc
2013-07-21 20:52:38 +02:00
orr r0, r0, #0x40000000
fmxr fpexc, r0
2013-12-08 17:38:33 +01:00
bx lr
2013-07-21 20:52:38 +02:00
.size arm_fpuconfig, . - arm_fpuconfig
#endif
2013-07-21 20:52:38 +02:00
.end