Ignore:
File:
1 edited

Legend:

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

    r83b6ba9f r59fb782  
    5555static bool phys_is_shareable(as_area_t *);
    5656
     57
    5758static int phys_page_fault(as_area_t *, uintptr_t, pf_access_t);
    58 
    59 static bool phys_create_shared_data(as_area_t *);
    60 static void phys_destroy_shared_data(void *);
    61 
    62 typedef struct {
    63         uintptr_t base;
    64         size_t frames; 
    65 } phys_shared_data_t;
    6659
    6760mem_backend_t phys_backend = {
     
    7669        .page_fault = phys_page_fault,
    7770        .frame_free = NULL,
    78        
    79         .create_shared_data = phys_create_shared_data,
    80         .destroy_shared_data = phys_destroy_shared_data
    8171};
    82 
    8372
    8473bool phys_create(as_area_t *area)
     
    10392void phys_destroy(as_area_t *area)
    10493{
    105         /*
    106          * Nothing to do.
    107          * The anonymous frames, if any, are released in
    108          * phys_destroy_shared_data().
    109          */
     94        /* Nothing to do. */
    11095}
    11196
     
    153138}
    154139
    155 bool 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 
    173 void 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 
    183140/** @}
    184141 */
Note: See TracChangeset for help on using the changeset viewer.