Changes in kernel/generic/src/mm/as.c [59fb782:908bb96] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r59fb782 r908bb96 544 544 mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound) 545 545 { 546 if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE))546 if ((*base != (uintptr_t) -1) && ((*base % PAGE_SIZE) != 0)) 547 547 return NULL; 548 548 … … 688 688 int as_area_resize(as_t *as, uintptr_t address, size_t size, unsigned int flags) 689 689 { 690 if (!IS_ALIGNED(address, PAGE_SIZE))691 return EINVAL;692 693 690 mutex_lock(&as->lock); 694 691 … … 1353 1350 * Interrupts are assumed disabled. 1354 1351 * 1355 * @param address Faulting address.1356 * @param access 1357 * 1358 * @param istate 1352 * @param page Faulting page. 1353 * @param access Access mode that caused the page fault (i.e. 1354 * read/write/exec). 1355 * @param istate Pointer to the interrupted state. 1359 1356 * 1360 1357 * @return AS_PF_FAULT on page fault. … … 1364 1361 * 1365 1362 */ 1366 int as_page_fault(uintptr_t address, pf_access_t access, istate_t *istate) 1367 { 1368 uintptr_t page = ALIGN_DOWN(address, PAGE_SIZE); 1363 int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate) 1364 { 1369 1365 int rc = AS_PF_FAULT; 1370 1366 … … 1456 1452 task_kill_self(true); 1457 1453 } else { 1458 fault_if_from_uspace(istate, "Page fault: %p.", (void *) address);1459 panic_memtrap(istate, access, address, NULL);1454 fault_if_from_uspace(istate, "Page fault: %p.", (void *) page); 1455 panic_memtrap(istate, access, page, NULL); 1460 1456 } 1461 1457 … … 1683 1679 { 1684 1680 ASSERT(mutex_locked(&area->lock)); 1685 ASSERT( IS_ALIGNED(page, PAGE_SIZE));1681 ASSERT(page == ALIGN_DOWN(page, PAGE_SIZE)); 1686 1682 ASSERT(count); 1687 1683 … … 1967 1963 { 1968 1964 ASSERT(mutex_locked(&area->lock)); 1969 ASSERT( IS_ALIGNED(page, PAGE_SIZE));1965 ASSERT(page == ALIGN_DOWN(page, PAGE_SIZE)); 1970 1966 ASSERT(count); 1971 1967 … … 2144 2140 { 2145 2141 uintptr_t virt = base; 2146 as_area_t *area = as_area_create(AS, flags , size,2142 as_area_t *area = as_area_create(AS, flags | AS_AREA_CACHEABLE, size, 2147 2143 AS_AREA_ATTR_NONE, &anon_backend, NULL, &virt, bound); 2148 2144 if (area == NULL)
Note:
See TracChangeset
for help on using the changeset viewer.