-
-
Notifications
You must be signed in to change notification settings - Fork 816
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2daf3ea
commit 08439f3
Showing
50 changed files
with
152 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2425,7 +2425,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/main.rs 14_virtual_mem_ | |
diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/memory/mmu/mapping_record.rs 14_virtual_mem_part2_mmio_remap/kernel/src/memory/mmu/mapping_record.rs | ||
--- 13_exceptions_part2_peripheral_IRQs/kernel/src/memory/mmu/mapping_record.rs | ||
+++ 14_virtual_mem_part2_mmio_remap/kernel/src/memory/mmu/mapping_record.rs | ||
@@ -0,0 +1,239 @@ | ||
@@ -0,0 +1,238 @@ | ||
+// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
+// | ||
+// Copyright (c) 2020-2022 Andre Richter <[email protected]> | ||
|
@@ -2531,8 +2531,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/memory/mmu/mapping_reco | |
+ ) -> Option<&mut MappingRecordEntry> { | ||
+ self.inner | ||
+ .iter_mut() | ||
+ .filter(|x| x.is_some()) | ||
+ .map(|x| x.as_mut().unwrap()) | ||
+ .filter_map(|x| x.as_mut()) | ||
+ .filter(|x| x.attribute_fields.mem_attributes == MemAttributes::Device) | ||
+ .find(|x| { | ||
+ if x.phys_start_addr != phys_region.start_addr() { | ||
|
@@ -2859,37 +2858,37 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/kernel/src/memory/mmu/types.rs 14_ | |
+//-------------------------------------------------------------------------------------------------- | ||
+ | ||
+/// A wrapper type around [Address] that ensures page alignment. | ||
+#[derive(Copy, Clone, Debug, PartialOrd, PartialEq)] | ||
+#[derive(Copy, Clone, Debug, Eq, PartialOrd, PartialEq)] | ||
+pub struct PageAddress<ATYPE: AddressType> { | ||
+ inner: Address<ATYPE>, | ||
+} | ||
+ | ||
+/// A type that describes a region of memory in quantities of pages. | ||
+#[derive(Copy, Clone, Debug, PartialOrd, PartialEq)] | ||
+#[derive(Copy, Clone, Debug, Eq, PartialOrd, PartialEq)] | ||
+pub struct MemoryRegion<ATYPE: AddressType> { | ||
+ start: PageAddress<ATYPE>, | ||
+ end_exclusive: PageAddress<ATYPE>, | ||
+} | ||
+ | ||
+/// Architecture agnostic memory attributes. | ||
+#[allow(missing_docs)] | ||
+#[derive(Copy, Clone, Debug, PartialOrd, PartialEq)] | ||
+#[derive(Copy, Clone, Debug, Eq, PartialOrd, PartialEq)] | ||
+pub enum MemAttributes { | ||
+ CacheableDRAM, | ||
+ Device, | ||
+} | ||
+ | ||
+/// Architecture agnostic access permissions. | ||
+#[allow(missing_docs)] | ||
+#[derive(Copy, Clone, Debug, PartialOrd, PartialEq)] | ||
+#[derive(Copy, Clone, Debug, Eq, PartialOrd, PartialEq)] | ||
+pub enum AccessPermissions { | ||
+ ReadOnly, | ||
+ ReadWrite, | ||
+} | ||
+ | ||
+/// Collection of memory attributes. | ||
+#[allow(missing_docs)] | ||
+#[derive(Copy, Clone, Debug, PartialOrd, PartialEq)] | ||
+#[derive(Copy, Clone, Debug, Eq, PartialOrd, PartialEq)] | ||
+pub struct AttributeFields { | ||
+ pub mem_attributes: MemAttributes, | ||
+ pub acc_perms: AccessPermissions, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.