Ignore:
Timestamp:
2014-04-16T17:14:06Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f857e8b
Parents:
dba3e2c (diff), 70b570c (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/backend_anon.c

    rdba3e2c r8b863a62  
    7676        .page_fault = anon_page_fault,
    7777        .frame_free = anon_frame_free,
     78
     79        .create_shared_data = NULL,
     80        .destroy_shared_data = NULL
    7881};
    7982
     
    118121         */
    119122        mutex_lock(&area->sh_info->lock);
    120         list_foreach(area->used_space.leaf_list, cur) {
    121                 btree_node_t *node;
     123        list_foreach(area->used_space.leaf_list, leaf_link, btree_node_t,
     124            node) {
    122125                unsigned int i;
    123126               
    124                 node = list_get_instance(cur, btree_node_t, leaf_link);
    125127                for (i = 0; i < node->keys; i++) {
    126128                        uintptr_t base = node->key[i];
     
    191193                return AS_PF_FAULT;
    192194
    193         if (area->sh_info) {
     195        mutex_lock(&area->sh_info->lock);
     196        if (area->sh_info->shared) {
    194197                btree_node_t *leaf;
    195198               
     
    201204                 * mapping, a new frame is allocated and the mapping is created.
    202205                 */
    203                 mutex_lock(&area->sh_info->lock);
    204206                frame = (uintptr_t) btree_search(&area->sh_info->pagemap,
    205207                    upage - area->base, &leaf);
     
    233235                }
    234236                frame_reference_add(ADDR2PFN(frame));
    235                 mutex_unlock(&area->sh_info->lock);
    236237        } else {
    237238
     
    255256                         * Reserve the memory for this page now.
    256257                         */
    257                         if (!reserve_try_alloc(1))
     258                        if (!reserve_try_alloc(1)) {
     259                                mutex_unlock(&area->sh_info->lock);
    258260                                return AS_PF_SILENT;
     261                        }
    259262                }
    260263
     
    263266                km_temporary_page_put(kpage);
    264267        }
     268        mutex_unlock(&area->sh_info->lock);
    265269       
    266270        /*
     
    295299                 * the normal unreserving frame_free().
    296300                 */
    297                 frame_free(frame);
     301                frame_free(frame, 1);
    298302        } else {
    299303                /*
     
    302306                 * manipulate the reserve or it would be given back twice.
    303307                 */
    304                 frame_free_noreserve(frame);
     308                frame_free_noreserve(frame, 1);
    305309        }
    306310}
Note: See TracChangeset for help on using the changeset viewer.