diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-02 11:36:20 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-16 06:36:06 +0200 |
commit | e7b878e42f0c358379206c025059feccd711804e (patch) | |
tree | 4ae6f341a04613cac534c8a098122fdfc3848008 /cpukit/score/cpu/arm | |
parent | Revert "rtems-fdt / shell - Fix string truncation warning" (diff) | |
download | rtems-e7b878e42f0c358379206c025059feccd711804e.tar.bz2 |
bsps/arm: Workaround for Errata 845369
Add a workaround for Cortex-A9 Errata 845369: Under Very Rare Timing
Circumstances Transition into Streaming Mode Might Create Data Corruption.
Update #4115.
Diffstat (limited to 'cpukit/score/cpu/arm')
-rw-r--r-- | cpukit/score/cpu/arm/include/libcpu/arm-cp15.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/cpukit/score/cpu/arm/include/libcpu/arm-cp15.h b/cpukit/score/cpu/arm/include/libcpu/arm-cp15.h index 6097d60ba6..5bc01dcb32 100644 --- a/cpukit/score/cpu/arm/include/libcpu/arm-cp15.h +++ b/cpukit/score/cpu/arm/include/libcpu/arm-cp15.h @@ -2308,6 +2308,38 @@ arm_cp15_set_counter_virtual_offset(uint64_t val) ); } +/* Diagnostic Control Register */ +ARM_CP15_TEXT_SECTION static inline uint32_t +arm_cp15_get_diagnostic_control(void) +{ + ARM_SWITCH_REGISTERS; + uint32_t val; + + __asm__ volatile ( + ARM_SWITCH_TO_ARM + "mrc p15, 0, %[val], c15, c0, 1\n" + ARM_SWITCH_BACK + : [val] "=&r" (val) ARM_SWITCH_ADDITIONAL_OUTPUT + ); + + return val; +} + +/* Diagnostic Control Register */ +ARM_CP15_TEXT_SECTION static inline void +arm_cp15_set_diagnostic_control(uint32_t val) +{ + ARM_SWITCH_REGISTERS; + + __asm__ volatile ( + ARM_SWITCH_TO_ARM + "mcr p15, 0, %[val], c15, c0, 1\n" + ARM_SWITCH_BACK + : ARM_SWITCH_OUTPUT + : [val] "r" (val) + ); +} + /** * @brief Sets the @a section_flags for the address range [@a begin, @a end). * |