Changes in kernel/genarch/src/mm/as_ht.c [fb63c06:f97f1e51] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/mm/as_ht.c
rfb63c06 rf97f1e51 77 77 if (flags & FLAG_AS_KERNEL) { 78 78 hash_table_create(&page_ht, PAGE_HT_ENTRIES, 2, &ht_operations); 79 mutex_initialize(&page_ht_lock, MUTEX_PASSIVE); 79 80 pte_cache = slab_cache_create("pte_t", sizeof(pte_t), 0, 80 81 NULL, NULL, SLAB_CACHE_MAGDEFERRED); … … 98 99 /** Lock page table. 99 100 * 100 * Lock address space .101 * Lock address space and page hash table. 101 102 * Interrupts must be disabled. 102 103 * … … 109 110 if (lock) 110 111 mutex_lock(&as->lock); 112 113 mutex_lock(&page_ht_lock); 111 114 } 112 115 113 116 /** Unlock page table. 114 117 * 115 * Unlock address space .118 * Unlock address space and page hash table. 116 119 * Interrupts must be disabled. 117 120 * … … 122 125 void ht_unlock(as_t *as, bool unlock) 123 126 { 127 mutex_unlock(&page_ht_lock); 128 124 129 if (unlock) 125 130 mutex_unlock(&as->lock); … … 135 140 bool ht_locked(as_t *as) 136 141 { 137 return mutex_locked(&as->lock);142 return (mutex_locked(&page_ht_lock) && mutex_locked(&as->lock)); 138 143 } 139 144
Note:
See TracChangeset
for help on using the changeset viewer.