Changes in kernel/generic/src/mm/backend_phys.c [83b6ba9f:59fb782] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/backend_phys.c
r83b6ba9f r59fb782 55 55 static bool phys_is_shareable(as_area_t *); 56 56 57 57 58 static 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;66 59 67 60 mem_backend_t phys_backend = { … … 76 69 .page_fault = phys_page_fault, 77 70 .frame_free = NULL, 78 79 .create_shared_data = phys_create_shared_data,80 .destroy_shared_data = phys_destroy_shared_data81 71 }; 82 83 72 84 73 bool phys_create(as_area_t *area) … … 103 92 void phys_destroy(as_area_t *area) 104 93 { 105 /* 106 * Nothing to do. 107 * The anonymous frames, if any, are released in 108 * phys_destroy_shared_data(). 109 */ 94 /* Nothing to do. */ 110 95 } 111 96 … … 153 138 } 154 139 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 183 140 /** @} 184 141 */
Note:
See TracChangeset
for help on using the changeset viewer.