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 ) === |
| 22 | This 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. |
| 23 | Exit 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 ) === |
| 26 | This 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. |
| 27 | Exit 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 ) === |
| 30 | This 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 ) === |
| 33 | This 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. |
| 34 | Exit if page table does not exist, or if PTE2 unmapped. |
| 35 | |
| 36 | === 5) unsigned long long '''_v2p_translate'''( unsigned int vaddr , unsigned int* flags ) === |
| 37 | This 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. |
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 | | |