mirror of https://github.com/m-labs/artiq.git
runtime: bump libfringe, impl ecall abi
See libfringe PR: M-Labs/libfringe#1
This commit is contained in:
parent
0a59c889de
commit
46326716fd
|
@ -163,9 +163,9 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fringe"
|
name = "fringe"
|
||||||
version = "1.2.1"
|
version = "1.2.1"
|
||||||
source = "git+https://git.m-labs.hk/M-Labs/libfringe.git?rev=9748bb#9748bb8af86c131d45be1238ea4d5f965a974630"
|
source = "git+https://git.m-labs.hk/M-Labs/libfringe.git?rev=3ecbe5#3ecbe53f7644b18ee46ebd5b2ca12c9cbceec43a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.101",
|
"libc 0.2.103",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -32,6 +32,6 @@ riscv = { version = "0.6.0", features = ["inline-asm"] }
|
||||||
|
|
||||||
[dependencies.fringe]
|
[dependencies.fringe]
|
||||||
git = "https://git.m-labs.hk/M-Labs/libfringe.git"
|
git = "https://git.m-labs.hk/M-Labs/libfringe.git"
|
||||||
rev = "9748bb"
|
rev = "3ecbe5"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["alloc"]
|
features = ["alloc"]
|
||||||
|
|
|
@ -290,6 +290,18 @@ pub extern fn exception(regs: *const TrapFrame) {
|
||||||
mcause::Trap::Interrupt(source) => {
|
mcause::Trap::Interrupt(source) => {
|
||||||
info!("Called interrupt with {:?}", source);
|
info!("Called interrupt with {:?}", source);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mcause::Trap::Exception(mcause::Exception::UserEnvCall) => {
|
||||||
|
unsafe {
|
||||||
|
if (*regs).a7 == 0 {
|
||||||
|
pmp::pop_pmp_region()
|
||||||
|
} else {
|
||||||
|
pmp::push_pmp_region((*regs).a7)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mepc::write(pc + 4);
|
||||||
|
},
|
||||||
|
|
||||||
mcause::Trap::Exception(e) => {
|
mcause::Trap::Exception(e) => {
|
||||||
println!("Trap frame: {:x?}", unsafe { *regs });
|
println!("Trap frame: {:x?}", unsafe { *regs });
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,8 @@ impl Thread {
|
||||||
let spawned = io.spawned.clone();
|
let spawned = io.spawned.clone();
|
||||||
let sockets = io.sockets.clone();
|
let sockets = io.sockets.clone();
|
||||||
|
|
||||||
let stack = OwnedStack::new(stack_size);
|
// Add a 4k stack guard to the stack of any new threads
|
||||||
|
let stack = OwnedStack::new(stack_size + 4096);
|
||||||
ThreadHandle::new(Thread {
|
ThreadHandle::new(Thread {
|
||||||
generator: Generator::unsafe_new(stack, |yielder, _| {
|
generator: Generator::unsafe_new(stack, |yielder, _| {
|
||||||
f(Io {
|
f(Io {
|
||||||
|
|
Loading…
Reference in New Issue