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