Changes in kernel/generic/src/mm/as.c [75b139f:315b7e3] in mainline
- File:
-
- 1 edited
-
kernel/generic/src/mm/as.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r75b139f r315b7e3 574 574 * @param backend_data NULL or a pointer to custom backend data. 575 575 * @param base Starting virtual address of the area. 576 * If set to AS_AREA_ANY, a suitable mappable area is 577 * found. 578 * @param bound Lowest address bound if base is set to AS_AREA_ANY. 576 * If set to -1, a suitable mappable area is found. 577 * @param bound Lowest address bound if base is set to -1. 579 578 * Otherwise ignored. 580 579 * … … 586 585 mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound) 587 586 { 588 if ((*base != (uintptr_t) AS_AREA_ANY) && !IS_ALIGNED(*base, PAGE_SIZE))587 if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE)) 589 588 return NULL; 590 589 … … 602 601 mutex_lock(&as->lock); 603 602 604 if (*base == (uintptr_t) AS_AREA_ANY) {603 if (*base == (uintptr_t) -1) { 605 604 *base = as_get_unmapped_area(as, bound, size, guarded); 606 605 if (*base == (uintptr_t) -1) { … … 2183 2182 2184 2183 sysarg_t sys_as_area_create(uintptr_t base, size_t size, unsigned int flags, 2185 uintptr_t bound , int pager)2184 uintptr_t bound) 2186 2185 { 2187 2186 uintptr_t virt = base; 2188 mem_backend_t *backend;2189 mem_backend_data_t backend_data;2190 2191 if (pager == AS_AREA_UNPAGED)2192 backend = &anon_backend;2193 else {2194 backend = &user_backend;2195 backend_data.pager = pager;2196 }2197 2187 as_area_t *area = as_area_create(AS, flags, size, 2198 AS_AREA_ATTR_NONE, backend, &backend_data, &virt, bound);2188 AS_AREA_ATTR_NONE, &anon_backend, NULL, &virt, bound); 2199 2189 if (area == NULL) 2200 return (sysarg_t) AS_MAP_FAILED;2190 return (sysarg_t) -1; 2201 2191 2202 2192 return (sysarg_t) virt;
Note:
See TracChangeset
for help on using the changeset viewer.
