Changeset 802898f in mainline for kernel/generic/src/ddi/ddi.c


Ignore:
Timestamp:
2013-09-02T20:14:11Z (11 years ago)
Author:
Dominik Taborsky (AT DOT) <brembyseznamcz>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8c95dff
Parents:
0435fe41 (diff), 61ab4a9 (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.
Message:

mainline update

File:
1 edited

Legend:

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

    r0435fe41 r802898f  
    336336                order = fnzb(pages - 1) + 1;
    337337       
    338         *phys = frame_alloc_noreserve(order, 0);
     338        *phys = frame_alloc_noreserve(order, FRAME_DMA);
    339339        if (*phys == NULL)
    340340                return ENOMEM;
     
    361361NO_TRACE static int dmamem_unmap_anonymous(uintptr_t virt)
    362362{
    363         // TODO: implement unlocking & unmap
    364         return EOK;
     363        // TODO: This is an ugly hack
     364        as_t *as = TASK->as;
     365
     366        mutex_lock(&as->lock);
     367        as_area_t *area = find_locked_area(as, virt);
     368        if (!area) {
     369                mutex_unlock(&as->lock);
     370                return ENOENT;
     371        }
     372        frame_free_noreserve(area->backend_data.base);
     373        area->backend_data.base = 0;
     374        area->backend_data.frames = 0;
     375        mutex_unlock(&area->lock);
     376        mutex_unlock(&as->lock);
     377
     378        return as_area_destroy(as, virt);
    365379}
    366380
Note: See TracChangeset for help on using the changeset viewer.