From 21eaf258c1decab6415259a853072dabd999ae38 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 17 Aug 2021 09:50:08 +0200 Subject: [PATCH] update rust_payload --- rust_payload/src/low_level/opensbi.rs | 12 ++++++------ rust_payload/src/main.rs | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/rust_payload/src/low_level/opensbi.rs b/rust_payload/src/low_level/opensbi.rs index 48775ed7..8e841998 100644 --- a/rust_payload/src/low_level/opensbi.rs +++ b/rust_payload/src/low_level/opensbi.rs @@ -45,12 +45,12 @@ fn print_hex_part(u: u8) { 7 => print("7"), 8 => print("8"), 9 => print("9"), - 10 => print("A"), - 11 => print("B"), - 12 => print("C"), - 13 => print("D"), - 14 => print("E"), - 15 => print("F"), + 10 => print("a"), + 11 => print("b"), + 12 => print("c"), + 13 => print("d"), + 14 => print("e"), + 15 => print("f"), _ => unreachable!(), } } diff --git a/rust_payload/src/main.rs b/rust_payload/src/main.rs index 63966d9c..37c90123 100644 --- a/rust_payload/src/main.rs +++ b/rust_payload/src/main.rs @@ -38,7 +38,10 @@ pub fn main() -> ! { print_usize(register::time::read()); print("\n"); - println("Tests done, entering infinite loop!"); + println("Exiting via 'tohost' ecall..."); + ecall(93 /* tohost */, 0 /* exit code */, 0, 0); + + println("ecall failed (?), entering infinite loop!"); loop {} }