diff options
author | Frans Kaashoek <[email protected]> | 2019-07-17 05:53:47 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2019-07-17 05:53:47 -0400 |
commit | b924e44f06c9c0882a2cffe6c9215b12c5aee2e6 (patch) | |
tree | b1204b01142d7a5b41988b87a4c06b0aabe8b5c9 /kernel/riscv.h | |
parent | ce53416f4970ebb137c8e66dc75488cfefaf084d (diff) | |
parent | ebc39372096280a4a5957d3e3836c859e5d78a79 (diff) | |
download | xv6-labs-b924e44f06c9c0882a2cffe6c9215b12c5aee2e6.tar.gz xv6-labs-b924e44f06c9c0882a2cffe6c9215b12c5aee2e6.tar.bz2 xv6-labs-b924e44f06c9c0882a2cffe6c9215b12c5aee2e6.zip |
Merge branch 'riscv' of g.csail.mit.edu:xv6-dev into riscv
Diffstat (limited to 'kernel/riscv.h')
-rw-r--r-- | kernel/riscv.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/riscv.h b/kernel/riscv.h index e5c0f64..e35f3bc 100644 --- a/kernel/riscv.h +++ b/kernel/riscv.h @@ -312,6 +312,17 @@ r_ra() return x; } +// tell the machine to finish any previous writes to +// PTEs, so that a subsequent use of a virtual +// address or load of the SATP will see those writes. +// perhaps this also flushes the TLB. +static inline void +sfence_vma() +{ + // the zero, zero means flush all TLB entries. + asm volatile("sfence.vma zero, zero"); +} + #define PGSIZE 4096 // bytes per page #define PGSHIFT 12 // bits of offset within a page |