Changeset 6a44ee4 in mainline for kernel/generic/src/mm/as.c


Ignore:
Timestamp:
2011-07-20T15:26:21Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
efcebe1
Parents:
25bef0ff (diff), a701812 (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.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/as.c

    r25bef0ff r6a44ee4  
    9494 *
    9595 * This lock protects:
    96  * - inactive_as_with_asid_head list
     96 * - inactive_as_with_asid_list
    9797 * - as->asid for each as of the as_t type
    9898 * - asids_allocated counter
     
    105105 * that have valid ASID.
    106106 */
    107 LIST_INITIALIZE(inactive_as_with_asid_head);
     107LIST_INITIALIZE(inactive_as_with_asid_list);
    108108
    109109/** Kernel address space. */
     
    235235        bool cond = true;
    236236        while (cond) {
    237                 ASSERT(!list_empty(&as->as_area_btree.leaf_head));
     237                ASSERT(!list_empty(&as->as_area_btree.leaf_list));
    238238               
    239239                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),
    241241                    btree_node_t, leaf_link);
    242242               
     
    602602                bool cond = true;
    603603                while (cond) {
    604                         ASSERT(!list_empty(&area->used_space.leaf_head));
     604                        ASSERT(!list_empty(&area->used_space.leaf_list));
    605605                       
    606606                        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),
    608608                            btree_node_t, leaf_link);
    609609                       
     
    727727        if (--sh_info->refcount == 0) {
    728728                dealloc = true;
    729                 link_t *cur;
    730729               
    731730                /*
     
    733732                 * reference from all frames found there.
    734733                 */
    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) {
    737735                        btree_node_t *node
    738736                            = list_get_instance(cur, btree_node_t, leaf_link);
     
    786784         * Visit only the pages mapped by used_space B+tree.
    787785         */
    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) {
    791787                btree_node_t *node;
    792788                btree_key_t i;
     
    10651061         */
    10661062        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) {
    10711065                btree_node_t *node
    10721066                    = list_get_instance(cur, btree_node_t, leaf_link);
     
    10941088        size_t frame_idx = 0;
    10951089       
    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) {
    10981091                btree_node_t *node = list_get_instance(cur, btree_node_t,
    10991092                    leaf_link);
     
    11471140        frame_idx = 0;
    11481141       
    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) {
    11511143                btree_node_t *node
    11521144                    = list_get_instance(cur, btree_node_t, leaf_link);
     
    12921284 * thing which is forbidden in this context is locking the address space.
    12931285 *
    1294  * When this function is enetered, no spinlocks may be held.
     1286 * When this function is entered, no spinlocks may be held.
    12951287 *
    12961288 * @param old Old address space or NULL.
     
    13341326                       
    13351327                        list_append(&old_as->inactive_as_with_asid_link,
    1336                             &inactive_as_with_asid_head);
     1328                            &inactive_as_with_asid_list);
    13371329                }
    13381330               
     
    20272019       
    20282020        /* Eventually check the addresses behind each area */
    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) {
     2021        list_foreach(AS->as_area_btree.leaf_list, cur) {
     2022                if (ret != 0)
     2023                        break;
     2024
    20332025                btree_node_t *node =
    20342026                    list_get_instance(cur, btree_node_t, leaf_link);
     
    20722064       
    20732065        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) {
    20782068                btree_node_t *node =
    20792069                    list_get_instance(cur, btree_node_t, leaf_link);
     
    20882078        size_t area_idx = 0;
    20892079       
    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) {
    20922081                btree_node_t *node =
    20932082                    list_get_instance(cur, btree_node_t, leaf_link);
     
    21252114       
    21262115        /* 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) {
    21302117                btree_node_t *node
    21312118                    = list_get_instance(cur, btree_node_t, leaf_link);
Note: See TracChangeset for help on using the changeset viewer.