Changeset 478e243 in mainline for uspace/drv/bus/usb/ehci/utils/malloc32.h
- Timestamp:
- 2014-01-22T00:00:18Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 64c96b9
- Parents:
- bdddc9d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/utils/malloc32.h
rbdddc9d r478e243 36 36 37 37 #include <as.h> 38 #include <ddi.h> 38 39 #include <errno.h> 39 40 #include <stdlib.h> … … 44 45 * buffers do not have to be aligned. 45 46 */ 46 #define EHCI_ALIGN 32 47 #define EHCI_ALIGN 32 48 49 #define EHCI_REQUIRED_PAGE_SIZE 4096 47 50 48 51 /** Get physical address translation … … 76 79 static inline void free32(void *addr) 77 80 { free(addr); } 81 82 /** Create 4KB page mapping 83 * 84 * @return Address of the mapped page, NULL on failure. 85 */ 86 static inline void *get_page(void) 87 { 88 uintptr_t phys; 89 void *address; 90 91 const int ret = dmamem_map_anonymous(EHCI_REQUIRED_PAGE_SIZE, 92 DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys, 93 &address); 94 95 return ((ret == EOK) ? address : NULL); 96 } 97 98 static inline void return_page(void *page) 99 { 100 dmamem_unmap_anonymous(page); 101 } 78 102 #endif 79 103 /**
Note:
See TracChangeset
for help on using the changeset viewer.