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