Pārlūkot izejas kodu

feat(prototyper): read `TLB_FLUSH_LIMIT` from config

Signed-off-by: Woshiluo Luo <[email protected]>
Woshiluo Luo 1 mēnesi atpakaļ
vecāks
revīzija
1eb68b99f4

+ 1 - 0
prototyper/prototyper/config_example.toml

@@ -4,3 +4,4 @@ heap_size = 32768 # 32 * 1024
 page_size = 4096
 log_level = "INFO"
 jump_address = 0x50000000
+tlb_flush_limit = 16384 # page_size * 4

+ 1 - 0
prototyper/prototyper/default.toml

@@ -4,3 +4,4 @@ heap_size = 32768 # 32 * 1024
 page_size = 4096
 log_level = "INFO"
 jump_address = 0x80200000
+tlb_flush_limit = 16384 # page_size * 4

+ 1 - 2
prototyper/prototyper/src/cfg.rs

@@ -20,7 +20,6 @@ pub const LOG_LEVEL: &'static str = CONFIG.log_level;
 /// Address for jump mode.
 #[cfg(feature = "jump")]
 pub const JUMP_ADDRESS: usize = CONFIG.jump_address as usize;
-
 /// TLB_FLUSH_LIMIT defines the TLB refresh range limit.
 /// If the TLB refresh range is greater than TLB_FLUSH_LIMIT, the entire TLB is refreshed.
-pub const TLB_FLUSH_LIMIT: usize = 4 * PAGE_SIZE;
+pub const TLB_FLUSH_LIMIT: usize = CONFIG.tlb_flush_limit as usize;