Changes in kernel/generic/src/mm/as.c [63e27ef:560b81c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r63e27ef r560b81c 67 67 #include <arch/asm.h> 68 68 #include <panic.h> 69 #include < assert.h>69 #include <debug.h> 70 70 #include <print.h> 71 #include <mem .h>71 #include <memstr.h> 72 72 #include <macros.h> 73 73 #include <bitops.h> … … 189 189 DEADLOCK_PROBE_INIT(p_asidlock); 190 190 191 assert(as != AS);192 assert(atomic_get(&as->refcount) == 0);191 ASSERT(as != AS); 192 ASSERT(atomic_get(&as->refcount) == 0); 193 193 194 194 /* … … 236 236 bool cond = true; 237 237 while (cond) { 238 assert(!list_empty(&as->as_area_btree.leaf_list));238 ASSERT(!list_empty(&as->as_area_btree.leaf_list)); 239 239 240 240 btree_node_t *node = … … 298 298 size_t count, bool guarded, as_area_t *avoid) 299 299 { 300 assert((addr % PAGE_SIZE) == 0);301 assert(mutex_locked(&as->lock));300 ASSERT((addr % PAGE_SIZE) == 0); 301 ASSERT(mutex_locked(&as->lock)); 302 302 303 303 /* … … 455 455 size_t size, bool guarded) 456 456 { 457 assert(mutex_locked(&as->lock));457 ASSERT(mutex_locked(&as->lock)); 458 458 459 459 if (size == 0) … … 532 532 533 533 mutex_lock(&sh_info->lock); 534 assert(sh_info->refcount);534 ASSERT(sh_info->refcount); 535 535 536 536 if (--sh_info->refcount == 0) { … … 696 696 NO_TRACE static as_area_t *find_area_and_lock(as_t *as, uintptr_t va) 697 697 { 698 assert(mutex_locked(&as->lock));698 ASSERT(mutex_locked(&as->lock)); 699 699 700 700 btree_node_t *leaf; … … 827 827 bool cond = true; 828 828 while (cond) { 829 assert(!list_empty(&area->used_space.leaf_list));829 ASSERT(!list_empty(&area->used_space.leaf_list)); 830 830 831 831 btree_node_t *node = … … 893 893 ptr + P2SZ(i), false, &pte); 894 894 895 assert(found);896 assert(PTE_VALID(&pte));897 assert(PTE_PRESENT(&pte));895 ASSERT(found); 896 ASSERT(PTE_VALID(&pte)); 897 ASSERT(PTE_PRESENT(&pte)); 898 898 899 899 if ((area->backend) && … … 1008 1008 ptr + P2SZ(size), false, &pte); 1009 1009 1010 assert(found);1011 assert(PTE_VALID(&pte));1012 assert(PTE_PRESENT(&pte));1010 ASSERT(found); 1011 ASSERT(PTE_VALID(&pte)); 1012 ASSERT(PTE_PRESENT(&pte)); 1013 1013 1014 1014 if ((area->backend) && … … 1194 1194 NO_TRACE bool as_area_check_access(as_area_t *area, pf_access_t access) 1195 1195 { 1196 assert(mutex_locked(&area->lock));1196 ASSERT(mutex_locked(&area->lock)); 1197 1197 1198 1198 int flagmap[] = { … … 1321 1321 ptr + P2SZ(size), false, &pte); 1322 1322 1323 assert(found);1324 assert(PTE_VALID(&pte));1325 assert(PTE_PRESENT(&pte));1323 ASSERT(found); 1324 ASSERT(PTE_VALID(&pte)); 1325 ASSERT(PTE_PRESENT(&pte)); 1326 1326 1327 1327 old_frame[frame_idx++] = PTE_GET_FRAME(&pte); … … 1541 1541 */ 1542 1542 if (old_as) { 1543 assert(old_as->cpu_refcount);1543 ASSERT(old_as->cpu_refcount); 1544 1544 1545 1545 if ((--old_as->cpu_refcount == 0) && (old_as != AS_KERNEL)) { … … 1550 1550 * ASID. 1551 1551 */ 1552 assert(old_as->asid != ASID_INVALID);1552 ASSERT(old_as->asid != ASID_INVALID); 1553 1553 1554 1554 list_append(&old_as->inactive_as_with_asid_link, … … 1597 1597 NO_TRACE unsigned int as_area_get_flags(as_area_t *area) 1598 1598 { 1599 assert(mutex_locked(&area->lock));1599 ASSERT(mutex_locked(&area->lock)); 1600 1600 1601 1601 return area_flags_to_page_flags(area->flags); … … 1615 1615 NO_TRACE pte_t *page_table_create(unsigned int flags) 1616 1616 { 1617 assert(as_operations);1618 assert(as_operations->page_table_create);1617 ASSERT(as_operations); 1618 ASSERT(as_operations->page_table_create); 1619 1619 1620 1620 return as_operations->page_table_create(flags); … … 1630 1630 NO_TRACE void page_table_destroy(pte_t *page_table) 1631 1631 { 1632 assert(as_operations);1633 assert(as_operations->page_table_destroy);1632 ASSERT(as_operations); 1633 ASSERT(as_operations->page_table_destroy); 1634 1634 1635 1635 as_operations->page_table_destroy(page_table); … … 1651 1651 NO_TRACE void page_table_lock(as_t *as, bool lock) 1652 1652 { 1653 assert(as_operations);1654 assert(as_operations->page_table_lock);1653 ASSERT(as_operations); 1654 ASSERT(as_operations->page_table_lock); 1655 1655 1656 1656 as_operations->page_table_lock(as, lock); … … 1665 1665 NO_TRACE void page_table_unlock(as_t *as, bool unlock) 1666 1666 { 1667 assert(as_operations);1668 assert(as_operations->page_table_unlock);1667 ASSERT(as_operations); 1668 ASSERT(as_operations->page_table_unlock); 1669 1669 1670 1670 as_operations->page_table_unlock(as, unlock); … … 1680 1680 NO_TRACE bool page_table_locked(as_t *as) 1681 1681 { 1682 assert(as_operations);1683 assert(as_operations->page_table_locked);1682 ASSERT(as_operations); 1683 ASSERT(as_operations->page_table_locked); 1684 1684 1685 1685 return as_operations->page_table_locked(as); … … 1724 1724 bool used_space_insert(as_area_t *area, uintptr_t page, size_t count) 1725 1725 { 1726 assert(mutex_locked(&area->lock));1727 assert(IS_ALIGNED(page, PAGE_SIZE));1728 assert(count);1726 ASSERT(mutex_locked(&area->lock)); 1727 ASSERT(IS_ALIGNED(page, PAGE_SIZE)); 1728 ASSERT(count); 1729 1729 1730 1730 btree_node_t *leaf = NULL; … … 1737 1737 } 1738 1738 1739 assert(leaf != NULL);1739 ASSERT(leaf != NULL); 1740 1740 1741 1741 if (!leaf->keys) { … … 2010 2010 bool used_space_remove(as_area_t *area, uintptr_t page, size_t count) 2011 2011 { 2012 assert(mutex_locked(&area->lock));2013 assert(IS_ALIGNED(page, PAGE_SIZE));2014 assert(count);2012 ASSERT(mutex_locked(&area->lock)); 2013 ASSERT(IS_ALIGNED(page, PAGE_SIZE)); 2014 ASSERT(count); 2015 2015 2016 2016 btree_node_t *leaf; … … 2257 2257 as_area_t *area = node->value[i]; 2258 2258 2259 assert(area_idx < area_cnt);2259 ASSERT(area_idx < area_cnt); 2260 2260 mutex_lock(&area->lock); 2261 2261
Note:
See TracChangeset
for help on using the changeset viewer.