Skip to content

Commit ac487a6

Browse files
authored
fix(build): replace csr name sptbr with satp (#61)
* fix(build): replace csr name `sptbr` with `satp` This commits replaced the CSR name `sptbr` in source files with `satp`. The new code is checked to make sure this change does not break the functions modified. But further checkes might be required to make sure the tests are not broken. * fix(build): include `klib-macros.h` in `tests/softmdutest/main.c`.
1 parent 70bc16d commit ac487a6

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

tests/aliastest/src/alias.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ do_alias_init:
5050
la a1, page_table_1
5151
srl a1, a1, RISCV_PGSHIFT
5252
or a1, a1, a0
53-
csrw sptbr, a1
53+
csrw satp, a1
5454
sfence.vma
5555

5656
# Enter supervisor mode and make sure correct page is accessed

tests/aliastest/src/alias_jit.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ do_alias_jit_init:
5050
la a1, page_table_1
5151
srl a1, a1, RISCV_PGSHIFT
5252
or a1, a1, a0
53-
csrw sptbr, a1
53+
csrw satp, a1
5454
sfence.vma
5555

5656
# Write code to code_page

tests/memscantest/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static void init_pt()
173173
#else
174174
uintptr_t vm_choice = SATP_MODE_SV32;
175175
#endif
176-
write_csr(sptbr, ((uintptr_t)l1pt >> RISCV_PGSHIFT) |
176+
write_csr(satp, ((uintptr_t)l1pt >> RISCV_PGSHIFT) |
177177
(vm_choice * (SATP_MODE & ~(SATP_MODE<<1))));
178178
}
179179

tests/softmdutest/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <am.h>
22
#include <klib.h>
3+
#include <klib-macros.h>
34

45
#if !defined(__ARCH_RISCV32_NOOP) && !defined(__ARCH_RISCV64_NOOP)
56
typedef union {

tests/softprefetchtest/src/softprefetch.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ enable_vm:
119119
la a1, page_table_1
120120
srl a1, a1, RISCV_PGSHIFT
121121
or a1, a1, a0
122-
csrw sptbr, a1
122+
csrw satp, a1
123123
sfence.vma
124124

125125
# Enter supervisor mode and make sure correct page is accessed
@@ -186,4 +186,4 @@ code_page: # smode softprefetch test workload
186186

187187
.align 16
188188
data_page:
189-
.dword 0
189+
.dword 0

0 commit comments

Comments
 (0)