Changeset 8f00329 in mainline for genarch/src/mm/page_ht.c


Ignore:
Timestamp:
2006-02-09T21:59:31Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a3eeceb6
Parents:
bfb87df
Message:

Add page_mapping_remove().

File:
1 edited

Legend:

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

    rbfb87df r8f00329  
    4848
    4949static void ht_mapping_insert(as_t *as, __address page, __address frame, int flags);
     50static void ht_mapping_remove(as_t *as, __address page);
    5051static pte_t *ht_mapping_find(as_t *as, __address page);
    5152
     
    7172page_mapping_operations_t ht_mapping_operations = {
    7273        .mapping_insert = ht_mapping_insert,
     74        .mapping_remove = ht_mapping_remove,
    7375        .mapping_find = ht_mapping_find
    7476};
     
    163165{
    164166        pte_t *t;
    165         ipl_t ipl;
    166167        __native key[2] = { (__address) as, page };
    167168       
    168         ipl = interrupts_disable();
    169169        spinlock_lock(&page_ht_lock);
    170170
     
    177177       
    178178        spinlock_unlock(&page_ht_lock);
    179         interrupts_restore(ipl);
    180 }
     179}
     180
     181/** Remove mapping of page from page hash table.
     182 *
     183 * Remove any mapping of 'page' within address space 'as'.
     184 * TLB shootdown should follow in order to make effects of
     185 * this call visible.
     186 *
     187 * The address space must be locked and interrupts must be disabled.
     188 *
     189 * @param as Address space to wich page belongs.
     190 * @param page Virtual address of the page to be demapped.
     191 */
     192void ht_mapping_remove(as_t *as, __address page)
     193{
     194        __native key[2] = { (__address) as, page };
     195       
     196        spinlock_lock(&page_ht_lock);
     197
     198        /*
     199         * Note that removed PTE's will be freed
     200         * by remove_callback().
     201         */
     202        hash_table_remove(&page_ht, key, 2);
     203
     204        spinlock_unlock(&page_ht_lock);
     205}
     206
    181207
    182208/** Find mapping for virtual page in page hash table.
Note: See TracChangeset for help on using the changeset viewer.