@@ -57,8 +57,8 @@ separation, this tutorial makes a start by changing the following things:
57
57
58
58
1 . Instead of bulk-` identity mapping ` the whole of the board's address space, only the particular
59
59
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.
62
62
1 . Device ` MMIO regions ` are lazily remapped during a device driver's ` init() ` .
63
63
1 . A dedicated region of virtual addresses that we reserve using ` BSP ` code and the `linker
64
64
script` is used for this.
162
162
/// Prevents mapping into the MMIO range of the tables.
163
163
pub unsafe fn kernel_map_at (
164
164
name : & 'static str ,
165
- virt_pages : & MemoryRegion <Virtual >,
166
- phys_pages : & MemoryRegion <Physical >,
165
+ virt_region : & MemoryRegion <Virtual >,
166
+ phys_region : & MemoryRegion <Physical >,
167
167
attr : & AttributeFields ,
168
168
) -> Result <(), & 'static str >;
169
169
@@ -3207,11 +3207,11 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs 14_virtual_mem_p
3207
3207
+ /// - Does not prevent aliasing. Currently, the callers must be trusted.
3208
3208
+ pub unsafe fn kernel_map_at(
3209
3209
+ name: &'static str,
3210
- + virt_pages : &MemoryRegion<Virtual>,
3211
- + phys_pages : &MemoryRegion<Physical>,
3210
+ + virt_region : &MemoryRegion<Virtual>,
3211
+ + phys_region : &MemoryRegion<Physical>,
3212
3212
+ attr: &AttributeFields,
3213
3213
+ ) -> 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 ) {
3215
3215
+ return Err("Attempt to manually map into MMIO region");
3216
3216
}
3217
3217
- }
@@ -3238,7 +3238,7 @@ diff -uNr 13_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs 14_virtual_mem_p
3238
3238
- } else {
3239
3239
- (size, "Byte")
3240
3240
- };
3241
- + kernel_map_at_unchecked(name, virt_pages, phys_pages , attr)?;
3241
+ + kernel_map_at_unchecked(name, virt_region, phys_region , attr)?;
3242
3242
3243
3243
- let attr = match self.attribute_fields.mem_attributes {
3244
3244
- MemAttributes::CacheableDRAM => "C",
0 commit comments