Changes in kernel/generic/src/mm/as.c [0ff03f3:7250d2c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r0ff03f3 r7250d2c 94 94 * 95 95 * This lock protects: 96 * - inactive_as_with_asid_ headlist96 * - inactive_as_with_asid_list 97 97 * - as->asid for each as of the as_t type 98 98 * - asids_allocated counter … … 105 105 * that have valid ASID. 106 106 */ 107 LIST_INITIALIZE(inactive_as_with_asid_ head);107 LIST_INITIALIZE(inactive_as_with_asid_list); 108 108 109 109 /** Kernel address space. */ … … 235 235 bool cond = true; 236 236 while (cond) { 237 ASSERT(!list_empty(&as->as_area_btree.leaf_ head));237 ASSERT(!list_empty(&as->as_area_btree.leaf_list)); 238 238 239 239 btree_node_t *node = 240 list_get_instance( as->as_area_btree.leaf_head.next,240 list_get_instance(list_first(&as->as_area_btree.leaf_list), 241 241 btree_node_t, leaf_link); 242 242 … … 602 602 bool cond = true; 603 603 while (cond) { 604 ASSERT(!list_empty(&area->used_space.leaf_ head));604 ASSERT(!list_empty(&area->used_space.leaf_list)); 605 605 606 606 btree_node_t *node = 607 list_get_instance( area->used_space.leaf_head.prev,607 list_get_instance(list_last(&area->used_space.leaf_list), 608 608 btree_node_t, leaf_link); 609 609 … … 675 675 676 676 /* 677 * Invalidate software translation caches (e.g. TSB on sparc64). 677 * Invalidate software translation caches 678 * (e.g. TSB on sparc64, PHT on ppc32). 678 679 */ 679 680 as_invalidate_translation_cache(as, area->base + P2SZ(pages), … … 726 727 if (--sh_info->refcount == 0) { 727 728 dealloc = true; 728 link_t *cur;729 729 730 730 /* … … 732 732 * reference from all frames found there. 733 733 */ 734 for (cur = sh_info->pagemap.leaf_head.next; 735 cur != &sh_info->pagemap.leaf_head; cur = cur->next) { 734 list_foreach(sh_info->pagemap.leaf_list, cur) { 736 735 btree_node_t *node 737 736 = list_get_instance(cur, btree_node_t, leaf_link); … … 785 784 * Visit only the pages mapped by used_space B+tree. 786 785 */ 787 link_t *cur; 788 for (cur = area->used_space.leaf_head.next; 789 cur != &area->used_space.leaf_head; cur = cur->next) { 786 list_foreach(area->used_space.leaf_list, cur) { 790 787 btree_node_t *node; 791 788 btree_key_t i; … … 823 820 824 821 /* 825 * Invalidate potential software translation caches (e.g. TSB on826 * sparc64).822 * Invalidate potential software translation caches 823 * (e.g. TSB on sparc64, PHT on ppc32). 827 824 */ 828 825 as_invalidate_translation_cache(as, area->base, area->pages); … … 1064 1061 */ 1065 1062 size_t used_pages = 0; 1066 link_t *cur; 1067 1068 for (cur = area->used_space.leaf_head.next; 1069 cur != &area->used_space.leaf_head; cur = cur->next) { 1063 1064 list_foreach(area->used_space.leaf_list, cur) { 1070 1065 btree_node_t *node 1071 1066 = list_get_instance(cur, btree_node_t, leaf_link); … … 1093 1088 size_t frame_idx = 0; 1094 1089 1095 for (cur = area->used_space.leaf_head.next; 1096 cur != &area->used_space.leaf_head; cur = cur->next) { 1090 list_foreach(area->used_space.leaf_list, cur) { 1097 1091 btree_node_t *node = list_get_instance(cur, btree_node_t, 1098 1092 leaf_link); … … 1126 1120 1127 1121 /* 1128 * Invalidate potential software translation caches (e.g. TSB on1129 * sparc64).1122 * Invalidate potential software translation caches 1123 * (e.g. TSB on sparc64, PHT on ppc32). 1130 1124 */ 1131 1125 as_invalidate_translation_cache(as, area->base, area->pages); … … 1146 1140 frame_idx = 0; 1147 1141 1148 for (cur = area->used_space.leaf_head.next; 1149 cur != &area->used_space.leaf_head; cur = cur->next) { 1142 list_foreach(area->used_space.leaf_list, cur) { 1150 1143 btree_node_t *node 1151 1144 = list_get_instance(cur, btree_node_t, leaf_link); … … 1291 1284 * thing which is forbidden in this context is locking the address space. 1292 1285 * 1293 * When this function is en etered, no spinlocks may be held.1286 * When this function is entered, no spinlocks may be held. 1294 1287 * 1295 1288 * @param old Old address space or NULL. … … 1333 1326 1334 1327 list_append(&old_as->inactive_as_with_asid_link, 1335 &inactive_as_with_asid_ head);1328 &inactive_as_with_asid_list); 1336 1329 } 1337 1330 … … 2026 2019 2027 2020 /* Eventually check the addresses behind each area */ 2028 li nk_t *cur;2029 for (cur = AS->as_area_btree.leaf_head.next;2030 (ret == 0) && (cur != &AS->as_area_btree.leaf_head);2031 cur = cur->next) { 2021 list_foreach(AS->as_area_btree.leaf_list, cur) { 2022 if (ret != 0) 2023 break; 2024 2032 2025 btree_node_t *node = 2033 2026 list_get_instance(cur, btree_node_t, leaf_link); … … 2071 2064 2072 2065 size_t area_cnt = 0; 2073 link_t *cur; 2074 2075 for (cur = as->as_area_btree.leaf_head.next; 2076 cur != &as->as_area_btree.leaf_head; cur = cur->next) { 2066 2067 list_foreach(as->as_area_btree.leaf_list, cur) { 2077 2068 btree_node_t *node = 2078 2069 list_get_instance(cur, btree_node_t, leaf_link); … … 2087 2078 size_t area_idx = 0; 2088 2079 2089 for (cur = as->as_area_btree.leaf_head.next; 2090 cur != &as->as_area_btree.leaf_head; cur = cur->next) { 2080 list_foreach(as->as_area_btree.leaf_list, cur) { 2091 2081 btree_node_t *node = 2092 2082 list_get_instance(cur, btree_node_t, leaf_link); … … 2124 2114 2125 2115 /* Print out info about address space areas */ 2126 link_t *cur; 2127 for (cur = as->as_area_btree.leaf_head.next; 2128 cur != &as->as_area_btree.leaf_head; cur = cur->next) { 2116 list_foreach(as->as_area_btree.leaf_list, cur) { 2129 2117 btree_node_t *node 2130 2118 = list_get_instance(cur, btree_node_t, leaf_link);
Note:
See TracChangeset
for help on using the changeset viewer.