10 Commits

Author SHA1 Message Date
Wang Chen
992b0ba91c fixed bug for syscall example
The original logic of setting mstatus has problem.
The or directive cannot set .MPP to 0.

Optimize the original code and use csrs and csrc instead.

Note we cannot assume the default value of mstatus is zero.
rvos may not be the first one to run on the system/virt.
It just so lucky that the initial value of mstatus is zero
on QEMU/virt.

Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
2024-03-25 21:10:40 +08:00
Hunter
2474692c8b Fix uses of .align
The GNU assembler responds to .align in a platform-dependent way. For a
use of '.align x', gas will align to 'x' bytes for some platforms,
but '2^x' bytes for other platforms including RISC-V. We are currently
reserving too much space with .align, so correct them by switching to
the more predictable .balign directive.

Signed-off-by: Hunter <>
2023-12-19 07:51:43 +08:00
Wang Chen
457713c30e Don't set MPIE explicitly
Because according to ISA specification: interrupts for M-mode, which
is higher than U-mode, are always globally enabled regardless of the
setting of the global MIE bit.
We don't set mstatus.MPIE to 1 explicitly to avoid misleading people
into thinking it is must-haveto-do.

Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
Co-authored-by: LiuJiLan <ldc31415926@126.com>
2023-06-18 09:11:19 +08:00
Wang Chen
a94fb0cd58 stack pointer aligment
Following the standard RISC-V calling convention, make sure
the stack pointer sp is always 16-byte aligned.

Fixed an issue, make sure the sp of task point to the bottom
of the stack, while originally we waste one byte (forgive my
stupid ~~~).

Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
2023-06-17 22:12:59 +08:00
Wang Chen
ca2629bebc I493SN:fix bugs introduced by I441IC 2021-09-08 08:38:58 +08:00
Wang Chen
d9f5e22e99 fixed issues I47WMN, I477IX,I441IC 2021-09-06 10:30:57 +08:00
Wang Chen
100cc9f1d9 This commitment contains following changes:
- updated openday report
- fixed I41BDM
- I3ZLLK, code part & errata part fixing
- fixed I3XWKC, ppt & errata part
- fixed I418VG
2021-07-22 17:10:04 +08:00
Wang Chen
07d7c9bfe6 I3TIR4 & I3TIOA & I3TIO6, added updated slides & poster 2021-06-07 09:20:42 +08:00
Wang Chen
4e72000601 updated before 7th class 2021-05-13 11:44:18 +08:00
Wang Chen
ad15280f3a initial versioin 2021-04-01 20:02:31 +08:00