Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset c101dc0 in mainline


Ignore:
Timestamp:
2014-02-03T08:01:45Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
a17cced
Parents:
0dd022ec
Message:

Implement dmamem_unmap_anonymous().

Location:
kernel/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/as.h

    r0dd022ec rc101dc0  
    169169                uintptr_t base;
    170170                size_t frames;
     171                bool anonymous;
    171172        };
    172173} mem_backend_data_t;
  • kernel/generic/src/ddi/ddi.c

    r0dd022ec rc101dc0  
    121121        backend_data.base = phys;
    122122        backend_data.frames = pages;
     123        backend_data.anonymous = false;
    123124       
    124125        /*
     
    336337        backend_data.base = *phys;
    337338        backend_data.frames = frames;
     339        backend_data.anonymous = true;
    338340       
    339341        if (!as_area_create(TASK->as, map_flags, size,
     
    354356NO_TRACE static int dmamem_unmap_anonymous(uintptr_t virt)
    355357{
    356         // TODO: implement unlocking & unmap
    357         return EOK;
     358        return as_area_destroy(TASK->as, virt);
    358359}
    359360
  • kernel/generic/src/mm/backend_phys.c

    r0dd022ec rc101dc0  
    9292void phys_destroy(as_area_t *area)
    9393{
    94         /* Nothing to do. */
     94        mem_backend_data_t *data = &area->backend_data;
     95
     96        if (data->anonymous)
     97                frame_free_noreserve(data->base, data->frames);
    9598}
    9699
Note: See TracChangeset for help on using the changeset viewer.