Changeset 2299914 in mainline for genarch/src/mm/as_pt.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/as_pt.c

    rb7dcabb r2299914  
    4040static pte_t *ptl0_create(int flags);
    4141
     42static void pt_lock(as_t *as, bool lock);
     43static void pt_unlock(as_t *as, bool unlock);
     44
    4245as_operations_t as_pt_operations = {
    43         .page_table_create = ptl0_create
     46        .page_table_create = ptl0_create,
     47        .page_table_lock = pt_lock,
     48        .page_table_unlock = pt_unlock
    4449};
    4550
     
    7782        return (pte_t *) KA2PA((__address) dst_ptl0);
    7883}
     84
     85/** Lock page tables.
     86 *
     87 * Lock only the address space.
     88 * Interrupts must be disabled.
     89 *
     90 * @param as Address space.
     91 * @param lock If false, do not attempt to lock the address space.
     92 */
     93void pt_lock(as_t *as, bool lock)
     94{
     95        if (lock)
     96                spinlock_lock(&as->lock);
     97}
     98
     99/** Unlock page tables.
     100 *
     101 * Unlock the address space.
     102 * Interrupts must be disabled.
     103 *
     104 * @param as Address space.
     105 * @param unlock If false, do not attempt to unlock the address space.
     106 */
     107void pt_unlock(as_t *as, bool unlock)
     108{
     109        if (unlock)
     110                spinlock_unlock(&as->lock);
     111}
Note: See TracChangeset for help on using the changeset viewer.