Changes in uspace/drv/bus/usb/uhci/utils/malloc32.h [e3122b0:fbcdeb8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/utils/malloc32.h
re3122b0 rfbcdeb8 35 35 #define DRV_UHCI_UTILS_MALLOC32_H 36 36 37 #include <as.h>38 37 #include <assert.h> 39 #include <ddi.h>40 38 #include <errno.h> 41 39 #include <malloc.h> 42 40 #include <mem.h> 43 #include < unistd.h>41 #include <as.h> 44 42 45 43 #define UHCI_STRCUTURES_ALIGNMENT 16 … … 64 62 return result; 65 63 } 66 64 /*----------------------------------------------------------------------------*/ 67 65 /** DMA malloc simulator 68 66 * … … 86 84 return memalign(alignment, size); 87 85 } 88 86 /*----------------------------------------------------------------------------*/ 89 87 /** DMA malloc simulator 90 88 * … … 93 91 static inline void free32(void *addr) 94 92 { free(addr); } 95 93 /*----------------------------------------------------------------------------*/ 96 94 /** Create 4KB page mapping 97 95 * … … 100 98 static inline void * get_page(void) 101 99 { 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; 106 106 } 107 107 /*----------------------------------------------------------------------------*/ 108 108 static inline void return_page(void *page) 109 109 { 110 dmamem_unmap_anonymous(page); 110 if (page) 111 as_area_destroy(page); 111 112 } 112 113
Note:
See TracChangeset
for help on using the changeset viewer.