Changeset 2299914 in mainline for genarch/src/mm/page_ht.c
- Timestamp:
- 2006-03-16T12:57:31Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e898a8d7
- Parents:
- b7dcabb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
genarch/src/mm/page_ht.c
rb7dcabb r2299914 53 53 54 54 /** 55 * This lock protects the page hash table. 55 * This lock protects the page hash table. It must be acquired 56 * after address space lock and after any address space area 57 * locks. 56 58 */ 57 59 SPINLOCK_INITIALIZE(page_ht_lock); … … 156 158 * using 'flags'. 157 159 * 158 * The address space must be locked and interruptsmust be disabled.160 * The page table must be locked and interrupts must be disabled. 159 161 * 160 162 * @param as Address space to which page belongs. … … 168 170 __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 169 171 170 spinlock_lock(&page_ht_lock);171 172 172 if (!hash_table_find(&page_ht, key)) { 173 173 t = (pte_t *) malloc(sizeof(pte_t), FRAME_ATOMIC); … … 187 187 hash_table_insert(&page_ht, key, &t->link); 188 188 } 189 190 spinlock_unlock(&page_ht_lock);191 189 } 192 190 … … 197 195 * this call visible. 198 196 * 199 * The address space must be locked and interrupts must be disabled.197 * The page table must be locked and interrupts must be disabled. 200 198 * 201 199 * @param as Address space to wich page belongs. … … 206 204 __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 207 205 208 spinlock_lock(&page_ht_lock);209 210 206 /* 211 207 * Note that removed PTE's will be freed … … 213 209 */ 214 210 hash_table_remove(&page_ht, key, 2); 215 216 spinlock_unlock(&page_ht_lock);217 211 } 218 212 … … 222 216 * Find mapping for virtual page. 223 217 * 224 * The address space must be locked and interrupts must be disabled.218 * The page table must be locked and interrupts must be disabled. 225 219 * 226 220 * @param as Address space to wich page belongs. … … 235 229 __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) }; 236 230 237 spinlock_lock(&page_ht_lock);238 239 231 hlp = hash_table_find(&page_ht, key); 240 232 if (hlp) 241 233 t = hash_table_get_instance(hlp, pte_t, link); 242 234 243 spinlock_unlock(&page_ht_lock);244 235 return t; 245 236 }
Note:
See TracChangeset
for help on using the changeset viewer.