Add a uniq test module for yunq in rust.
This commit is contained in:
parent
c1db6cb11f
commit
4ee8dc924c
13 changed files with 132 additions and 10 deletions
|
|
@ -9,4 +9,6 @@ name = "mammoth"
|
|||
[dependencies]
|
||||
linked_list_allocator = "0.10.5"
|
||||
|
||||
[build-dependencies]
|
||||
[features]
|
||||
hosted = []
|
||||
default = ["hosted"]
|
||||
|
|
|
|||
|
|
@ -2,13 +2,17 @@ use crate::cap::Capability;
|
|||
use crate::syscall;
|
||||
use crate::zion::ZError;
|
||||
use alloc::slice;
|
||||
|
||||
#[cfg(feature = "hosted")]
|
||||
use linked_list_allocator::LockedHeap;
|
||||
|
||||
#[cfg(feature = "hosted")]
|
||||
#[global_allocator]
|
||||
static ALLOCATOR: LockedHeap = LockedHeap::empty();
|
||||
|
||||
pub static mut CAN_ALLOC: bool = false;
|
||||
|
||||
#[cfg(feature = "hosted")]
|
||||
pub fn init_heap() {
|
||||
// 1 MiB
|
||||
let size = 0x10_0000;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ use crate::zion;
|
|||
use crate::zion::z_cap_t;
|
||||
use crate::zion::ZError;
|
||||
use core::ffi::c_void;
|
||||
|
||||
#[cfg(feature = "hosted")]
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[must_use]
|
||||
|
|
@ -18,6 +20,7 @@ fn syscall<T>(id: u64, req: &T) -> Result<(), ZError> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "hosted")]
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
unsafe {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue