Changeset fc1e4f6 in mainline for genarch/src
- Timestamp:
- 2006-01-31T00:44:08Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ef67bab
- Parents:
- 6a3c9a7
- Location:
- genarch/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
genarch/src/acpi/acpi.c
r6a3c9a7 rfc1e4f6 30 30 #include <genarch/acpi/madt.h> 31 31 #include <arch/bios/bios.h> 32 #include <mm/as id.h>32 #include <mm/as.h> 33 33 #include <mm/page.h> 34 34 #include <print.h> … … 80 80 static void map_sdt(struct acpi_sdt_header *sdt) 81 81 { 82 page_mapping_insert( (__address) sdt, ASID_KERNEL, (__address) sdt, PAGE_NOT_CACHEABLE, 0);82 page_mapping_insert(AS_KERNEL, (__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0); 83 83 map_structure((__address) sdt, sdt->length); 84 84 } -
genarch/src/mm/page_ht.c
r6a3c9a7 rfc1e4f6 31 31 #include <mm/frame.h> 32 32 #include <mm/heap.h> 33 #include <mm/as.h> 33 34 #include <arch/mm/asid.h> 34 35 #include <arch/types.h> … … 53 54 pte_t *page_ht = NULL; 54 55 55 static void ht_mapping_insert( __address page, asid_t asid, __address frame, int flags, __address root);56 static pte_t *ht_mapping_find( __address page, asid_t asid, __address root);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); 57 58 58 59 page_operations_t page_ht_operations = { … … 68 69 * chain. 69 70 * 71 * @param as Address space to which page belongs. Must be locked prior the call. 70 72 * @param page Virtual address of the page to be mapped. 71 * @param asid Address space to which page belongs.72 73 * @param frame Physical address of memory frame to which the mapping is done. 73 74 * @param flags Flags to be used for mapping. 74 75 * @param root Ignored. 75 76 */ 76 void ht_mapping_insert( __address page, asid_t asid, __address frame, int flags, __address root)77 void ht_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root) 77 78 { 78 79 pte_t *t, *u; … … 81 82 ipl = interrupts_disable(); 82 83 spinlock_lock(&page_ht_lock); 83 84 t = HT_HASH(page, as id);84 85 t = HT_HASH(page, as->asid); 85 86 if (!HT_SLOT_EMPTY(t)) { 86 87 … … 92 93 do { 93 94 u = t; 94 if (HT_COMPARE(page, as id, t)) {95 if (HT_COMPARE(page, as->asid, t)) { 95 96 /* 96 97 * Nothing to do, … … 110 111 } 111 112 112 HT_SET_RECORD(t, page, as id, frame, flags);113 HT_SET_RECORD(t, page, as->asid, frame, flags); 113 114 HT_SET_NEXT(t, NULL); 114 115 … … 123 124 * Interrupts must be disabled. 124 125 * 126 * @param as Address space to wich page belongs. Must be locked prior the call. 125 127 * @param page Virtual page. 126 * @param asid Address space to wich page belongs.127 128 * @param root Ignored. 128 129 * 129 130 * @return NULL if there is no such mapping; requested mapping otherwise. 130 131 */ 131 pte_t *ht_mapping_find( __address page, asid_t asid, __address root)132 pte_t *ht_mapping_find(as_t *as, __address page, __address root) 132 133 { 133 134 pte_t *t; 134 135 135 136 spinlock_lock(&page_ht_lock); 136 t = HT_HASH(page, as id);137 t = HT_HASH(page, as->asid); 137 138 if (!HT_SLOT_EMPTY(t)) { 138 while (!HT_COMPARE(page, as id, t) && HT_GET_NEXT(t))139 while (!HT_COMPARE(page, as->asid, t) && HT_GET_NEXT(t)) 139 140 t = HT_GET_NEXT(t); 140 t = HT_COMPARE(page, as id, t) ? t : NULL;141 t = HT_COMPARE(page, as->asid, t) ? t : NULL; 141 142 } else { 142 143 t = NULL; -
genarch/src/mm/page_pt.c
r6a3c9a7 rfc1e4f6 31 31 #include <mm/frame.h> 32 32 #include <arch/mm/page.h> 33 #include <arch/mm/as id.h>33 #include <arch/mm/as.h> 34 34 #include <arch/types.h> 35 35 #include <typedefs.h> … … 37 37 #include <memstr.h> 38 38 39 static void pt_mapping_insert( __address page, asid_t asid, __address frame, int flags, __address root);40 static pte_t *pt_mapping_find( __address page, asid_t asid, __address root);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); 41 41 42 42 page_operations_t page_pt_operations = { … … 50 50 * using 'flags'. 51 51 * 52 * @param as Ignored. 52 53 * @param page Virtual address of the page to be mapped. 53 * @param asid Ignored.54 54 * @param frame Physical address of memory frame to which the mapping is done. 55 55 * @param flags Flags to be used for mapping. 56 56 * @param root Explicit PTL0 address. 57 57 */ 58 void pt_mapping_insert( __address page, asid_t asid, __address frame, int flags, __address root)58 void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root) 59 59 { 60 60 pte_t *ptl0, *ptl1, *ptl2, *ptl3; … … 98 98 * Find mapping for virtual page. 99 99 * 100 * @param as Ignored. 100 101 * @param page Virtual page. 101 * @param asid Ignored.102 102 * @param root PTL0 address if non-zero. 103 103 * 104 104 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise. 105 105 */ 106 pte_t *pt_mapping_find( __address page, asid_t asid, __address root)106 pte_t *pt_mapping_find(as_t *as, __address page, __address root) 107 107 { 108 108 pte_t *ptl0, *ptl1, *ptl2, *ptl3;
Note:
See TracChangeset
for help on using the changeset viewer.