Changeset 63e27ef in mainline for kernel/genarch/src/mm
- Timestamp:
- 2017-06-19T21:47:42Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- deacc58d
- Parents:
- 7354b5e
- Location:
- kernel/genarch/src/mm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/mm/asid.c
r7354b5e r63e27ef 57 57 */ 58 58 59 #include <assert.h> 59 60 #include <mm/asid.h> 60 61 #include <mm/as.h> … … 64 65 #include <synch/mutex.h> 65 66 #include <adt/list.h> 66 #include <debug.h>67 67 68 68 static size_t asids_allocated = 0; … … 78 78 as_t *as; 79 79 80 ASSERT(interrupts_disabled());81 ASSERT(spinlock_locked(&asidlock));80 assert(interrupts_disabled()); 81 assert(spinlock_locked(&asidlock)); 82 82 83 83 /* … … 98 98 */ 99 99 tmp = list_first(&inactive_as_with_asid_list); 100 ASSERT(tmp != NULL);100 assert(tmp != NULL); 101 101 list_remove(tmp); 102 102 … … 108 108 */ 109 109 asid = as->asid; 110 ASSERT(asid != ASID_INVALID);110 assert(asid != ASID_INVALID); 111 111 112 112 /* -
kernel/genarch/src/mm/page_ht.c
r7354b5e r63e27ef 48 48 #include <synch/spinlock.h> 49 49 #include <arch.h> 50 #include < debug.h>50 #include <assert.h> 51 51 #include <adt/hash_table.h> 52 52 #include <align.h> … … 137 137 bool compare(sysarg_t key[], size_t keys, link_t *item) 138 138 { 139 ASSERT(item);140 ASSERT(keys > 0);141 ASSERT(keys <= PAGE_HT_KEYS);139 assert(item); 140 assert(keys > 0); 141 assert(keys <= PAGE_HT_KEYS); 142 142 143 143 /* … … 161 161 void remove_callback(link_t *item) 162 162 { 163 ASSERT(item);163 assert(item); 164 164 165 165 /* … … 191 191 }; 192 192 193 ASSERT(page_table_locked(as));193 assert(page_table_locked(as)); 194 194 195 195 irq_spinlock_lock(&page_ht_lock, true); … … 197 197 if (!hash_table_find(&page_ht, key)) { 198 198 pte_t *pte = slab_alloc(pte_cache, FRAME_LOWMEM | FRAME_ATOMIC); 199 ASSERT(pte != NULL);199 assert(pte != NULL); 200 200 201 201 pte->g = (flags & PAGE_GLOBAL) != 0; … … 241 241 }; 242 242 243 ASSERT(page_table_locked(as));243 assert(page_table_locked(as)); 244 244 245 245 irq_spinlock_lock(&page_ht_lock, true); … … 261 261 }; 262 262 263 ASSERT(nolock || page_table_locked(as));263 assert(nolock || page_table_locked(as)); 264 264 265 265 link_t *cur = hash_table_find(&page_ht, key); … … 307 307 panic("Updating non-existent PTE"); 308 308 309 ASSERT(pte->as == t->as);310 ASSERT(pte->page == t->page);311 ASSERT(pte->frame == t->frame);312 ASSERT(pte->g == t->g);313 ASSERT(pte->x == t->x);314 ASSERT(pte->w == t->w);315 ASSERT(pte->k == t->k);316 ASSERT(pte->c == t->c);317 ASSERT(pte->p == t->p);309 assert(pte->as == t->as); 310 assert(pte->page == t->page); 311 assert(pte->frame == t->frame); 312 assert(pte->g == t->g); 313 assert(pte->x == t->x); 314 assert(pte->w == t->w); 315 assert(pte->k == t->k); 316 assert(pte->c == t->c); 317 assert(pte->p == t->p); 318 318 319 319 t->a = pte->a; -
kernel/genarch/src/mm/page_pt.c
r7354b5e r63e27ef 36 36 */ 37 37 38 #include <assert.h> 38 39 #include <genarch/mm/page_pt.h> 39 40 #include <mm/page.h> … … 81 82 pte_t *ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table); 82 83 83 ASSERT(page_table_locked(as));84 assert(page_table_locked(as)); 84 85 85 86 if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) { … … 159 160 void pt_mapping_remove(as_t *as, uintptr_t page) 160 161 { 161 ASSERT(page_table_locked(as));162 assert(page_table_locked(as)); 162 163 163 164 /* … … 293 294 static pte_t *pt_mapping_find_internal(as_t *as, uintptr_t page, bool nolock) 294 295 { 295 ASSERT(nolock || page_table_locked(as));296 assert(nolock || page_table_locked(as)); 296 297 297 298 pte_t *ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table); … … 358 359 panic("Updating non-existent PTE"); 359 360 360 ASSERT(PTE_VALID(t) == PTE_VALID(pte));361 ASSERT(PTE_PRESENT(t) == PTE_PRESENT(pte));362 ASSERT(PTE_GET_FRAME(t) == PTE_GET_FRAME(pte));363 ASSERT(PTE_WRITABLE(t) == PTE_WRITABLE(pte));364 ASSERT(PTE_EXECUTABLE(t) == PTE_EXECUTABLE(pte));361 assert(PTE_VALID(t) == PTE_VALID(pte)); 362 assert(PTE_PRESENT(t) == PTE_PRESENT(pte)); 363 assert(PTE_GET_FRAME(t) == PTE_GET_FRAME(pte)); 364 assert(PTE_WRITABLE(t) == PTE_WRITABLE(pte)); 365 assert(PTE_EXECUTABLE(t) == PTE_EXECUTABLE(pte)); 365 366 366 367 *t = *pte; … … 398 399 void pt_mapping_make_global(uintptr_t base, size_t size) 399 400 { 400 ASSERT(size > 0);401 assert(size > 0); 401 402 402 403 uintptr_t ptl0 = PA2KA((uintptr_t) AS_KERNEL->genarch.page_table); … … 416 417 addr += ptl0_step) { 417 418 if (GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(addr)) != 0) { 418 ASSERT(overlaps(addr, ptl0_step,419 assert(overlaps(addr, ptl0_step, 419 420 config.identity_base, config.identity_size)); 420 421
Note:
See TracChangeset
for help on using the changeset viewer.
