-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
131 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use memory_addr::VirtAddr; | ||
|
||
use crate::arch::CacheOp; | ||
|
||
/// Performs a cache operation on all memory. | ||
pub fn dcache_all(_op: CacheOp) { | ||
// generic riscv cpu does not have data cache. | ||
|
||
// TODO: cpu specific cache operations. | ||
} | ||
|
||
/// Performs a cache operation on a range of memory. | ||
#[inline] | ||
pub fn dcache_range(_op: CacheOp, _addr: VirtAddr, _size: usize) {} | ||
|
||
/// Performs a cache operation on a cache line. | ||
#[inline] | ||
pub fn dcache_line(_op: CacheOp, _addr: VirtAddr) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use memory_addr::VirtAddr; | ||
|
||
use crate::arch::CacheOp; | ||
|
||
/// Performs a cache operation on all memory. | ||
pub fn dcache_all(_op: CacheOp) { | ||
// The cache coherency in x86 architectures is guaranteed by hardware. | ||
} | ||
|
||
/// Performs a cache operation on a range of memory. | ||
pub fn dcache_range(_op: CacheOp, _addr: VirtAddr, _size: usize) {} | ||
|
||
/// Performs a cache operation on a cache line. | ||
#[inline] | ||
pub fn dcache_line(_op: CacheOp, _addr: VirtAddr) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters