Changes in kernel/genarch/src/mm/as_ht.c [ada559c:d99c1d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/mm/as_ht.c
rada559c rd99c1d2 30 30 * @{ 31 31 */ 32 32 33 33 /** 34 34 * @file 35 * @brief 35 * @brief Address space functions for global page hash table. 36 36 */ 37 37 … … 46 46 #include <synch/mutex.h> 47 47 48 static pte_t *ht_create( unsigned int);49 static void ht_destroy(pte_t * );48 static pte_t *ht_create(int flags); 49 static void ht_destroy(pte_t *page_table); 50 50 51 static void ht_lock(as_t *, bool); 52 static void ht_unlock(as_t *, bool); 53 static bool ht_locked(as_t *); 51 static void ht_lock(as_t *as, bool lock); 52 static void ht_unlock(as_t *as, bool unlock); 54 53 55 54 as_operations_t as_ht_operations = { … … 58 57 .page_table_lock = ht_lock, 59 58 .page_table_unlock = ht_unlock, 60 .page_table_locked = ht_locked,61 59 }; 62 60 … … 70 68 * 71 69 * @return Returns NULL. 72 *73 70 */ 74 pte_t *ht_create( unsignedint flags)71 pte_t *ht_create(int flags) 75 72 { 76 73 if (flags & FLAG_AS_KERNEL) { … … 78 75 mutex_initialize(&page_ht_lock, MUTEX_PASSIVE); 79 76 } 80 81 77 return NULL; 82 78 } … … 87 83 * 88 84 * @param page_table This parameter is ignored. 89 *90 85 */ 91 86 void ht_destroy(pte_t *page_table) … … 99 94 * Interrupts must be disabled. 100 95 * 101 * @param as 96 * @param as Address space. 102 97 * @param lock If false, do not attempt to lock the address space. 103 *104 98 */ 105 99 void ht_lock(as_t *as, bool lock) … … 107 101 if (lock) 108 102 mutex_lock(&as->lock); 109 110 103 mutex_lock(&page_ht_lock); 111 104 } … … 116 109 * Interrupts must be disabled. 117 110 * 118 * @param as 111 * @param as Address space. 119 112 * @param unlock If false, do not attempt to lock the address space. 120 *121 113 */ 122 114 void ht_unlock(as_t *as, bool unlock) 123 115 { 124 116 mutex_unlock(&page_ht_lock); 125 126 117 if (unlock) 127 118 mutex_unlock(&as->lock); 128 119 } 129 120 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 soace135 * 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 142 121 /** @} 143 122 */
Note:
See TracChangeset
for help on using the changeset viewer.