Changeset bf9cb2f in mainline for kernel/generic/src


Ignore:
Timestamp:
2014-05-19T01:01:27Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10ef47ba
Parents:
527f1ca
Message:

complete the desired API semantics of physmem_map() and dmamem_map_anonymous() to be compatible with as_area_create()
(the user is allowed to request a specific virtual memory base address, the kernel uses an available base address if AS_AREA_ANY is used)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ddi/ddi.c

    r527f1ca rbf9cb2f  
    229229    void *virt_ptr, uintptr_t bound)
    230230{
    231         uintptr_t virt = (uintptr_t) -1;
    232         int rc = physmem_map(ALIGN_DOWN(phys, FRAME_SIZE), pages, flags,
    233             &virt, bound);
     231        uintptr_t virt;
     232        int rc = copy_from_uspace(&virt, virt_ptr, sizeof(virt));
     233        if (rc != EOK)
     234                return rc;
     235       
     236        rc = physmem_map(ALIGN_DOWN(phys, FRAME_SIZE), pages, flags, &virt,
     237            bound);
    234238        if (rc != EOK)
    235239                return rc;
     
    390394                        return rc;
    391395               
     396                uintptr_t virt;
     397                rc = copy_from_uspace(&virt, virt_ptr, sizeof(virt));
     398                if (rc != EOK)
     399                        return rc;
     400               
    392401                uintptr_t phys;
    393                 uintptr_t virt = (uintptr_t) -1;
    394402                rc = dmamem_map_anonymous(size, constraint, map_flags, flags,
    395403                    &phys, &virt, bound);
Note: See TracChangeset for help on using the changeset viewer.