Ignore:
File:
1 edited

Legend:

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

    re3122b0 rfbcdeb8  
    3535#define DRV_UHCI_UTILS_MALLOC32_H
    3636
    37 #include <as.h>
    3837#include <assert.h>
    39 #include <ddi.h>
    4038#include <errno.h>
    4139#include <malloc.h>
    4240#include <mem.h>
    43 #include <unistd.h>
     41#include <as.h>
    4442
    4543#define UHCI_STRCUTURES_ALIGNMENT 16
     
    6462        return result;
    6563}
    66 
     64/*----------------------------------------------------------------------------*/
    6765/** DMA malloc simulator
    6866 *
     
    8684        return memalign(alignment, size);
    8785}
    88 
     86/*----------------------------------------------------------------------------*/
    8987/** DMA malloc simulator
    9088 *
     
    9391static inline void free32(void *addr)
    9492        { free(addr); }
    95 
     93/*----------------------------------------------------------------------------*/
    9694/** Create 4KB page mapping
    9795 *
     
    10098static inline void * get_page(void)
    10199{
    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;
     100        void *address = as_area_create((void *) -1, UHCI_REQUIRED_PAGE_SIZE,
     101            AS_AREA_READ | AS_AREA_WRITE);
     102        if (address == (void *) -1)
     103                return NULL;
     104       
     105        return address;
    106106}
    107 
     107/*----------------------------------------------------------------------------*/
    108108static inline void return_page(void *page)
    109109{
    110         dmamem_unmap_anonymous(page);
     110        if (page)
     111                as_area_destroy(page);
    111112}
    112113
Note: See TracChangeset for help on using the changeset viewer.