forked from M-Labs/zynq-rs
Compare commits
3 Commits
6c9ff22a0a
...
7707399f51
Author | SHA1 | Date |
---|---|---|
Simon Renblad | 7707399f51 | |
Simon Renblad | 239bd2e65f | |
Simon Renblad | e4914f5872 |
|
@ -1,7 +1,7 @@
|
|||
[target.armv7-none-eabihf]
|
||||
rustflags = [
|
||||
"-C", "link-arg=-Tlink.x",
|
||||
"-C", "target-feature=a9,armv7-a,neon",
|
||||
"-C", "target-feature=+a9,+armv7-a,+neon",
|
||||
"-C", "target-cpu=cortex-a9",
|
||||
]
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ members = [
|
|||
"experiments",
|
||||
"szl",
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
[profile.release]
|
||||
panic = "abort"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use core::{
|
||||
ops::{Deref, DerefMut},
|
||||
mem::{align_of, size_of},
|
||||
mem::{align_of, size_of}, ops::{Deref, DerefMut}, panic
|
||||
};
|
||||
use alloc::alloc::{dealloc, Layout, LayoutError};
|
||||
use crate::mmu::{L1_PAGE_SIZE, L1Table};
|
||||
|
@ -20,7 +19,6 @@ impl<T> UncachedSlice<T> {
|
|||
let layout = Layout::from_size_align(size, align)?;
|
||||
let ptr = unsafe { alloc::alloc::alloc(layout).cast::<T>() };
|
||||
let start = ptr as usize;
|
||||
assert_eq!(start & (L1_PAGE_SIZE - 1), 0);
|
||||
|
||||
for page_start in (start..(start + size)).step_by(L1_PAGE_SIZE) {
|
||||
// non-shareable device
|
||||
|
@ -31,10 +29,7 @@ impl<T> UncachedSlice<T> {
|
|||
l1_section.bufferable = false;
|
||||
});
|
||||
}
|
||||
|
||||
let slice = unsafe { core::slice::from_raw_parts_mut(ptr, len) };
|
||||
// verify size
|
||||
assert!(unsafe { slice.get_unchecked(len) } as *const _ as usize <= start + size);
|
||||
// initialize
|
||||
for e in slice.iter_mut() {
|
||||
*e = default();
|
||||
|
|
Loading…
Reference in New Issue