summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/arm/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-08-10 18:36:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-08-12 19:08:19 +0200
commit8ae373235b316ff10c3b6f30ac1f2efed9bec011 (patch)
treef52d2ff1e1ba63036c7d1f5f34ba41db783d1f00 /cpukit/score/cpu/arm/rtems
parentbsp/altera-cyclone-v: Add RTC driver. (diff)
downloadrtems-8ae373235b316ff10c3b6f30ac1f2efed9bec011.tar.bz2
arm: Add support for FPv4-SP floating point unit
This floating point unit is available in Cortex-M4 processors and defined by ARMv7-M. This adds basic support for other VFP-D16 variants.
Diffstat (limited to 'cpukit/score/cpu/arm/rtems')
-rw-r--r--cpukit/score/cpu/arm/rtems/score/arm.h17
-rw-r--r--cpukit/score/cpu/arm/rtems/score/armv7m.h37
-rw-r--r--cpukit/score/cpu/arm/rtems/score/cpu.h8
3 files changed, 53 insertions, 9 deletions
diff --git a/cpukit/score/cpu/arm/rtems/score/arm.h b/cpukit/score/cpu/arm/rtems/score/arm.h
index a105f17ad2..586a8cb2e9 100644
--- a/cpukit/score/cpu/arm/rtems/score/arm.h
+++ b/cpukit/score/cpu/arm/rtems/score/arm.h
@@ -50,10 +50,19 @@ extern "C" {
#define ARM_MULTILIB_HAS_THREAD_ID_REGISTER
#endif
-#if defined(__ARM_NEON__)
- #define ARM_MULTILIB_VFP_D32
-#elif !defined(__SOFTFP__)
- #error "FPU support not implemented"
+#if !defined(__SOFTFP__)
+ #if defined(__ARM_NEON__)
+ #define ARM_MULTILIB_VFP_D32
+ #elif defined(__VFP_FP__)
+ #define ARM_MULTILIB_VFP_D16
+ #else
+ #error "FPU support not implemented"
+ #endif
+#endif
+
+#if defined(ARM_MULTILIB_VFP_D16) \
+ || defined(ARM_MULTILIB_VFP_D32)
+ #define ARM_MULTILIB_VFP
#endif
/*
diff --git a/cpukit/score/cpu/arm/rtems/score/armv7m.h b/cpukit/score/cpu/arm/rtems/score/armv7m.h
index b54585921a..c5e473ec0a 100644
--- a/cpukit/score/cpu/arm/rtems/score/armv7m.h
+++ b/cpukit/score/cpu/arm/rtems/score/armv7m.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2011 Sebastian Huber. All rights reserved.
+ * Copyright (c) 2011-2014 Sebastian Huber. All rights reserved.
*
* embedded brains GmbH
* Obere Lagerstr. 30
@@ -29,6 +29,11 @@ extern "C" {
#ifdef ARM_MULTILIB_ARCH_V7M
+/* Coprocessor Access Control Register, CPACR */
+#define ARMV7M_CPACR 0xe000ed88
+
+#ifndef ASM
+
typedef struct {
uint32_t reserved_0;
uint32_t ictr;
@@ -47,6 +52,26 @@ typedef struct {
void *register_lr;
void *register_pc;
uint32_t register_xpsr;
+#ifdef ARM_MULTILIB_VFP
+ uint32_t register_s0;
+ uint32_t register_s1;
+ uint32_t register_s2;
+ uint32_t register_s3;
+ uint32_t register_s4;
+ uint32_t register_s5;
+ uint32_t register_s6;
+ uint32_t register_s7;
+ uint32_t register_s8;
+ uint32_t register_s9;
+ uint32_t register_s10;
+ uint32_t register_s11;
+ uint32_t register_s12;
+ uint32_t register_s13;
+ uint32_t register_s14;
+ uint32_t register_s15;
+ uint32_t register_fpscr;
+ uint32_t reserved;
+#endif
} ARMV7M_Exception_frame;
typedef struct {
@@ -97,6 +122,14 @@ typedef struct {
uint32_t mmfar;
uint32_t bfar;
uint32_t afsr;
+ uint32_t reserved_e000ed40[18];
+ uint32_t cpacr;
+ uint32_t reserved_e000ed8c[106];
+ uint32_t fpccr;
+ uint32_t fpcar;
+ uint32_t fpdscr;
+ uint32_t mvfr0;
+ uint32_t mvfr1;
} ARMV7M_SCB;
typedef struct {
@@ -504,6 +537,8 @@ void _ARMV7M_Pendable_service_call( void );
void _ARMV7M_Supervisor_call( void );
+#endif /* ASM */
+
#endif /* ARM_MULTILIB_ARCH_V7M */
#ifdef __cplusplus
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h
index ad070dfbad..089fc27fbb 100644
--- a/cpukit/score/cpu/arm/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/rtems/score/cpu.h
@@ -8,7 +8,7 @@
* This include file contains information pertaining to the ARM
* processor.
*
- * Copyright (c) 2009-2013 embedded brains GmbH.
+ * Copyright (c) 2009-2014 embedded brains GmbH.
*
* Copyright (c) 2007 Ray Xu <Rayx.cn@gmail.com>
*
@@ -212,12 +212,12 @@
#define ARM_CONTEXT_CONTROL_THREAD_ID_OFFSET 44
#endif
-#ifdef ARM_MULTILIB_VFP_D32
+#ifdef ARM_MULTILIB_VFP
#define ARM_CONTEXT_CONTROL_D8_OFFSET 48
#endif
#ifdef RTEMS_SMP
- #ifdef ARM_MULTILIB_VFP_D32
+ #ifdef ARM_MULTILIB_VFP
#define ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET 112
#else
#define ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET 48
@@ -278,7 +278,7 @@ typedef struct {
#ifdef ARM_MULTILIB_HAS_THREAD_ID_REGISTER
uint32_t thread_id;
#endif
-#ifdef ARM_MULTILIB_VFP_D32
+#ifdef ARM_MULTILIB_VFP
uint64_t register_d8;
uint64_t register_d9;
uint64_t register_d10;