Ignore:
Timestamp:
2014-03-15T19:21:53Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c773adc
Parents:
2034f98 (diff), 8cffdf5 (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_phys.c

    r2034f98 rb0b4592e  
    5555static bool phys_is_shareable(as_area_t *);
    5656
     57static int phys_page_fault(as_area_t *, uintptr_t, pf_access_t);
    5758
    58 static int phys_page_fault(as_area_t *, uintptr_t, pf_access_t);
     59static bool phys_create_shared_data(as_area_t *);
     60static void phys_destroy_shared_data(void *);
     61
     62typedef struct {
     63        uintptr_t base;
     64        size_t frames; 
     65} phys_shared_data_t;
    5966
    6067mem_backend_t phys_backend = {
     
    6976        .page_fault = phys_page_fault,
    7077        .frame_free = NULL,
     78       
     79        .create_shared_data = phys_create_shared_data,
     80        .destroy_shared_data = phys_destroy_shared_data
    7181};
     82
    7283
    7384bool phys_create(as_area_t *area)
     
    92103void phys_destroy(as_area_t *area)
    93104{
    94         /* Nothing to do. */
     105        /*
     106         * Nothing to do.
     107         * The anonymous frames, if any, are released in
     108         * phys_destroy_shared_data().
     109         */
    95110}
    96111
     
    138153}
    139154
     155bool phys_create_shared_data(as_area_t *area)
     156{
     157        /*
     158         * For anonymous phys areas, create the shared data.
     159         */
     160        if (area->backend_data.anonymous) {
     161                phys_shared_data_t *data;
     162
     163                data = (phys_shared_data_t *) malloc(sizeof(*data), 0);
     164
     165                data->base = area->backend_data.base;
     166                data->frames = area->backend_data.frames;
     167                area->sh_info->backend_shared_data = data;
     168        }
     169
     170        return true;
     171}
     172
     173void phys_destroy_shared_data(void *opaque_data)
     174{
     175        phys_shared_data_t *data = (phys_shared_data_t *) opaque_data;
     176
     177        if (data) {
     178                frame_free(data->base, data->frames);
     179                free(data);
     180        }
     181}
     182
    140183/** @}
    141184 */
Note: See TracChangeset for help on using the changeset viewer.