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