Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144644853
D18462.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D18462.diff
View Options
Index: head/sys/riscv/include/cpufunc.h
===================================================================
--- head/sys/riscv/include/cpufunc.h
+++ head/sys/riscv/include/cpufunc.h
@@ -109,6 +109,13 @@
#define rdinstret() csr_read64(instret)
#define rdhpmcounter(n) csr_read64(hpmcounter##n)
+static __inline void
+load_satp(uint64_t val)
+{
+
+ __asm __volatile("csrw satp, %0" :: "r"(val));
+}
+
#define cpufunc_nullop() riscv_nullop()
void riscv_nullop(void);
Index: head/sys/riscv/riscv/locore.S
===================================================================
--- head/sys/riscv/riscv/locore.S
+++ head/sys/riscv/riscv/locore.S
@@ -152,7 +152,7 @@
li t0, SATP_MODE_SV39
or s2, s2, t0
sfence.vma
- csrw sptbr, s2
+ csrw satp, s2
.align 2
va:
@@ -297,7 +297,7 @@
li t0, SATP_MODE_SV39
or s2, s2, t0
sfence.vma
- csrw sptbr, s2
+ csrw satp, s2
.align 2
mpva:
Index: head/sys/riscv/riscv/pmap.c
===================================================================
--- head/sys/riscv/riscv/pmap.c
+++ head/sys/riscv/riscv/pmap.c
@@ -3302,7 +3302,7 @@
reg = SATP_MODE_SV39;
reg |= (td->td_pcb->pcb_l1addr >> PAGE_SHIFT);
- __asm __volatile("csrw sptbr, %0" :: "r"(reg));
+ load_satp(reg);
pmap_invalidate_all(pmap);
critical_exit();
Index: head/sys/riscv/riscv/swtch.S
===================================================================
--- head/sys/riscv/riscv/swtch.S
+++ head/sys/riscv/riscv/swtch.S
@@ -223,7 +223,7 @@
srli t0, t0, PAGE_SHIFT
li t1, SATP_MODE_SV39
or t0, t0, t1
- csrw sptbr, t0
+ csrw satp, t0
/* TODO: Invalidate the TLB */
@@ -341,7 +341,7 @@
srli t0, t0, PAGE_SHIFT
li t1, SATP_MODE_SV39
or t0, t0, t1
- csrw sptbr, t0
+ csrw satp, t0
/* TODO: Invalidate the TLB */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 11, 2:05 PM (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28653974
Default Alt Text
D18462.diff (1 KB)
Attached To
Mode
D18462: Rename sptbr to satp.
Attached
Detach File
Event Timeline
Log In to Comment