summaryrefslogtreecommitdiff
path: root/libcpu/risc-v/t-head/c906/stackframe.h
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2023-02-25 13:52:37 -0500
committerGitHub <[email protected]>2023-02-25 13:52:37 -0500
commit1acef4277b02e5084310ecd7028656ae535178f5 (patch)
tree03b6b6f0b3df75a1cef301e1e7b2b3d234213390 /libcpu/risc-v/t-head/c906/stackframe.h
parent759192f5f5af23ae360818483d35974ef5b91c78 (diff)
parente63e33a3c64327aef3556fa811df0a8ec1e0e7ee (diff)
Merge pull request #6981 from RT-Thread/masterserialX-dev
sync from master
Diffstat (limited to 'libcpu/risc-v/t-head/c906/stackframe.h')
-rw-r--r--libcpu/risc-v/t-head/c906/stackframe.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libcpu/risc-v/t-head/c906/stackframe.h b/libcpu/risc-v/t-head/c906/stackframe.h
index 1e191900b4..d6fd0c3c5e 100644
--- a/libcpu/risc-v/t-head/c906/stackframe.h
+++ b/libcpu/risc-v/t-head/c906/stackframe.h
@@ -13,6 +13,10 @@
#ifndef __STACKFRAME_H__
#define __STACKFRAME_H__
+#define BYTES(idx) ((idx) * REGBYTES)
+#define FRAME_OFF_SSTATUS BYTES(2)
+#define FRAME_OFF_SP BYTES(32)
+
#include "cpuport.h"
#include "encoding.h"
@@ -54,7 +58,7 @@
/**
* The register `tp` always save/restore when context switch,
* we call `lwp_user_setting_save` when syscall enter,
- * call `lwp_user_setting_restore` when syscall exit
+ * call `lwp_user_setting_restore` when syscall exit
* and modify context stack after `lwp_user_setting_restore` called
* so that the `tp` can be the correct thread area value.
*/