<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rt-thread.git/libcpu/risc-v, branch v5.2.0-beta</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/rt-thread.git/atom/libcpu/risc-v?h=v5.2.0-beta</id>
<link rel='self' href='http://cgit.235523.xyz/rt-thread.git/atom/libcpu/risc-v?h=v5.2.0-beta'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/'/>
<updated>2025-03-10T14:48:27Z</updated>
<entry>
<title>[libcpu][riscv] add a doc for wch saving the irq stack as  stack-512 (#10063)</title>
<updated>2025-03-10T14:48:27Z</updated>
<author>
<name>Kai</name>
<email>60053077+kaidegit@users.noreply.github.com</email>
</author>
<published>2025-03-03T15:13:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=35b886726cc13039029608e3c1aee6a6f8c094d3'/>
<id>urn:sha1:35b886726cc13039029608e3c1aee6a6f8c094d3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[libcpu][risc-v]add comments for rv64 sv39 mmu APIs. (#10053)</title>
<updated>2025-03-10T14:47:50Z</updated>
<author>
<name>Guorui Li</name>
<email>liguorui1213@163.com</email>
</author>
<published>2025-03-01T16:03:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=facc1fd85aa9e039a695014021dc537691bea2e7'/>
<id>urn:sha1:facc1fd85aa9e039a695014021dc537691bea2e7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[bugfix][risc-v]fix the PPN length error in GET_PPN(pte). (#10020)</title>
<updated>2025-03-10T14:47:03Z</updated>
<author>
<name>Guorui Li</name>
<email>liguorui1213@163.com</email>
</author>
<published>2025-02-28T00:23:46Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=a3ded3bc4ca56d0e292870197bb3c2fab9b90682'/>
<id>urn:sha1:a3ded3bc4ca56d0e292870197bb3c2fab9b90682</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libcpu: riscv: fixed ARCH_RISCV_VECTOR issue</title>
<updated>2025-03-10T14:44:46Z</updated>
<author>
<name>kenneth.liu</name>
<email>kenneth.liu@sophgo.com</email>
</author>
<published>2025-01-24T03:35:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=fa75f38e1c131be2f86413375c9cd1ba2baef5ef'/>
<id>urn:sha1:fa75f38e1c131be2f86413375c9cd1ba2baef5ef</id>
<content type='text'>
description: Using the vector instruction set to trigger
an illegal instruction exception when ARCH_SISCV_VECTOR=y.

analysis: When initializing the thread stack,
the rt_cw_stack_init function did not enable VS for SSTATUS.

Solution: When ARCH_SISCV_VECTOR=y,
increment the initial value of sstatus by 0x600(SSTATUS_VS).

Signed-off-by: Liu Gui &lt;kenneth.liu@sophgo.com&gt;
</content>
</entry>
<entry>
<title>libcpu: riscv: rv64: fixed warnings</title>
<updated>2025-01-30T01:28:38Z</updated>
<author>
<name>Chen Wang</name>
<email>unicorn_wang@outlook.com</email>
</author>
<published>2025-01-27T06:18:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=c66374705a05d1f780c66aeefabe1c88c563e065'/>
<id>urn:sha1:c66374705a05d1f780c66aeefabe1c88c563e065</id>
<content type='text'>
When building bsp/cvitek/c906_little, compiler reports:

```
.../rt-thread/libcpu/risc-v/rv64/trap.c:
In function 'handle_trap':
.../rt-thread/libcpu/risc-v/rv64/trap.c:106:13:
warning: implicit declaration of function 'rt_hw_tick_isr';
did you mean 'rt_hw_stack_init'? [-Wimplicit-function-declaration]
  106 |             rt_hw_tick_isr();
      |             ^~~~~~~~~~~~~~
      |             rt_hw_stack_init
.../rt-thread/libcpu/risc-v/rv64/trap.c:110:13:
warning: implicit declaration of function 'rt_hw_irq_isr';
did you mean 'rt_hw_soft_irq_isr'? [-Wimplicit-function-declaration]
  110 |             rt_hw_irq_isr();
      |             ^~~~~~~~~~~~~
      |             rt_hw_soft_irq_isr
```

rt_hw_tick_isr()/rt_hw_irq_isr() are implemented by bsp, but
libcpu/risc-v/rv64 doesn't declare them, so compiler warns.

There are three BSPs using 'rv64' (libcpu/risc-v/rv64):
- `bsp/cvitek/c906_little/rtconfig.py`
- `bsp/juicevm/rtconfig.py`
- `bsp/k210/rtconfig.py`

`handle_trap` in `libcpu/risc-v/rv64` is defined as weak.
BSP can use this function directly or define and overload
it by itself.
If bsp use this function directly, bsp need to pay
attention to the fact that three functions will be called
in this function:

- `rt_hw_soft_irq_isr`
- `rt_hw_tick_isr`
- `rt_hw_irq_isr`

In `libcpu/risc-v/rv64`, `rt_hw_soft_irq_isr` has a weak
definition, while the other two do not. This means that
if the bsp does not overload `handle_trap`, bsp must
define `rt_hw_tick_isr` and `rt_hw_irq_isr` itself.
This is also the practice of `bsp/cvitek/c906_little`.
There is also a similar bsp `bsp/k210`, and the form of
`bsp/juicevm` implements `handle_trap` by itself.

It seems that `rt_hw_tick_isr` and `rt_hw_irq_isr` are
not required to be implemented by all BSPs using
`libcpu/risc-v/rv64`. The premise for BSP to implement
them is that it does not overload `handle_trap`. So
declaring `rt_hw_tick_isr` and `rt_hw_irq_isr` with
extern in `libcpu/risc-v/rv64` is not proper.

In addition, the `rt_hw_tick_isr/rt_hw_irq_isr` are only
used by `libcpu/risc-v/rv64`, so it is not worth putting
the declaration in `./include/rthw.h`.

Sum up, the best solution is to add weak definition to
`rt_hw_tick_isr/rt_hw_irq_isr` as existing `rt_hw_soft_irq_isr`.

Signed-off-by: Chen Wang &lt;unicorn_wang@outlook.com&gt;
</content>
</entry>
<entry>
<title>libcpu: riscv: common: fixed build warnings</title>
<updated>2025-01-30T01:28:38Z</updated>
<author>
<name>Chen Wang</name>
<email>unicorn_wang@outlook.com</email>
</author>
<published>2025-01-27T02:58:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=2dfbae28532303526f6bf4b60a54794c845d444a'/>
<id>urn:sha1:2dfbae28532303526f6bf4b60a54794c845d444a</id>
<content type='text'>
When building bsp/cvitek/c906_little, compiler warns:

```
.../rt-thread/libcpu/risc-v/common/trap_common.c:
In function 'rt_hw_interrupt_install':
.../rt-thread/libcpu/risc-v/common/trap_common.c:50:11:
warning: unused variable 'user_param' [-Wunused-variable]
   50 |     void *user_param = param;
      |           ^~~~~~~~~~
.../rt-thread/libcpu/risc-v/common/trap_common.c:
In function 'rt_rv32_system_irq_handler':
.../rt-thread/libcpu/risc-v/common/trap_common.c:77:25:
warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   77 |         s_stack_frame = (rt_hw_stack_frame_t *)mscratch;
      |                         ^
```

Fixed these warnings as per indication from gcc.

Signed-off-by: Chen Wang &lt;unicorn_wang@outlook.com&gt;
</content>
</entry>
<entry>
<title>bsp: qemu-virt64-riscv: remove config RISCV_S_MODE</title>
<updated>2025-01-10T09:14:13Z</updated>
<author>
<name>Chen Wang</name>
<email>unicorn_wang@outlook.com</email>
</author>
<published>2025-01-08T08:39:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=123ed1be1b17161e64b9b775f7fb9deb1d386416'/>
<id>urn:sha1:123ed1be1b17161e64b9b775f7fb9deb1d386416</id>
<content type='text'>
RISCV_S_MODE configuration only affects the code in
libcpu/risc-v/virt64, and the only bsp using this
libcpu is qemu-virt64-riscv.

Considering s-mode is the default mode RT-Thread
running on virt64 machine, it seems unnecessary to
make RISCV_S_MODE a Kconfig option.

Solution: Remove RISCV_S_MODE from Kconfig and define
it as a macro in the code in libcpu/risc-v/virt64.

Plus, due to this macro is only related to virt64, rename
RISCV_S_MODE to RISCV_VIRT64_S_MODE.

Update the .config/rtconfig.h in this patch.

Signed-off-by: Chen Wang &lt;unicorn_wang@outlook.com&gt;
</content>
</entry>
<entry>
<title>[libcpu/riscv]解决smp下cpuport.h中的编译问题 (#9714)</title>
<updated>2024-11-29T01:39:41Z</updated>
<author>
<name>heyuanjie87</name>
<email>943313837@qq.com</email>
</author>
<published>2024-11-29T01:39:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=03a9729eb8beb002d5beca6433c31751415f6a11'/>
<id>urn:sha1:03a9729eb8beb002d5beca6433c31751415f6a11</id>
<content type='text'>
</content>
</entry>
<entry>
<title>给vector模块添加构建脚本</title>
<updated>2024-11-27T10:04:59Z</updated>
<author>
<name>heyuanjie87</name>
<email>943313837@qq.com</email>
</author>
<published>2024-11-22T03:58:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=d3820ed77e26759c3a3d29dad65bbcca371374c6'/>
<id>urn:sha1:d3820ed77e26759c3a3d29dad65bbcca371374c6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[libcpu][riscv]virt64使用通用vector支持代码</title>
<updated>2024-11-27T10:04:59Z</updated>
<author>
<name>heyuanjie87</name>
<email>943313837@qq.com</email>
</author>
<published>2024-11-21T09:18:35Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=3268716c4fdd506487f89b39b09b8f5339882ae5'/>
<id>urn:sha1:3268716c4fdd506487f89b39b09b8f5339882ae5</id>
<content type='text'>
</content>
</entry>
</feed>
