Changeset 408 for soft/giet_vm/giet_common/vmem.h
- Timestamp:
- Sep 29, 2014, 10:47:26 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_common/vmem.h
r258 r408 1 1 /////////////////////////////////////////////////////////////////////////////////// 2 // File : vm _handler.h2 // File : vmem.h 3 3 // Date : 01/07/2012 4 4 // Author : alain greiner 5 5 // Copyright (c) UPMC-LIP6 6 6 /////////////////////////////////////////////////////////////////////////////////// 7 // The vmem.c and vmem.h files are part ot the GIET-VM nano kernel. 8 // They define the data structures implementing the page tables, 9 // and the function used for VPN to PPN translation. 10 /////////////////////////////////////////////////////////////////////////////////// 11 // The virtual address format is 32 bits: structures in 3 fields: 12 // | 11 | 9 | 12 | 13 // | IX1 | IX2 | OFFSET | 14 // - The IX1 field is the index in the first level page table 15 // - The IX2 field is the index in the second level page table 16 // - The |IX1|IX2\ concatenation defines the VPN (Virtual Page Number) 17 /////////////////////////////////////////////////////////////////////////////////// 7 18 8 #ifndef _VM_HANDLER_H_ 9 #define _VM_HANDLER_H_ 10 11 #include <giet_config.h> 12 #include <mapping_info.h> 19 #ifndef _VMEM_H_ 20 #define _VMEM_H_ 13 21 14 22 ///////////////////////////////////////////////////////////////////////////////////// … … 18 26 #define PT1_SIZE 8192 19 27 #define PT2_SIZE 4096 28 29 #define VPN_MASK 0xFFFFF000 30 #define BPN_MASK 0xFFE00000 20 31 21 32 ///////////////////////////////////////////////////////////////////////////////////// … … 51 62 // Page table structure definition 52 63 ///////////////////////////////////////////////////////////////////////////////////// 64 53 65 typedef struct PageTable 54 66 { … … 57 69 } page_table_t; 58 70 59 60 ////////////////////////////////////////////////////////////////////////////////////61 // Global variable62 ////////////////////////////////////////////////////////////////////////////////////63 64 extern page_table_t _iommu_ptab;65 66 71 //////////////////////////////////////////////////////////////////////////////////// 67 72 // functions prototypes 68 73 //////////////////////////////////////////////////////////////////////////////////// 69 74 70 void _iommu_add_pte2( unsigned int ix1, 71 unsigned int ix2, 72 unsigned int ppn, 73 unsigned int flags ); 74 75 void _iommu_inval_pte2( unsigned int ix1, 76 unsigned int ix2 ); 77 75 /////////////////////////////////////////////////////////////////////////////////// 76 // This function makes a "vpn" to "ppn" translation, from the page table 77 // defined by the virtual address "pt". The MMU is supposed to be activated. 78 // It supports both small (4 Kbytes) & big (2 Mbytes) pages. 79 // It uses the address extension mechanism for physical addressing. 80 // Return 0 if success. Return 1 if PTE1 or PTE2 unmapped. 81 /////////////////////////////////////////////////////////////////////////////////// 78 82 unsigned int _v2p_translate( page_table_t* pt, 79 83 unsigned int vpn,
Note: See TracChangeset
for help on using the changeset viewer.