@@ -111,6 +111,12 @@ impl SbiRet {
value: 0,
}
+ pub(crate) fn legacy_ok(legacy_value: usize) -> SbiRet {
+ SbiRet {
+ error: legacy_value,
+ value: 0,
+ }
// only used for legacy where a0, a1 return value is not modified
pub(crate) fn legacy_void(self, a0: usize, a1: usize) -> SbiRet {
SbiRet {
@@ -14,7 +14,7 @@ pub fn console_putchar(param0: usize) -> SbiRet {
#[inline]
pub fn console_getchar() -> SbiRet {
let ch = legacy_stdio_getchar();
- SbiRet::ok(ch as usize)
+ SbiRet::legacy_ok(ch as usize)