File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 1+ //! Constants used in rCore for qemu
2+
3+ pub const CLOCK_FREQ : usize = 12500000 ;
Original file line number Diff line number Diff line change 2222#![ feature( panic_info_message) ]
2323
2424use core:: arch:: global_asm;
25+
26+ #[ path = "boards/qemu.rs" ]
27+ mod board;
28+
2529#[ macro_use]
2630mod console;
2731mod config;
Original file line number Diff line number Diff line change @@ -6,11 +6,9 @@ pub fn console_putchar(c: usize) {
66 sbi_rt:: legacy:: console_putchar ( c) ;
77}
88
9- /// use sbi call to getchar from console (qemu uart handler)
10- #[ allow( unused) ]
11- pub fn console_getchar ( ) -> usize {
12- #[ allow( deprecated) ]
13- sbi_rt:: legacy:: console_getchar ( )
9+ /// use sbi call to set timer
10+ pub fn set_timer ( timer : usize ) {
11+ sbi_rt:: set_timer ( timer as _ ) ;
1412}
1513
1614/// use sbi call to shutdown the kernel
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ mod task;
1717
1818use crate :: config:: MAX_APP_NUM ;
1919use crate :: loader:: { get_num_app, init_app_cx} ;
20+ use crate :: sbi:: shutdown;
2021use crate :: sync:: UPSafeCell ;
2122use lazy_static:: * ;
2223use switch:: __switch;
@@ -134,8 +135,7 @@ impl TaskManager {
134135 // go back to user mode
135136 } else {
136137 println ! ( "All applications completed!" ) ;
137- use crate :: board:: QEMUExit ;
138- crate :: board:: QEMU_EXIT_HANDLE . exit_success ( ) ;
138+ shutdown ( false ) ;
139139 }
140140 }
141141}
You can’t perform that action at this time.
0 commit comments