Ignore:
File:
1 edited

Legend:

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

    re3122b0 rd4d74dc  
    3535#define DRV_UHCI_UTILS_MALLOC32_H
    3636
    37 #include <as.h>
    3837#include <assert.h>
    39 #include <ddi.h>
     38#include <unistd.h>
    4039#include <errno.h>
    4140#include <malloc.h>
    4241#include <mem.h>
    43 #include <unistd.h>
     42#include <as.h>
    4443
    4544#define UHCI_STRCUTURES_ALIGNMENT 16
     
    6463        return result;
    6564}
    66 
     65/*----------------------------------------------------------------------------*/
    6766/** DMA malloc simulator
    6867 *
     
    8685        return memalign(alignment, size);
    8786}
    88 
     87/*----------------------------------------------------------------------------*/
    8988/** DMA malloc simulator
    9089 *
     
    9392static inline void free32(void *addr)
    9493        { free(addr); }
    95 
     94/*----------------------------------------------------------------------------*/
    9695/** Create 4KB page mapping
    9796 *
     
    10099static inline void * get_page(void)
    101100{
    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;
     101        void *address = as_area_create((void *) -1, UHCI_REQUIRED_PAGE_SIZE,
     102            AS_AREA_READ | AS_AREA_WRITE);
     103        if (address == (void *) -1)
     104                return NULL;
     105       
     106        return address;
    106107}
    107 
     108/*----------------------------------------------------------------------------*/
    108109static inline void return_page(void *page)
    109110{
    110         dmamem_unmap_anonymous(page);
     111        if (page)
     112                as_area_destroy(page);
    111113}
    112114
Note: See TracChangeset for help on using the changeset viewer.