Skip to content

Commit 77b725a

Browse files
committed
port: riscv: Update the stack init function to include the fpu context size
1 parent 165cbb3 commit 77b725a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

portable/GCC/RISC-V/portASM.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ definitions. */
162162
* where the global and thread pointers are currently assumed to be constant so
163163
* are not saved:
164164
*
165+
* [FPU registers (when enabled/available) go here]
165166
* mstatus
166167
* xCriticalNesting
167168
* x31
@@ -196,6 +197,7 @@ definitions. */
196197
* pxCode
197198
*/
198199
pxPortInitialiseStack:
200+
addi a0, a0, -portFPUCONTEXT_SIZE
199201
csrr t0, mstatus /* Obtain current mstatus value. */
200202
andi t0, t0, ~0x8 /* Ensure interrupts are disabled when the stack is restored within an ISR. Required when a task is created after the scheduler has been started, otherwise interrupts would be disabled anyway. */
201203
addi t1, x0, 0x188 /* Generate the value 0x1880, which are the MPIE and MPP bits to set in mstatus. */

0 commit comments

Comments
 (0)