Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/mm/as_ht.c

    rfb63c06 rf97f1e51  
    7777        if (flags & FLAG_AS_KERNEL) {
    7878                hash_table_create(&page_ht, PAGE_HT_ENTRIES, 2, &ht_operations);
     79                mutex_initialize(&page_ht_lock, MUTEX_PASSIVE);
    7980                pte_cache = slab_cache_create("pte_t", sizeof(pte_t), 0,
    8081                    NULL, NULL, SLAB_CACHE_MAGDEFERRED);
     
    9899/** Lock page table.
    99100 *
    100  * Lock address space.
     101 * Lock address space and page hash table.
    101102 * Interrupts must be disabled.
    102103 *
     
    109110        if (lock)
    110111                mutex_lock(&as->lock);
     112       
     113        mutex_lock(&page_ht_lock);
    111114}
    112115
    113116/** Unlock page table.
    114117 *
    115  * Unlock address space.
     118 * Unlock address space and page hash table.
    116119 * Interrupts must be disabled.
    117120 *
     
    122125void ht_unlock(as_t *as, bool unlock)
    123126{
     127        mutex_unlock(&page_ht_lock);
     128       
    124129        if (unlock)
    125130                mutex_unlock(&as->lock);
     
    135140bool ht_locked(as_t *as)
    136141{
    137         return mutex_locked(&as->lock);
     142        return (mutex_locked(&page_ht_lock) && mutex_locked(&as->lock));
    138143}
    139144
Note: See TracChangeset for help on using the changeset viewer.