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