Skip to content

Commit b8227b7

Browse files
committed
Typos
1 parent 02c01c8 commit b8227b7

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

14_virtual_mem_part2_mmio_remap/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ separation, this tutorial makes a start by changing the following things:
5757

5858
1. Instead of bulk-`identity mapping` the whole of the board's address space, only the particular
5959
parts that are needed will be mapped.
60-
1. For now, the `kernel binary` stays identity mapped. This will be changed in the in the coming
61-
tutorials as it is a quite difficult and peculiar exercise to remap the kernel.
60+
1. For now, the `kernel binary` stays identity mapped. This will be changed in the coming tutorials
61+
as it is a quite difficult and peculiar exercise to remap the kernel.
6262
1. Device `MMIO regions` are lazily remapped during a device driver's `init()`.
6363
1. A dedicated region of virtual addresses that we reserve using `BSP` code and the `linker
6464
script` is used for this.
@@ -162,8 +162,8 @@ use:
162162
/// Prevents mapping into the MMIO range of the tables.
163163
pub unsafe fn kernel_map_at(
164164
name: &'static str,
165-
virt_pages: &MemoryRegion<Virtual>,
166-
phys_pages: &MemoryRegion<Physical>,
165+
virt_region: &MemoryRegion<Virtual>,
166+
phys_region: &MemoryRegion<Physical>,
167167
attr: &AttributeFields,
168168
) -> Result<(), &'static str>;
169169

@@ -3207,11 +3207,11 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs 14_virtual_mem_p
32073207
+/// - Does not prevent aliasing. Currently, the callers must be trusted.
32083208
+pub unsafe fn kernel_map_at(
32093209
+ name: &'static str,
3210-
+ virt_pages: &MemoryRegion<Virtual>,
3211-
+ phys_pages: &MemoryRegion<Physical>,
3210+
+ virt_region: &MemoryRegion<Virtual>,
3211+
+ phys_region: &MemoryRegion<Physical>,
32123212
+ attr: &AttributeFields,
32133213
+) -> Result<(), &'static str> {
3214-
+ if bsp::memory::mmu::virt_mmio_remap_region().overlaps(virt_pages) {
3214+
+ if bsp::memory::mmu::virt_mmio_remap_region().overlaps(virt_region) {
32153215
+ return Err("Attempt to manually map into MMIO region");
32163216
}
32173217
-}
@@ -3238,7 +3238,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs 14_virtual_mem_p
32383238
- } else {
32393239
- (size, "Byte")
32403240
- };
3241-
+ kernel_map_at_unchecked(name, virt_pages, phys_pages, attr)?;
3241+
+ kernel_map_at_unchecked(name, virt_region, phys_region, attr)?;
32423242

32433243
- let attr = match self.attribute_fields.mem_attributes {
32443244
- MemAttributes::CacheableDRAM => "C",

14_virtual_mem_part2_mmio_remap/src/memory/mmu.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ impl<const AS_SIZE: usize> AddressSpace<AS_SIZE> {
165165
/// - Does not prevent aliasing. Currently, the callers must be trusted.
166166
pub unsafe fn kernel_map_at(
167167
name: &'static str,
168-
virt_pages: &MemoryRegion<Virtual>,
169-
phys_pages: &MemoryRegion<Physical>,
168+
virt_region: &MemoryRegion<Virtual>,
169+
phys_region: &MemoryRegion<Physical>,
170170
attr: &AttributeFields,
171171
) -> Result<(), &'static str> {
172-
if bsp::memory::mmu::virt_mmio_remap_region().overlaps(virt_pages) {
172+
if bsp::memory::mmu::virt_mmio_remap_region().overlaps(virt_region) {
173173
return Err("Attempt to manually map into MMIO region");
174174
}
175175

176-
kernel_map_at_unchecked(name, virt_pages, phys_pages, attr)?;
176+
kernel_map_at_unchecked(name, virt_region, phys_region, attr)?;
177177

178178
Ok(())
179179
}

15_virtual_mem_part3_precomputed_tables/README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -1578,20 +1578,18 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/src/memory/mmu.rs 15_virtual_mem_part3
15781578
+/// Add an entry to the mapping info record.
15791579
+pub fn kernel_add_mapping_record(
15801580
name: &'static str,
1581-
- virt_pages: &MemoryRegion<Virtual>,
1582-
- phys_pages: &MemoryRegion<Physical>,
1583-
+ virt_region: &MemoryRegion<Virtual>,
1584-
+ phys_region: &MemoryRegion<Physical>,
1581+
virt_region: &MemoryRegion<Virtual>,
1582+
phys_region: &MemoryRegion<Physical>,
15851583
attr: &AttributeFields,
15861584
-) -> Result<(), &'static str> {
1587-
- if bsp::memory::mmu::virt_mmio_remap_region().overlaps(virt_pages) {
1585+
- if bsp::memory::mmu::virt_mmio_remap_region().overlaps(virt_region) {
15881586
- return Err("Attempt to manually map into MMIO region");
15891587
+) {
15901588
+ if let Err(x) = mapping_record::kernel_add(name, virt_region, phys_region, attr) {
15911589
+ warn!("{}", x);
15921590
}
15931591
-
1594-
- kernel_map_at_unchecked(name, virt_pages, phys_pages, attr)?;
1592+
- kernel_map_at_unchecked(name, virt_region, phys_region, attr)?;
15951593
-
15961594
- Ok(())
15971595
}

0 commit comments

Comments
 (0)