From 29ea359f10f2213ad51235f86dc87704599aa7bc Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 17 Jul 2019 10:58:06 +0200 Subject: [PATCH] Improve documentation --- src/structures/paging/mapper/offset_page_table.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/structures/paging/mapper/offset_page_table.rs b/src/structures/paging/mapper/offset_page_table.rs index fb11e51a3..506bb1905 100644 --- a/src/structures/paging/mapper/offset_page_table.rs +++ b/src/structures/paging/mapper/offset_page_table.rs @@ -13,6 +13,12 @@ impl<'a> OffsetPageTable<'a> { /// Creates a new `OffsetPageTable` that uses the given offset for converting virtual /// to physical addresses. /// + /// The complete physical memory must be mapped in the virtual address space starting at + /// address `phys_offset`. This means that for example physical address `0x5000` can be + /// accessed through virtual address `phys_offset + 0x5000`. This mapping is required because + /// the mapper needs to access page tables, which are not mapped into the virtual address + /// space by default. + /// /// This function is unsafe because the caller must guarantee that the passed `phys_offset` /// is correct. Also, the passed `level_4_table` must point to the level 4 page table /// of a valid page table hierarchy. Otherwise this function might break memory safety, e.g.