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