mirror of
https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials.git
synced 2024-11-11 07:10:59 +00:00
Don't use super
This commit is contained in:
parent
14022d69c3
commit
c21c46b362
@ -177,10 +177,10 @@ pub unsafe fn init() {
|
|||||||
|
|
||||||
// Finally, fill the single LVL3 table (4 KiB granule). Differentiate
|
// Finally, fill the single LVL3 table (4 KiB granule). Differentiate
|
||||||
// between code+RO and RW pages.
|
// between code+RO and RW pages.
|
||||||
let (ro_start_addr, ro_end_addr) = super::get_ro_start_end();
|
let (ro_start_addr, ro_end_addr) = crate::memory::get_ro_start_end();
|
||||||
|
|
||||||
let ro_first_page_index = ro_start_addr / super::PAGESIZE;
|
let ro_first_page_index = ro_start_addr / crate::memory::PAGESIZE;
|
||||||
let ro_last_page_index = ro_end_addr / super::PAGESIZE;
|
let ro_last_page_index = ro_end_addr / crate::memory::PAGESIZE;
|
||||||
|
|
||||||
let common = STAGE1_DESCRIPTOR::VALID::True
|
let common = STAGE1_DESCRIPTOR::VALID::True
|
||||||
+ STAGE1_DESCRIPTOR::TYPE::Table
|
+ STAGE1_DESCRIPTOR::TYPE::Table
|
||||||
|
@ -36,7 +36,7 @@ pub struct BumpAllocator {
|
|||||||
|
|
||||||
unsafe impl Alloc for BumpAllocator {
|
unsafe impl Alloc for BumpAllocator {
|
||||||
unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
|
unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
|
||||||
let start = super::aligned_addr_unchecked(self.next, layout.align());
|
let start = crate::memory::aligned_addr_unchecked(self.next, layout.align());
|
||||||
let end = start + layout.size();
|
let end = start + layout.size();
|
||||||
|
|
||||||
if end <= self.pool_end {
|
if end <= self.pool_end {
|
||||||
|
@ -186,10 +186,10 @@ pub unsafe fn init() {
|
|||||||
|
|
||||||
// Finally, fill the single LVL3 table (4 KiB granule). Differentiate
|
// Finally, fill the single LVL3 table (4 KiB granule). Differentiate
|
||||||
// between code+RO and RW pages.
|
// between code+RO and RW pages.
|
||||||
let (ro_start_addr, ro_end_addr) = super::get_ro_start_end();
|
let (ro_start_addr, ro_end_addr) = crate::memory::get_ro_start_end();
|
||||||
|
|
||||||
let ro_first_page_index = ro_start_addr / super::PAGESIZE;
|
let ro_first_page_index = ro_start_addr / crate::memory::PAGESIZE;
|
||||||
let ro_last_page_index = ro_end_addr / super::PAGESIZE;
|
let ro_last_page_index = ro_end_addr / crate::memory::PAGESIZE;
|
||||||
|
|
||||||
let common = STAGE1_DESCRIPTOR::VALID::True
|
let common = STAGE1_DESCRIPTOR::VALID::True
|
||||||
+ STAGE1_DESCRIPTOR::TYPE::Table
|
+ STAGE1_DESCRIPTOR::TYPE::Table
|
||||||
|
@ -36,7 +36,7 @@ pub struct BumpAllocator {
|
|||||||
|
|
||||||
unsafe impl Alloc for BumpAllocator {
|
unsafe impl Alloc for BumpAllocator {
|
||||||
unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
|
unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
|
||||||
let start = super::aligned_addr_unchecked(self.next, layout.align());
|
let start = crate::memory::aligned_addr_unchecked(self.next, layout.align());
|
||||||
let end = start + layout.size();
|
let end = start + layout.size();
|
||||||
|
|
||||||
if end <= self.pool_end {
|
if end <= self.pool_end {
|
||||||
|
@ -186,10 +186,10 @@ pub unsafe fn init() {
|
|||||||
|
|
||||||
// Finally, fill the single LVL3 table (4 KiB granule). Differentiate
|
// Finally, fill the single LVL3 table (4 KiB granule). Differentiate
|
||||||
// between code+RO and RW pages.
|
// between code+RO and RW pages.
|
||||||
let (ro_start_addr, ro_end_addr) = super::get_ro_start_end();
|
let (ro_start_addr, ro_end_addr) = crate::memory::get_ro_start_end();
|
||||||
|
|
||||||
let ro_first_page_index = ro_start_addr / super::PAGESIZE;
|
let ro_first_page_index = ro_start_addr / crate::memory::PAGESIZE;
|
||||||
let ro_last_page_index = ro_end_addr / super::PAGESIZE;
|
let ro_last_page_index = ro_end_addr / crate::memory::PAGESIZE;
|
||||||
|
|
||||||
let common = STAGE1_DESCRIPTOR::VALID::True
|
let common = STAGE1_DESCRIPTOR::VALID::True
|
||||||
+ STAGE1_DESCRIPTOR::TYPE::Table
|
+ STAGE1_DESCRIPTOR::TYPE::Table
|
||||||
|
Loading…
Reference in New Issue
Block a user