mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
examples: remove memory checks
These take a long time to start up. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
1b8f97a5a3
commit
2abf3c8600
2 changed files with 52 additions and 52 deletions
|
|
@ -42,33 +42,33 @@ fn main() {
|
||||||
xous::syscall::claim_interrupt(4, handle_irq, 0 as *mut usize)
|
xous::syscall::claim_interrupt(4, handle_irq, 0 as *mut usize)
|
||||||
.expect("couldn't claim interrupt");
|
.expect("couldn't claim interrupt");
|
||||||
|
|
||||||
println!("Allocating a ton of space on the stack...");
|
// println!("Allocating a ton of space on the stack...");
|
||||||
{
|
// {
|
||||||
let _big_array = [42u8; 131072];
|
// let _big_array = [42u8; 131072];
|
||||||
}
|
// }
|
||||||
|
|
||||||
println!("Increasing heap to 131072...");
|
// println!("Increasing heap to 131072...");
|
||||||
let heap = xous::rsyscall(xous::SysCall::IncreaseHeap(
|
// let heap = xous::rsyscall(xous::SysCall::IncreaseHeap(
|
||||||
131072,
|
// 131072,
|
||||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
// xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
))
|
// ))
|
||||||
.expect("couldn't increase heap");
|
// .expect("couldn't increase heap");
|
||||||
if let xous::Result::MemoryRange(range) = heap {
|
// if let xous::Result::MemoryRange(range) = heap {
|
||||||
println!(
|
// println!(
|
||||||
"Heap goes from {:08x} - {:08x}",
|
// "Heap goes from {:08x} - {:08x}",
|
||||||
range.base as usize,
|
// range.base as usize,
|
||||||
range.base as usize + range.size
|
// range.base as usize + range.size
|
||||||
);
|
// );
|
||||||
use core::slice;
|
// use core::slice;
|
||||||
let mem_range = unsafe { slice::from_raw_parts_mut(range.base, range.size) };
|
// let mem_range = unsafe { slice::from_raw_parts_mut(range.base, range.size) };
|
||||||
println!("Filling with bytes...");
|
// println!("Filling with bytes...");
|
||||||
for word in mem_range.iter_mut() {
|
// for word in mem_range.iter_mut() {
|
||||||
*word = 42;
|
// *word = 42;
|
||||||
}
|
// }
|
||||||
println!("Done!");
|
// println!("Done!");
|
||||||
} else {
|
// } else {
|
||||||
println!("Unexpected return value: {:?}", heap);
|
// println!("Unexpected return value: {:?}", heap);
|
||||||
}
|
// }
|
||||||
|
|
||||||
let server_addr = xous::syscall::create_server(xous::make_name!("📜")).expect("couldn't create server");
|
let server_addr = xous::syscall::create_server(xous::make_name!("📜")).expect("couldn't create server");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,33 +56,33 @@ fn main() {
|
||||||
))
|
))
|
||||||
.expect("couldn't claim interrupt");
|
.expect("couldn't claim interrupt");
|
||||||
|
|
||||||
println!("Allocating a ton of space on the stack...");
|
// println!("Allocating a ton of space on the stack...");
|
||||||
{
|
// {
|
||||||
let _big_array = [42u8; 131072];
|
// let _big_array = [42u8; 131072];
|
||||||
}
|
// }
|
||||||
|
|
||||||
println!("Increasing heap to 131072...");
|
// println!("Increasing heap to 131072...");
|
||||||
let heap = xous::rsyscall(xous::SysCall::IncreaseHeap(
|
// let heap = xous::rsyscall(xous::SysCall::IncreaseHeap(
|
||||||
131072,
|
// 131072,
|
||||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
// xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
))
|
// ))
|
||||||
.expect("couldn't increase heap");
|
// .expect("couldn't increase heap");
|
||||||
if let xous::Result::MemoryRange(range) = heap {
|
// if let xous::Result::MemoryRange(range) = heap {
|
||||||
println!(
|
// println!(
|
||||||
"Heap goes from {:08x} - {:08x}",
|
// "Heap goes from {:08x} - {:08x}",
|
||||||
range.base as usize,
|
// range.base as usize,
|
||||||
range.base as usize + range.size
|
// range.base as usize + range.size
|
||||||
);
|
// );
|
||||||
use core::slice;
|
// use core::slice;
|
||||||
let mem_range = unsafe { slice::from_raw_parts_mut(range.base, range.size) };
|
// let mem_range = unsafe { slice::from_raw_parts_mut(range.base, range.size) };
|
||||||
println!("Filling with bytes...");
|
// println!("Filling with bytes...");
|
||||||
for word in mem_range.iter_mut() {
|
// for word in mem_range.iter_mut() {
|
||||||
*word = 42;
|
// *word = 42;
|
||||||
}
|
// }
|
||||||
println!("Done!");
|
// println!("Done!");
|
||||||
} else {
|
// } else {
|
||||||
println!("Unexpected return value: {:?}", heap);
|
// println!("Unexpected return value: {:?}", heap);
|
||||||
}
|
// }
|
||||||
|
|
||||||
timer::init();
|
timer::init();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue