[riot-notifications] [RIOT-OS/RIOT] cpu/fe310: interrupt handling cleanup (#12276)
notifications at github.com
Mon Sep 23 19:50:28 CEST 2019
kenrabold commented on this pull request.
> /** @} */
* @brief Size of context switch frame
-#define CONTEXT_FRAME_SIZE (a7_OFFSET + 4)
+#define CONTEXT_FRAME_SIZE (pad_OFFSET + 12)
According to the RISC-V ABI, the stack pointer must be advanced a multiple of 16 bytes. I removed the saving/restoring of the thread pointer (tp) register because I was altering that register anyway as part of the context switching interrupt handling. The padding for the context frame structure needs 12 additional bytes at the end to be a multiple of 16 (28 registers saved * 4bytes + 12bytes = 128bytes for the stack frame). The padding was at the beginning of the structure - I moved it to the end, thus the +12.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications