Changeset 7f1c620 in mainline for genarch/src/mm/page_ht.c
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
genarch/src/mm/page_ht.c
r991779c5 r7f1c620 53 53 #include <align.h> 54 54 55 static index_t hash( __nativekey[]);56 static bool compare( __nativekey[], count_t keys, link_t *item);55 static index_t hash(unative_t key[]); 56 static bool compare(unative_t key[], count_t keys, link_t *item); 57 57 static void remove_callback(link_t *item); 58 58 59 static void ht_mapping_insert(as_t *as, __address page, __addressframe, int flags);60 static void ht_mapping_remove(as_t *as, __addresspage);61 static pte_t *ht_mapping_find(as_t *as, __addresspage);59 static void ht_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags); 60 static void ht_mapping_remove(as_t *as, uintptr_t page); 61 static pte_t *ht_mapping_find(as_t *as, uintptr_t page); 62 62 63 63 /** … … 94 94 * @return Index into page hash table. 95 95 */ 96 index_t hash( __nativekey[])96 index_t hash(unative_t key[]) 97 97 { 98 98 as_t *as = (as_t *) key[KEY_AS]; 99 __address page = (__address) key[KEY_PAGE];99 uintptr_t page = (uintptr_t) key[KEY_PAGE]; 100 100 index_t index; 101 101 … … 112 112 * hash index. 113 113 */ 114 index |= (( __native) as) & (PAGE_HT_ENTRIES-1);114 index |= ((unative_t) as) & (PAGE_HT_ENTRIES-1); 115 115 116 116 return index; … … 125 125 * @return true on match, false otherwise. 126 126 */ 127 bool compare( __nativekey[], count_t keys, link_t *item)127 bool compare(unative_t key[], count_t keys, link_t *item) 128 128 { 129 129 pte_t *t; … … 138 138 139 139 if (keys == PAGE_HT_KEYS) { 140 return (key[KEY_AS] == ( __address) t->as) && (key[KEY_PAGE] == t->page);140 return (key[KEY_AS] == (uintptr_t) t->as) && (key[KEY_PAGE] == t->page); 141 141 } else { 142 return (key[KEY_AS] == ( __address) t->as);142 return (key[KEY_AS] == (uintptr_t) t->as); 143 143 } 144 144 } … … 174 174 * @param flags Flags to be used for mapping. 175 175 */ 176 void ht_mapping_insert(as_t *as, __address page, __addressframe, int flags)176 void ht_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags) 177 177 { 178 178 pte_t *t; 179 __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };179 unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 180 180 181 181 if (!hash_table_find(&page_ht, key)) { … … 209 209 * @param page Virtual address of the page to be demapped. 210 210 */ 211 void ht_mapping_remove(as_t *as, __addresspage)212 { 213 __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };211 void ht_mapping_remove(as_t *as, uintptr_t page) 212 { 213 unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 214 214 215 215 /* … … 232 232 * @return NULL if there is no such mapping; requested mapping otherwise. 233 233 */ 234 pte_t *ht_mapping_find(as_t *as, __addresspage)234 pte_t *ht_mapping_find(as_t *as, uintptr_t page) 235 235 { 236 236 link_t *hlp; 237 237 pte_t *t = NULL; 238 __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };238 unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 239 239 240 240 hlp = hash_table_find(&page_ht, key);
Note:
See TracChangeset
for help on using the changeset viewer.