From e0a8be55227d60db4362564e4bff034f68266ae9 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Fri, 24 Apr 2020 18:47:49 -0400 Subject: [PATCH] Don't let init sleep. This will cause us to hang in the scheduler. --- risc_v/src/main.rs | 1 + risc_v/src/process.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/risc_v/src/main.rs b/risc_v/src/main.rs index 0504e48..8a5ae18 100755 --- a/risc_v/src/main.rs +++ b/risc_v/src/main.rs @@ -4,6 +4,7 @@ #![no_main] #![no_std] #![feature(panic_info_message, + llvm_asm, asm, global_asm, allocator_api, diff --git a/risc_v/src/process.rs b/risc_v/src/process.rs index 8b2ef4b..a9b5aa6 100644 --- a/risc_v/src/process.rs +++ b/risc_v/src/process.rs @@ -157,7 +157,9 @@ fn init_process() { fn make_syscall(sysno: usize, duration: usize) -> usize; } println!("Init is still here :), alright, back to sleep."); - for _ in 0..100000000 {} + for _ in 0..100 { + llvm_asm!("wfi"); + } } } }