Changeset 2299914 in mainline for genarch/src/mm/page_ht.c


Ignore:
Timestamp:
2006-03-16T12:57:31Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e898a8d7
Parents:
b7dcabb
Message:

Page table locking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • genarch/src/mm/page_ht.c

    rb7dcabb r2299914  
    5353
    5454/**
    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.
    5658 */
    5759SPINLOCK_INITIALIZE(page_ht_lock);
     
    156158 * using 'flags'.
    157159 *
    158  * The address space must be locked and interruptsmust be disabled.
     160 * The page table must be locked and interrupts must be disabled.
    159161 *
    160162 * @param as Address space to which page belongs.
     
    168170        __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
    169171       
    170         spinlock_lock(&page_ht_lock);
    171 
    172172        if (!hash_table_find(&page_ht, key)) {
    173173                t = (pte_t *) malloc(sizeof(pte_t), FRAME_ATOMIC);
     
    187187                hash_table_insert(&page_ht, key, &t->link);
    188188        }
    189        
    190         spinlock_unlock(&page_ht_lock);
    191189}
    192190
     
    197195 * this call visible.
    198196 *
    199  * The address space must be locked and interrupts must be disabled.
     197 * The page table must be locked and interrupts must be disabled.
    200198 *
    201199 * @param as Address space to wich page belongs.
     
    206204        __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
    207205       
    208         spinlock_lock(&page_ht_lock);
    209 
    210206        /*
    211207         * Note that removed PTE's will be freed
     
    213209         */
    214210        hash_table_remove(&page_ht, key, 2);
    215 
    216         spinlock_unlock(&page_ht_lock);
    217211}
    218212
     
    222216 * Find mapping for virtual page.
    223217 *
    224  * The address space must be locked and interrupts must be disabled.
     218 * The page table must be locked and interrupts must be disabled.
    225219 *
    226220 * @param as Address space to wich page belongs.
     
    235229        __native key[2] = { (__address) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
    236230       
    237         spinlock_lock(&page_ht_lock);
    238 
    239231        hlp = hash_table_find(&page_ht, key);
    240232        if (hlp)
    241233                t = hash_table_get_instance(hlp, pte_t, link);
    242234
    243         spinlock_unlock(&page_ht_lock);
    244235        return t;
    245236}
Note: See TracChangeset for help on using the changeset viewer.