Changeset bd08239 in mainline for kernel/generic/src/mm/as.c
- Timestamp:
- 2011-06-18T15:35:25Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 44e2c1a
- Parents:
- 313775b (diff), adfdbd5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r313775b rbd08239 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 … … 727 727 if (--sh_info->refcount == 0) { 728 728 dealloc = true; 729 link_t *cur;730 729 731 730 /* … … 733 732 * reference from all frames found there. 734 733 */ 735 for (cur = sh_info->pagemap.leaf_head.next; 736 cur != &sh_info->pagemap.leaf_head; cur = cur->next) { 734 list_foreach(sh_info->pagemap.leaf_list, cur) { 737 735 btree_node_t *node 738 736 = list_get_instance(cur, btree_node_t, leaf_link); … … 786 784 * Visit only the pages mapped by used_space B+tree. 787 785 */ 788 link_t *cur; 789 for (cur = area->used_space.leaf_head.next; 790 cur != &area->used_space.leaf_head; cur = cur->next) { 786 list_foreach(area->used_space.leaf_list, cur) { 791 787 btree_node_t *node; 792 788 btree_key_t i; … … 1065 1061 */ 1066 1062 size_t used_pages = 0; 1067 link_t *cur; 1068 1069 for (cur = area->used_space.leaf_head.next; 1070 cur != &area->used_space.leaf_head; cur = cur->next) { 1063 1064 list_foreach(area->used_space.leaf_list, cur) { 1071 1065 btree_node_t *node 1072 1066 = list_get_instance(cur, btree_node_t, leaf_link); … … 1094 1088 size_t frame_idx = 0; 1095 1089 1096 for (cur = area->used_space.leaf_head.next; 1097 cur != &area->used_space.leaf_head; cur = cur->next) { 1090 list_foreach(area->used_space.leaf_list, cur) { 1098 1091 btree_node_t *node = list_get_instance(cur, btree_node_t, 1099 1092 leaf_link); … … 1147 1140 frame_idx = 0; 1148 1141 1149 for (cur = area->used_space.leaf_head.next; 1150 cur != &area->used_space.leaf_head; cur = cur->next) { 1142 list_foreach(area->used_space.leaf_list, cur) { 1151 1143 btree_node_t *node 1152 1144 = list_get_instance(cur, btree_node_t, leaf_link); … … 1334 1326 1335 1327 list_append(&old_as->inactive_as_with_asid_link, 1336 &inactive_as_with_asid_ head);1328 &inactive_as_with_asid_list); 1337 1329 } 1338 1330 … … 2027 2019 2028 2020 /* Eventually check the addresses behind each area */ 2029 li nk_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) { 2021 list_foreach(AS->as_area_btree.leaf_list, cur) { 2022 if (ret != 0) 2023 break; 2024 2033 2025 btree_node_t *node = 2034 2026 list_get_instance(cur, btree_node_t, leaf_link); … … 2072 2064 2073 2065 size_t area_cnt = 0; 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) { 2066 2067 list_foreach(as->as_area_btree.leaf_list, cur) { 2078 2068 btree_node_t *node = 2079 2069 list_get_instance(cur, btree_node_t, leaf_link); … … 2088 2078 size_t area_idx = 0; 2089 2079 2090 for (cur = as->as_area_btree.leaf_head.next; 2091 cur != &as->as_area_btree.leaf_head; cur = cur->next) { 2080 list_foreach(as->as_area_btree.leaf_list, cur) { 2092 2081 btree_node_t *node = 2093 2082 list_get_instance(cur, btree_node_t, leaf_link); … … 2125 2114 2126 2115 /* Print out info about address space areas */ 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) { 2116 list_foreach(as->as_area_btree.leaf_list, cur) { 2130 2117 btree_node_t *node 2131 2118 = list_get_instance(cur, btree_node_t, leaf_link);
Note:
See TracChangeset
for help on using the changeset viewer.