Started to implement syscall.rs

This commit is contained in:
Rémi Rativel
2023-03-29 17:16:08 +02:00
parent e117ec2132
commit 8e81358e51
5 changed files with 38 additions and 2 deletions

View File

@ -65,7 +65,7 @@ __start:
.globl Halt
.type __Halt, @function
Halt:
Shutdown:
addi a7,zero,SC_HALT
ecall
jr ra

21
test/userlib/syscall.rs Normal file
View File

@ -0,0 +1,21 @@
pub struct Burritos_Time {
seconds: i64,
nanos: i64
}
pub struct ThreadId{
id: u64
}
pub struct t_error{
t: i32
}
extern "C"{
fn Shutdown() -> ();
fn SysTime(t: Burritos_Time) -> ();
fn Exit(status: i32) -> ();
fn Exec(name: String) -> ThreadId;
fn newThread(debug_name: String, func: i32, arg: i32) -> ThreadId;
fn Join (id: ThreadId) -> t_error;
fn Yield() -> ();
fn Perror(mess: String) -> ();
}