Changeset ef67bab in mainline for genarch/src
- Timestamp:
- 2006-02-01T00:02:16Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 071a8ae6
- Parents:
- fc1e4f6
- Location:
- genarch/src
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
genarch/src/acpi/acpi.c
rfc1e4f6 ref67bab 80 80 static void map_sdt(struct acpi_sdt_header *sdt) 81 81 { 82 page_mapping_insert(AS_KERNEL, (__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE , 0);82 page_mapping_insert(AS_KERNEL, (__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE); 83 83 map_structure((__address) sdt, sdt->length); 84 84 } -
genarch/src/mm/page_ht.c
rfc1e4f6 ref67bab 39 39 #include <arch.h> 40 40 #include <debug.h> 41 #include <memstr.h> 41 42 42 43 /** 43 * This lock protects the page hash table. Note that software must 44 * be still careful about ordering of writes to ensure consistent 45 * view of the page hash table for hardware helpers such as VHPT 46 * walker on ia64. 44 * This lock protects the page hash table. 47 45 */ 48 46 SPINLOCK_INITIALIZE(page_ht_lock); … … 54 52 pte_t *page_ht = NULL; 55 53 56 static void ht_mapping_insert(as_t *as, __address page, __address frame, int flags , __address root);57 static pte_t *ht_mapping_find(as_t *as, __address page , __address root);54 static void ht_mapping_insert(as_t *as, __address page, __address frame, int flags); 55 static pte_t *ht_mapping_find(as_t *as, __address page); 58 56 59 57 page_operations_t page_ht_operations = { 60 58 .mapping_insert = ht_mapping_insert, 61 .mapping_find = ht_mapping_find 59 .mapping_find = ht_mapping_find, 62 60 }; 63 61 … … 65 63 * 66 64 * Map virtual address 'page' to physical address 'frame' 67 * using 'flags'. In order not to disturb hardware searching, 68 * new mappings are appended to the end of the collision 69 * chain. 65 * using 'flags'. 70 66 * 71 * @param as Address space to which page belongs. Must be locked prior the call. 67 * The address space must be locked and interruptsmust be disabled. 68 * 69 * @param as Address space to which page belongs. 72 70 * @param page Virtual address of the page to be mapped. 73 71 * @param frame Physical address of memory frame to which the mapping is done. 74 72 * @param flags Flags to be used for mapping. 75 * @param root Ignored.76 73 */ 77 void ht_mapping_insert(as_t *as, __address page, __address frame, int flags , __address root)74 void ht_mapping_insert(as_t *as, __address page, __address frame, int flags) 78 75 { 79 76 pte_t *t, *u; … … 122 119 * Find mapping for virtual page. 123 120 * 124 * Interrupts must be disabled.121 * The address space must be locked and interrupts must be disabled. 125 122 * 126 * @param as Address space to wich page belongs. Must be locked prior the call.123 * @param as Address space to wich page belongs. 127 124 * @param page Virtual page. 128 * @param root Ignored.129 125 * 130 126 * @return NULL if there is no such mapping; requested mapping otherwise. 131 127 */ 132 pte_t *ht_mapping_find(as_t *as, __address page , __address root)128 pte_t *ht_mapping_find(as_t *as, __address page) 133 129 { 134 130 pte_t *t; -
genarch/src/mm/page_pt.c
rfc1e4f6 ref67bab 30 30 #include <mm/page.h> 31 31 #include <mm/frame.h> 32 #include <mm/as.h> 32 33 #include <arch/mm/page.h> 33 34 #include <arch/mm/as.h> … … 37 38 #include <memstr.h> 38 39 39 static void pt_mapping_insert(as_t *as, __address page, __address frame, int flags , __address root);40 static pte_t *pt_mapping_find(as_t *as, __address page , __address root);40 static void pt_mapping_insert(as_t *as, __address page, __address frame, int flags); 41 static pte_t *pt_mapping_find(as_t *as, __address page); 41 42 42 43 page_operations_t page_pt_operations = { … … 50 51 * using 'flags'. 51 52 * 52 * @param as Ignored. 53 * The address space must be locked and interrupts must be disabled. 54 * 55 * @param as Address space to wich page belongs. 53 56 * @param page Virtual address of the page to be mapped. 54 57 * @param frame Physical address of memory frame to which the mapping is done. 55 58 * @param flags Flags to be used for mapping. 56 * @param root Explicit PTL0 address.57 59 */ 58 void pt_mapping_insert(as_t *as, __address page, __address frame, int flags , __address root)60 void pt_mapping_insert(as_t *as, __address page, __address frame, int flags) 59 61 { 60 62 pte_t *ptl0, *ptl1, *ptl2, *ptl3; 61 63 __address newpt; 62 64 63 ptl0 = (pte_t *) PA2KA( root ? root : (__address) GET_PTL0_ADDRESS());65 ptl0 = (pte_t *) PA2KA((__address) as->page_table); 64 66 65 67 if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) { … … 98 100 * Find mapping for virtual page. 99 101 * 100 * @param as Ignored. 102 * The address space must be locked and interrupts must be disabled. 103 * 104 * @param as Address space to which page belongs. 101 105 * @param page Virtual page. 102 * @param root PTL0 address if non-zero.103 106 * 104 107 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise. 105 108 */ 106 pte_t *pt_mapping_find(as_t *as, __address page , __address root)109 pte_t *pt_mapping_find(as_t *as, __address page) 107 110 { 108 111 pte_t *ptl0, *ptl1, *ptl2, *ptl3; 109 112 110 ptl0 = (pte_t *) PA2KA( root ? root : (__address) GET_PTL0_ADDRESS());113 ptl0 = (pte_t *) PA2KA((__address) as->page_table); 111 114 112 115 if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
Note:
See TracChangeset
for help on using the changeset viewer.