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

Changeset e3122b0 in mainline


Ignore:
Timestamp:
2012-07-20T14:33:35Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
3795f9c
Parents:
8fccd42
Message:

uhci: Use dmamem_map_anonymous instead of as area tricks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/utils/malloc32.h

    r8fccd42 re3122b0  
    3535#define DRV_UHCI_UTILS_MALLOC32_H
    3636
     37#include <as.h>
    3738#include <assert.h>
    38 #include <unistd.h>
     39#include <ddi.h>
    3940#include <errno.h>
    4041#include <malloc.h>
    4142#include <mem.h>
    42 #include <as.h>
     43#include <unistd.h>
    4344
    4445#define UHCI_STRCUTURES_ALIGNMENT 16
     
    99100static inline void * get_page(void)
    100101{
    101         void *address = as_area_create(AS_AREA_ANY, UHCI_REQUIRED_PAGE_SIZE,
    102             AS_AREA_READ | AS_AREA_WRITE);
    103         if (address == AS_MAP_FAILED)
    104                 return NULL;
    105        
    106         return address;
     102        void *address, *phys;
     103        const int ret = dmamem_map_anonymous(UHCI_REQUIRED_PAGE_SIZE,
     104            AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &address);
     105        return ret == EOK ? address : NULL;
    107106}
    108107
    109108static inline void return_page(void *page)
    110109{
    111         if (page)
    112                 as_area_destroy(page);
     110        dmamem_unmap_anonymous(page);
    113111}
    114112
Note: See TracChangeset for help on using the changeset viewer.