Changes in uspace/drv/bus/usb/uhci/utils/malloc32.h [8064c2f6:bf9cb2f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/utils/malloc32.h
r8064c2f6 rbf9cb2f 36 36 37 37 #include <as.h> 38 #include <assert.h> 38 39 #include <ddi.h> 39 40 #include <errno.h> 40 41 #include <malloc.h> 41 #include <sys/types.h> 42 #include <mem.h> 43 #include <unistd.h> 42 44 43 #define UHCI_STR UCTURES_ALIGNMENT 1645 #define UHCI_STRCUTURES_ALIGNMENT 16 44 46 #define UHCI_REQUIRED_PAGE_SIZE 4096 45 47 … … 54 56 if (addr == NULL) 55 57 return 0; 56 58 57 59 uintptr_t result; 58 60 const int ret = as_get_physical_mapping(addr, &result); 59 61 if (ret != EOK) 60 62 return 0; 61 63 62 64 return result; 63 65 } … … 79 81 /* Calculate alignment to make sure the block won't cross page 80 82 * boundary */ 81 size_t alignment = UHCI_STR UCTURES_ALIGNMENT;83 size_t alignment = UHCI_STRCUTURES_ALIGNMENT; 82 84 while (alignment < size) 83 85 alignment *= 2; … … 101 103 { 102 104 uintptr_t phys; 103 void *address ;104 105 void *address = AS_AREA_ANY; 106 105 107 const int ret = dmamem_map_anonymous(UHCI_REQUIRED_PAGE_SIZE, 106 108 DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys, 107 109 &address); 108 110 109 111 return ((ret == EOK) ? address : NULL); 110 112 }
Note:
See TracChangeset
for help on using the changeset viewer.