Ignore:
File:
1 edited

Legend:

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

    rada559c rd99c1d2  
    3030 * @{
    3131 */
    32 
     32 
    3333/**
    3434 * @file
    35  * @brief Address space functions for global page hash table.
     35 * @brief       Address space functions for global page hash table.
    3636 */
    3737
     
    4646#include <synch/mutex.h>
    4747
    48 static pte_t *ht_create(unsigned int);
    49 static void ht_destroy(pte_t *);
     48static pte_t *ht_create(int flags);
     49static void ht_destroy(pte_t *page_table);
    5050
    51 static void ht_lock(as_t *, bool);
    52 static void ht_unlock(as_t *, bool);
    53 static bool ht_locked(as_t *);
     51static void ht_lock(as_t *as, bool lock);
     52static void ht_unlock(as_t *as, bool unlock);
    5453
    5554as_operations_t as_ht_operations = {
     
    5857        .page_table_lock = ht_lock,
    5958        .page_table_unlock = ht_unlock,
    60         .page_table_locked = ht_locked,
    6159};
    6260
     
    7068 *
    7169 * @return Returns NULL.
    72  *
    7370 */
    74 pte_t *ht_create(unsigned int flags)
     71pte_t *ht_create(int flags)
    7572{
    7673        if (flags & FLAG_AS_KERNEL) {
     
    7875                mutex_initialize(&page_ht_lock, MUTEX_PASSIVE);
    7976        }
    80        
    8177        return NULL;
    8278}
     
    8783 *
    8884 * @param page_table This parameter is ignored.
    89  *
    9085 */
    9186void ht_destroy(pte_t *page_table)
     
    9994 * Interrupts must be disabled.
    10095 *
    101  * @param as   Address space.
     96 * @param as Address space.
    10297 * @param lock If false, do not attempt to lock the address space.
    103  *
    10498 */
    10599void ht_lock(as_t *as, bool lock)
     
    107101        if (lock)
    108102                mutex_lock(&as->lock);
    109        
    110103        mutex_lock(&page_ht_lock);
    111104}
     
    116109 * Interrupts must be disabled.
    117110 *
    118  * @param as     Address space.
     111 * @param as Address space.
    119112 * @param unlock If false, do not attempt to lock the address space.
    120  *
    121113 */
    122114void ht_unlock(as_t *as, bool unlock)
    123115{
    124116        mutex_unlock(&page_ht_lock);
    125        
    126117        if (unlock)
    127118                mutex_unlock(&as->lock);
    128119}
    129120
    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  */
    137 bool ht_locked(as_t *as)
    138 {
    139         return (mutex_locked(&page_ht_lock) && mutex_locked(&as->lock));
    140 }
    141 
    142121/** @}
    143122 */
Note: See TracChangeset for help on using the changeset viewer.