mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 18:40:59 +02:00
fix(riscv): split enable_fpu() to enable_fpu() and clear_fpu()
This commit is contained in:
@@ -239,10 +239,13 @@ FORCE_INLINE_ATTR void rv_utils_intr_set_threshold(int priority_threshold)
|
|||||||
|
|
||||||
#if SOC_CPU_HAS_FPU
|
#if SOC_CPU_HAS_FPU
|
||||||
|
|
||||||
FORCE_INLINE_ATTR bool rv_utils_enable_fpu(void)
|
FORCE_INLINE_ATTR void rv_utils_enable_fpu(void)
|
||||||
{
|
{
|
||||||
/* Set mstatus[14:13] to 0b01 to start the floating-point unit initialization */
|
/* Set mstatus[14:13] to 0b01 to enable the floating-point unit */
|
||||||
RV_SET_CSR(mstatus, CSR_MSTATUS_FPU_ENA);
|
RV_SET_CSR(mstatus, CSR_MSTATUS_FPU_ENA);
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCE_INLINE_ATTR bool rv_utils_clear_fpu(void) {
|
||||||
/* On the ESP32-P4, the FPU can be used directly after setting `mstatus` bit 13.
|
/* On the ESP32-P4, the FPU can be used directly after setting `mstatus` bit 13.
|
||||||
* Since the interrupt handler expects the FPU states to be either 0b10 or 0b11,
|
* Since the interrupt handler expects the FPU states to be either 0b10 or 0b11,
|
||||||
* let's write the FPU CSR and clear the dirty bit afterwards. */
|
* let's write the FPU CSR and clear the dirty bit afterwards. */
|
||||||
|
Reference in New Issue
Block a user