Ignore:
File:
1 edited

Legend:

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

    r59fb782 r908bb96  
    544544    mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound)
    545545{
    546         if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE))
     546        if ((*base != (uintptr_t) -1) && ((*base % PAGE_SIZE) != 0))
    547547                return NULL;
    548548       
     
    688688int as_area_resize(as_t *as, uintptr_t address, size_t size, unsigned int flags)
    689689{
    690         if (!IS_ALIGNED(address, PAGE_SIZE))
    691                 return EINVAL;
    692 
    693690        mutex_lock(&as->lock);
    694691       
     
    13531350 * Interrupts are assumed disabled.
    13541351 *
    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.
     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.
    13591356 *
    13601357 * @return AS_PF_FAULT on page fault.
     
    13641361 *
    13651362 */
    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);
     1363int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate)
     1364{
    13691365        int rc = AS_PF_FAULT;
    13701366
     
    14561452                task_kill_self(true);
    14571453        } 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);
    14601456        }
    14611457       
     
    16831679{
    16841680        ASSERT(mutex_locked(&area->lock));
    1685         ASSERT(IS_ALIGNED(page, PAGE_SIZE));
     1681        ASSERT(page == ALIGN_DOWN(page, PAGE_SIZE));
    16861682        ASSERT(count);
    16871683       
     
    19671963{
    19681964        ASSERT(mutex_locked(&area->lock));
    1969         ASSERT(IS_ALIGNED(page, PAGE_SIZE));
     1965        ASSERT(page == ALIGN_DOWN(page, PAGE_SIZE));
    19701966        ASSERT(count);
    19711967       
     
    21442140{
    21452141        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,
    21472143            AS_AREA_ATTR_NONE, &anon_backend, NULL, &virt, bound);
    21482144        if (area == NULL)
Note: See TracChangeset for help on using the changeset viewer.