Changes in kernel/generic/src/mm/as.c [55b77d9:eef1b031] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r55b77d9 reef1b031 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 … … 727 727 if (--sh_info->refcount == 0) { 728 728 dealloc = true; 729 link_t *cur; 729 730 730 731 /* … … 732 733 * reference from all frames found there. 733 734 */ 734 list_foreach(sh_info->pagemap.leaf_list, cur) { 735 for (cur = sh_info->pagemap.leaf_head.next; 736 cur != &sh_info->pagemap.leaf_head; cur = cur->next) { 735 737 btree_node_t *node 736 738 = list_get_instance(cur, btree_node_t, leaf_link); … … 784 786 * Visit only the pages mapped by used_space B+tree. 785 787 */ 786 list_foreach(area->used_space.leaf_list, cur) { 788 link_t *cur; 789 for (cur = area->used_space.leaf_head.next; 790 cur != &area->used_space.leaf_head; cur = cur->next) { 787 791 btree_node_t *node; 788 792 btree_key_t i; … … 1061 1065 */ 1062 1066 size_t used_pages = 0; 1063 1064 list_foreach(area->used_space.leaf_list, cur) { 1067 link_t *cur; 1068 1069 for (cur = area->used_space.leaf_head.next; 1070 cur != &area->used_space.leaf_head; cur = cur->next) { 1065 1071 btree_node_t *node 1066 1072 = list_get_instance(cur, btree_node_t, leaf_link); … … 1088 1094 size_t frame_idx = 0; 1089 1095 1090 list_foreach(area->used_space.leaf_list, cur) { 1096 for (cur = area->used_space.leaf_head.next; 1097 cur != &area->used_space.leaf_head; cur = cur->next) { 1091 1098 btree_node_t *node = list_get_instance(cur, btree_node_t, 1092 1099 leaf_link); … … 1140 1147 frame_idx = 0; 1141 1148 1142 list_foreach(area->used_space.leaf_list, cur) { 1149 for (cur = area->used_space.leaf_head.next; 1150 cur != &area->used_space.leaf_head; cur = cur->next) { 1143 1151 btree_node_t *node 1144 1152 = list_get_instance(cur, btree_node_t, leaf_link); … … 1326 1334 1327 1335 list_append(&old_as->inactive_as_with_asid_link, 1328 &inactive_as_with_asid_ list);1336 &inactive_as_with_asid_head); 1329 1337 } 1330 1338 … … 2019 2027 2020 2028 /* 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 2029 link_t *cur; 2030 for (cur = AS->as_area_btree.leaf_head.next; 2031 (ret == 0) && (cur != &AS->as_area_btree.leaf_head); 2032 cur = cur->next) { 2025 2033 btree_node_t *node = 2026 2034 list_get_instance(cur, btree_node_t, leaf_link); … … 2064 2072 2065 2073 size_t area_cnt = 0; 2066 2067 list_foreach(as->as_area_btree.leaf_list, cur) { 2074 link_t *cur; 2075 2076 for (cur = as->as_area_btree.leaf_head.next; 2077 cur != &as->as_area_btree.leaf_head; cur = cur->next) { 2068 2078 btree_node_t *node = 2069 2079 list_get_instance(cur, btree_node_t, leaf_link); … … 2078 2088 size_t area_idx = 0; 2079 2089 2080 list_foreach(as->as_area_btree.leaf_list, cur) { 2090 for (cur = as->as_area_btree.leaf_head.next; 2091 cur != &as->as_area_btree.leaf_head; cur = cur->next) { 2081 2092 btree_node_t *node = 2082 2093 list_get_instance(cur, btree_node_t, leaf_link); … … 2114 2125 2115 2126 /* Print out info about address space areas */ 2116 list_foreach(as->as_area_btree.leaf_list, cur) { 2127 link_t *cur; 2128 for (cur = as->as_area_btree.leaf_head.next; 2129 cur != &as->as_area_btree.leaf_head; cur = cur->next) { 2117 2130 btree_node_t *node 2118 2131 = list_get_instance(cur, btree_node_t, leaf_link);
Note:
See TracChangeset
for help on using the changeset viewer.