-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathESP-IDF.patch
More file actions
79 lines (75 loc) · 3.12 KB
/
ESP-IDF.patch
File metadata and controls
79 lines (75 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Subject: [PATCH] FPU_context_fix
---
Index: components/xtensa/xtensa_vectors.S
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/components/xtensa/xtensa_vectors.S b/components/xtensa/xtensa_vectors.S
--- a/components/xtensa/xtensa_vectors.S (revision 3a45d4e949a174e8829a2e4c86c421b030ceac5a)
+++ b/components/xtensa/xtensa_vectors.S (date 1751100427699)
@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: MIT
*
- * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD
+ * SPDX-FileContributor: 2016-2023 Espressif Systems (Shanghai) CO LTD
*/
/*
* Copyright (c) 2015-2019 Cadence Design Systems, Inc.
@@ -1016,6 +1016,12 @@
s32i a2, sp, XT_STK_A2
s32i a3, sp, XT_STK_A3
s32i a4, sp, XT_STK_A4
+#if portNUM_PROCESSORS > 1
+ /* If multicore, we must save two more interruptee's register to use as
+ * scratch when taking/releasing the _xt_coproc_owner_sa_lock spinlock. */
+ s32i a6, sp, XT_STK_A6
+ s32i a7, sp, XT_STK_A7
+#endif /* portNUM_PROCESSORS > 1 */
s32i a15, sp, XT_STK_A15
/* Call the RTOS coprocessor exception hook */
@@ -1046,7 +1052,7 @@
#if portNUM_PROCESSORS > 1
/* If multicore, we must also acquire the _xt_coproc_owner_sa_lock spinlock
* to ensure thread safe access of _xt_coproc_owner_sa between cores. */
- spinlock_take a0 a2 _xt_coproc_owner_sa_lock
+ spinlock_take a6 a7 _xt_coproc_owner_sa_lock
#endif /* portNUM_PROCESSORS > 1 */
/* Get old coprocessor owner thread (save area ptr) and assign new one. */
@@ -1057,7 +1063,7 @@
#if portNUM_PROCESSORS > 1
/* Release previously taken spinlock */
- spinlock_release a0 a2 _xt_coproc_owner_sa_lock
+ spinlock_release a6 a7 _xt_coproc_owner_sa_lock
#endif /* portNUM_PROCESSORS > 1 */
/* Only need to context switch if new owner != old owner. */
@@ -1140,6 +1146,10 @@
/* Can omit rsync for wsr.CPENABLE here because _xt_user_exit does it. */
.L_xt_coproc_done:
l32i a15, sp, XT_STK_A15
+#if portNUM_PROCESSORS > 1
+ l32i a6, sp, XT_STK_A6
+ l32i a7, sp, XT_STK_A7
+#endif /* portNUM_PROCESSORS > 1 */
l32i a5, sp, XT_STK_A5
l32i a4, sp, XT_STK_A4
l32i a3, sp, XT_STK_A3
@@ -1153,13 +1163,17 @@
bnone a2, a0, .L_xt_coproc_done /* if no match then done */
and a2, a2, a0 /* a2 = which CPs to restore */
extui a2, a2, 0, 8 /* extract low 8 bits */
+#if portNUM_PROCESSORS == 1
s32i a6, sp, XT_STK_A6 /* save extra needed regs */
s32i a7, sp, XT_STK_A7
+#endif /* portNUM_PROCESSORS == 1 */
s32i a13, sp, XT_STK_A13
s32i a14, sp, XT_STK_A14
call0 _xt_coproc_restorecs /* restore CP registers */
+#if portNUM_PROCESSORS == 1
l32i a6, sp, XT_STK_A6 /* restore saved registers */
l32i a7, sp, XT_STK_A7
+#endif /* portNUM_PROCESSORS == 1 */
l32i a13, sp, XT_STK_A13
l32i a14, sp, XT_STK_A14
j .L_xt_coproc_done