Changeset a55ddc64 in mainline
- Timestamp:
- 2011-11-17T22:29:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ad12b5ea
- Parents:
- 6b326ea1
- Location:
- kernel/genarch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/include/mm/page_ht.h
r6b326ea1 ra55ddc64 43 43 #include <mm/as.h> 44 44 #include <mm/page.h> 45 #include <mm/slab.h> 45 46 #include <synch/mutex.h> 46 47 #include <adt/hash_table.h> … … 64 65 extern page_mapping_operations_t ht_mapping_operations; 65 66 67 extern slab_cache_t *pte_cache; 66 68 extern mutex_t page_ht_lock; 67 69 extern hash_table_t page_ht; -
kernel/genarch/src/mm/as_ht.c
r6b326ea1 ra55ddc64 41 41 #include <mm/as.h> 42 42 #include <mm/frame.h> 43 #include <mm/slab.h> 43 44 #include <typedefs.h> 44 45 #include <memstr.h> … … 77 78 hash_table_create(&page_ht, PAGE_HT_ENTRIES, 2, &ht_operations); 78 79 mutex_initialize(&page_ht_lock, MUTEX_PASSIVE); 80 pte_cache = slab_cache_create("pte_cache", sizeof(pte_t), 0, NULL, NULL, 81 SLAB_CACHE_MAGDEFERRED); 79 82 } 80 83 -
kernel/genarch/src/mm/page_ht.c
r6b326ea1 ra55ddc64 60 60 static pte_t *ht_mapping_find(as_t *, uintptr_t, bool); 61 61 62 slab_cache_t *pte_cache = NULL; 63 62 64 /** 63 65 * This lock protects the page hash table. It must be acquired … … 163 165 pte_t *pte = hash_table_get_instance(item, pte_t, link); 164 166 165 free(pte);167 slab_free(pte_cache, pte); 166 168 } 167 169 … … 188 190 189 191 if (!hash_table_find(&page_ht, key)) { 190 pte_t *pte = (pte_t *) malloc(sizeof(pte_t),FRAME_ATOMIC);192 pte_t *pte = slab_alloc(pte_cache, FRAME_LOWMEM | FRAME_ATOMIC); 191 193 ASSERT(pte != NULL); 192 194
Note:
See TracChangeset
for help on using the changeset viewer.