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