Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 123ed1b

Browse filesBrowse files
unicornxRbb666
authored andcommitted
bsp: qemu-virt64-riscv: remove config RISCV_S_MODE
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 <unicorn_wang@outlook.com>
1 parent bdd9447 commit 123ed1b
Copy full SHA for 123ed1b

File tree

Expand file treeCollapse file tree

6 files changed

+6
-10
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+6
-10
lines changed

‎bsp/qemu-virt64-riscv/.config

Copy file name to clipboardExpand all lines: bsp/qemu-virt64-riscv/.config
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
272272

273273
CONFIG_RT_USING_DFS_DEVFS=y
274274
CONFIG_RT_USING_DFS_ROMFS=y
275-
# CONFIG_RT_USING_DFS_ROMFS_USER_ROOT is not set
276275
# CONFIG_RT_USING_DFS_CROMFS is not set
277276
# CONFIG_RT_USING_DFS_TMPFS is not set
278277
# CONFIG_RT_USING_DFS_MQUEUE is not set
@@ -1434,7 +1433,6 @@ CONFIG_RT_USING_ADT_REF=y
14341433
#
14351434
# RISC-V QEMU virt64 configs
14361435
#
1437-
CONFIG_RISCV_S_MODE=y
14381436
CONFIG_BSP_USING_VIRTIO=y
14391437
CONFIG_BSP_USING_VIRTIO_BLK=y
14401438
CONFIG_BSP_USING_VIRTIO_NET=y

‎bsp/qemu-virt64-riscv/driver/Kconfig

Copy file name to clipboardExpand all lines: bsp/qemu-virt64-riscv/driver/Kconfig
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
menu "RISC-V QEMU virt64 configs"
22

3-
config RISCV_S_MODE
4-
bool "RT-Thread run in RISC-V S-Mode(supervisor mode)"
5-
default y
6-
73
config BSP_USING_VIRTIO
84
bool "Using VirtIO"
95
default y

‎bsp/qemu-virt64-riscv/rtconfig.h

Copy file name to clipboardExpand all lines: bsp/qemu-virt64-riscv/rtconfig.h
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@
519519

520520
/* RISC-V QEMU virt64 configs */
521521

522-
#define RISCV_S_MODE
523522
#define BSP_USING_VIRTIO
524523
#define BSP_USING_VIRTIO_BLK
525524
#define BSP_USING_VIRTIO_NET

‎libcpu/risc-v/common64/README.md

Copy file name to clipboardExpand all lines: libcpu/risc-v/common64/README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
| 选项 | 默认值 | 说明 |
3535
| --------------- | --- | ---------------------------------------------------------------------------------------------------- |
36-
| RISCV_S_MODE | 打开 | 系统启动后是否运行在S态,关闭时系统将运行在M态;目前系统存在bug尚不可直接运行在M态,故此开关必须打开 |
36+
| RISCV_VIRT64_S_MODE | 打开 | 系统启动后是否运行在S态,关闭时系统将运行在M态;目前系统存在bug尚不可直接运行在M态,故此开关必须打开 |
3737
| RT_USING_SMART | 关闭 | 是否开启RTThread SMART版本,开启后系统运行在S+U态,且会开启MMU页表(satp);关闭时系统仅运行在S态,MMU关闭(satp为bare translation) |
3838
| ARCH_USING_ASID | 关闭 | MMU是否支持asid |
3939

‎libcpu/risc-v/virt64/plic.c

Copy file name to clipboardExpand all lines: libcpu/risc-v/virt64/plic.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void plic_irq_enable(int irq)
5252
{
5353
int hart = __raw_hartid();
5454
*(uint32_t *)PLIC_ENABLE(hart) = ((*(uint32_t *)PLIC_ENABLE(hart)) | (1 << irq));
55-
#ifdef RISCV_S_MODE
55+
#ifdef RISCV_VIRT64_S_MODE
5656
set_csr(sie, read_csr(sie) | MIP_SEIP);
5757
#else
5858
set_csr(mie, read_csr(mie) | MIP_MEIP);

‎libcpu/risc-v/virt64/plic.h

Copy file name to clipboardExpand all lines: libcpu/risc-v/virt64/plic.h
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ extern size_t plic_base;
3030
#define PLIC_ENABLE_STRIDE 0x80
3131
#define PLIC_CONTEXT_STRIDE 0x1000
3232

33-
#ifndef RISCV_S_MODE
33+
/* RT-Thread runs in S-mode on virt64 by default */
34+
#define RISCV_VIRT64_S_MODE
35+
36+
#ifndef RISCV_VIRT64_S_MODE
3437
#define PLIC_MENABLE_OFFSET (0x2000)
3538
#define PLIC_MTHRESHOLD_OFFSET (0x200000)
3639
#define PLIC_MCLAIM_OFFSET (0x200004)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.