Changeset ada559c in mainline


Ignore:
Timestamp:
2010-05-30T21:11:39Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a820bf7
Parents:
c8e99bb
Message:

Add page_table_locked() interface.

Location:
kernel
Files:
5 edited

Legend:

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

    rc8e99bb rada559c  
    5151static void ht_lock(as_t *, bool);
    5252static void ht_unlock(as_t *, bool);
     53static bool ht_locked(as_t *);
    5354
    5455as_operations_t as_ht_operations = {
     
    5758        .page_table_lock = ht_lock,
    5859        .page_table_unlock = ht_unlock,
     60        .page_table_locked = ht_locked,
    5961};
    6062
     
    126128}
    127129
     130/** Test whether page tables are locked.
     131 *
     132 * @param as            Address space where the page tables belong.
     133 *
     134 * @return              True if the page tables belonging to the address soace
     135 *                      are locked, otherwise false.
     136 */
     137bool ht_locked(as_t *as)
     138{
     139        return (mutex_locked(&page_ht_lock) && mutex_locked(&as->lock));
     140}
     141
    128142/** @}
    129143 */
  • kernel/genarch/src/mm/as_pt.c

    rc8e99bb rada559c  
    5252static void pt_lock(as_t *, bool);
    5353static void pt_unlock(as_t *, bool);
     54static bool pt_locked(as_t *);
    5455
    5556as_operations_t as_pt_operations = {
     
    5758        .page_table_destroy = ptl0_destroy,
    5859        .page_table_lock = pt_lock,
    59         .page_table_unlock = pt_unlock
     60        .page_table_unlock = pt_unlock,
     61        .page_table_locked = pt_locked,
    6062};
    6163
     
    146148}
    147149
     150/** Test whether page tables are locked.
     151 *
     152 * @param as            Address space where the page tables belong.
     153 *
     154 * @return              True if the page tables belonging to the address soace
     155 *                      are locked, otherwise false.
     156 */
     157bool pt_locked(as_t *as)
     158{
     159        return mutex_locked(&as->lock);
     160}
     161
    148162/** @}
    149163 */
  • kernel/generic/include/mm/as.h

    rc8e99bb rada559c  
    147147        void (* page_table_lock)(as_t *, bool);
    148148        void (* page_table_unlock)(as_t *, bool);
     149        bool (* page_table_locked)(as_t *);
    149150} as_operations_t;
    150151
  • kernel/generic/include/mm/page.h

    rc8e99bb rada559c  
    5252extern void page_table_lock(as_t *, bool);
    5353extern void page_table_unlock(as_t *, bool);
     54extern bool page_table_locked(as_t *);
    5455extern void page_mapping_insert(as_t *, uintptr_t, uintptr_t, unsigned int);
    5556extern void page_mapping_remove(as_t *, uintptr_t);
  • kernel/generic/src/mm/as.c

    rc8e99bb rada559c  
    12931293}
    12941294
     1295/** Test whether page tables are locked.
     1296 *
     1297 * @param as            Address space where the page tables belong.
     1298 *
     1299 * @return              True if the page tables belonging to the address soace
     1300 *                      are locked, otherwise false.
     1301 */
     1302bool page_table_locked(as_t *as)
     1303{
     1304        ASSERT(as_operations);
     1305        ASSERT(as_operations->page_table_locked);
     1306
     1307        return as_operations->page_table_locked(as);
     1308}
     1309
    12951310
    12961311/** Find address space area and lock it.
Note: See TracChangeset for help on using the changeset viewer.