Changes between Version 4 and Version 5 of kernel_vmem


Ignore:
Timestamp:
Jan 2, 2016, 12:34:28 PM (8 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_vmem

    v4 v5  
    1 = Virtual to Physical Address Translation =
     1= Paged Virtual memory =
    22
    3 The [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 and functions used by the boot-loader and the kernel to implement the paged virtual memory.
     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 and services functions that can be used by both the boot-loader and the kernel to implement the paged virtual memory.
    44
    55[[PageOutline]]
     
    1818 * SPP : Small Physical pages / 4 Kbytes
    1919
    20 === unsigned long long '''_v2p_translate'''( unsigned int  vaddr  ,  unsigned int* flags ) ===
    21 This function returns the physical address from the virtual address. The MMU is supposed to be activated, and it uses the page table defined by the CP0_PTPR register. It supports both small (4 Kbytes) & big (2 Mbytes) pages.
    22  * '''vaddr''': virtual address.
    23  * '''flags''': page flags are returned in this variable.
     20
     21=== 1) void '''_v2p_add_pte1'''( unsigned int vspace_id , unsigned int x , unsigned int y , unsigned int vpn , unsigned int flags , unsigned int ppn , unsigned int ident ) ===
     22This function registers a new PTE1 entry (BPP) in the page table defined by the <vspace_id> argument, and the <x,y> coordinates. The value is defined by the <flags> and <ppn> arguments. It takes the lock protecting the target page table, and updates only the first level PT1.
     23Exit if page table does not exist, or if the PTE1 already mapped.
     24
     25=== 2) void '''_v2p_add_pte2'''( unsigned int vspace_id , unsigned int x , unsigned int y , unsigned int vpn ) ===
     26This function registers a new PTE2 entry (SPP) in the page table defined by the <vspace_id> argument, and the <x,y> coordinates. The value is defined by the <flags> and <ppn> arguments. It takes the lock protecting the target page table, and updates both the first level PT1 and the second level PT2.
     27Exit if page table does not exist, or if the PTE1 already mapped, or if not enough PT2s.
     28
     29=== 3) void '''_v2p_del_pte1'''( unsigned int vspace_id , unsigned int x , unsigned int y , unsigned int vpn ) ===
     30This function invalidates a PTE1 entry (BPP), or a PTN identified by the <vpn> argument, from the PT1 page table defined by the <vspace_id> argument, and the <x,y> coordinates. Exit if page table does not exist, or if PTE1 unmapped.
     31
     32=== 4) void '''_v2p_del_pte2'''( unsigned int vspace_id , unsigned int x , unsigned int y , unsigned int vpn ) ===
     33This function invalidates a PTE2 entry (SPP) identified by the <vpn>, from the PT2 page table defined by the <vspace_id> argument, and the <x,y> coordinates.
     34Exit if page table does not exist, or if PTE2 unmapped.
     35
     36=== 5) unsigned long long '''_v2p_translate'''( unsigned int  vaddr  ,  unsigned int* flags ) ===
     37This function returns the physical address from the virtual address <vaddr>. The MMU is supposed to be activated, and it uses the page table defined by the CP0_PTPR register. It supports both small (4 Kbytes) & big (2 Mbytes) pages. The PTE1 or PTE2 flags are returned in the <flags> buffer.
    2438Exit if PTE1 or PTE2 unmapped.
    25 
    26 === void '''_v2p_add_pte1'''( unsigned int vspace_id , unsigned int x , unsigned int y , unsigned int vpn , unsigned int flags , unsigned int ppn , unsigned int ident ) ===
    27 This function registers a new PTE1 (BPP)vin the page table defined by the <vspace_id> argument, and the <x,y> coordinates. The value is defined by the <flags> and <ppn> arguments.
    28 It updates only the first level PT1. As each vseg is mapped by a different processor, the PT1 entry cannot be concurrently accessed, and we don't need to take any lock.
    29 
    30 === void '''_v2p_add_pte2'''( unsigned int vspace_id , unsigned int x , unsigned int y , unsigned int vpn ) ===
    31 
    32 === void '''_v2p_del_pte1'''( unsigned int vspace_id , unsigned int x , unsigned int y , unsigned int vpn ) ===
    33 
    34 === void '''_v2p_del_pte2'''( unsigned int vspace_id , unsigned int x , unsigned int y , unsigned int vpn ) ===
    35