Changeset 06b0211b in mainline for kernel/generic/src/mm/as.c
- Timestamp:
- 2013-04-29T11:29:45Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- aa2b32c
- Parents:
- ba4799a (diff), df956b9b (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
rba4799a r06b0211b 544 544 mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound) 545 545 { 546 if ((*base != (uintptr_t) -1) && ((*base % PAGE_SIZE) != 0))546 if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE)) 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 690 693 mutex_lock(&as->lock); 691 694 … … 1350 1353 * Interrupts are assumed disabled. 1351 1354 * 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.1355 * @param address Faulting address. 1356 * @param access Access mode that caused the page fault (i.e. 1357 * read/write/exec). 1358 * @param istate Pointer to the interrupted state. 1356 1359 * 1357 1360 * @return AS_PF_FAULT on page fault. … … 1361 1364 * 1362 1365 */ 1363 int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate) 1364 { 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); 1365 1369 int rc = AS_PF_FAULT; 1366 1370 … … 1452 1456 task_kill_self(true); 1453 1457 } else { 1454 fault_if_from_uspace(istate, "Page fault: %p.", (void *) page);1455 panic_memtrap(istate, access, page, NULL);1458 fault_if_from_uspace(istate, "Page fault: %p.", (void *) address); 1459 panic_memtrap(istate, access, address, NULL); 1456 1460 } 1457 1461 … … 1679 1683 { 1680 1684 ASSERT(mutex_locked(&area->lock)); 1681 ASSERT( page == ALIGN_DOWN(page, PAGE_SIZE));1685 ASSERT(IS_ALIGNED(page, PAGE_SIZE)); 1682 1686 ASSERT(count); 1683 1687 … … 1963 1967 { 1964 1968 ASSERT(mutex_locked(&area->lock)); 1965 ASSERT( page == ALIGN_DOWN(page, PAGE_SIZE));1969 ASSERT(IS_ALIGNED(page, PAGE_SIZE)); 1966 1970 ASSERT(count); 1967 1971
Note:
See TracChangeset
for help on using the changeset viewer.