Changes in uspace/drv/ohci/utils/malloc32.h [23f40280:fd153d3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/utils/malloc32.h
r23f40280 rfd153d3 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbohci28 /** @addtogroup usb 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief OHCI driver32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_ OHCI_UTILS_MALLOC32_H35 #define DRV_ OHCI_UTILS_MALLOC32_H34 #ifndef DRV_UHCI_TRANSLATOR_H 35 #define DRV_UHCI_TRANSLATOR_H 36 36 37 37 #include <assert.h> … … 40 40 #include <mem.h> 41 41 #include <as.h> 42 43 #define UHCI_REQUIRED_PAGE_SIZE 4096 42 44 43 45 /** Get physical address translation … … 59 61 * 60 62 * @param[in] size Size of the required memory space 61 * @return Address of the al igned and big enough memory place, NULL on failure.63 * @return Address of the alligned and big enough memory place, NULL on failure. 62 64 */ 63 65 static inline void * malloc32(size_t size) … … 70 72 static inline void free32(void *addr) 71 73 { if (addr) free(addr); } 74 /*----------------------------------------------------------------------------*/ 75 /** Create 4KB page mapping 76 * 77 * @return Address of the mapped page, NULL on failure. 78 */ 79 static inline void * get_page(void) 80 { 81 void * free_address = as_get_mappable_page(UHCI_REQUIRED_PAGE_SIZE); 82 assert(free_address); 83 if (free_address == 0) 84 return NULL; 85 void* ret = 86 as_area_create(free_address, UHCI_REQUIRED_PAGE_SIZE, 87 AS_AREA_READ | AS_AREA_WRITE); 88 if (ret != free_address) 89 return NULL; 90 return ret; 91 } 92 72 93 #endif 73 94 /**
Note:
See TracChangeset
for help on using the changeset viewer.