Ignore:
File:
1 edited

Legend:

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

    r8064c2f6 rc67dbd6  
    3636
    3737#include <as.h>
     38#include <assert.h>
    3839#include <ddi.h>
    3940#include <errno.h>
    4041#include <malloc.h>
    41 #include <sys/types.h>
     42#include <mem.h>
     43#include <unistd.h>
    4244
    43 #define UHCI_STRUCTURES_ALIGNMENT 16
     45#define UHCI_STRCUTURES_ALIGNMENT 16
    4446#define UHCI_REQUIRED_PAGE_SIZE 4096
    4547
     
    5456        if (addr == NULL)
    5557                return 0;
    56 
     58       
    5759        uintptr_t result;
    5860        const int ret = as_get_physical_mapping(addr, &result);
    5961        if (ret != EOK)
    6062                return 0;
    61 
     63       
    6264        return result;
    6365}
     
    7981        /* Calculate alignment to make sure the block won't cross page
    8082         * boundary */
    81         size_t alignment = UHCI_STRUCTURES_ALIGNMENT;
     83        size_t alignment = UHCI_STRCUTURES_ALIGNMENT;
    8284        while (alignment < size)
    8385                alignment *= 2;
     
    102104        uintptr_t phys;
    103105        void *address;
    104 
     106       
    105107        const int ret = dmamem_map_anonymous(UHCI_REQUIRED_PAGE_SIZE,
    106108            DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys,
    107109            &address);
    108 
     110       
    109111        return ((ret == EOK) ? address : NULL);
    110112}
Note: See TracChangeset for help on using the changeset viewer.