Changes between Initial Version and Version 1 of kernel_vmem


Ignore:
Timestamp:
Oct 5, 2014, 3:28:28 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_vmem

    v1 v1  
     1= Virtual to Physical Address Translation =
     2
     3The [source:soft/giet_vm/giet_common/vmem.c vmem.c] and [source:soft/giet_vm/giet_common/vmem.h vmem.h] files define the data structures used by the boot-loader and the kernel to implement the paged virtual memory.
     4
     5[PageOutline]
     6
     7The page table initialisation is statically done by the boot-loader. There is one page table for each vspace defined in the mapping. When the architecture is clusterised (X_WIDTH > 1 or Y_WIDTH > 1), for each vspace, the page table is replicated in each cluster.
     8
     9The virtual address format is 32 bits: structured in 3 fields:
     10||  11  ||  9   ||   12   ||
     11|| IX1  || IX2  || OFFSET ||
     12 * The IX1 field is the index in the first level page table
     13 * The IX2 field is the index in the second level page table.
     14 * The |IX1|IX2| concatenation defines the VPN (Virtual Page Number).
     15
     16Two page sizes are supported:
     17 * BPP : Big Physical Page / 2 Mbytes
     18 * SPP : Small Physical pages / 4 Kbytes
     19
     20=== unsigned int _v2p_translate( page_table_t* pt, unsigned int  vpn, unsigned int* ppn, unsigned int* flags ) ===
     21
     22This function makes a VPN to PPN translation, from the page table defined by the ''pt'' pointer . The MMU is supposed to be activated. It supports both small (4 Kbytes) & big (2 Mbytes) pages.
     23It uses the address extension mechanism for physical addressing.
     24Return 0 if success. Return 1 if PTE1 or PTE2 unmapped.
     25
     26