Changes in uspace/drv/bus/usb/ohci/utils/malloc32.h [e2718e1:d394f1b8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/utils/malloc32.h
re2718e1 rd394f1b8 41 41 #include <as.h> 42 42 43 /* Generic TDs and EDs require 16byte alignment,44 * Isochronous TD require 32byte alignment,45 * buffers do not have to be aligned.46 */47 #define OHCI_ALIGN 3248 49 43 /** Get physical address translation 50 44 * … … 56 50 uintptr_t result; 57 51 int ret = as_get_physical_mapping(addr, &result); 58 52 59 53 if (ret != EOK) 60 54 return 0; 61 62 return result; 55 return (result | ((uintptr_t)addr & 0xfff)); 63 56 } 64 57 /*----------------------------------------------------------------------------*/ … … 69 62 */ 70 63 static inline void * malloc32(size_t size) 71 { return memalign( OHCI_ALIGN, size); }64 { return memalign(size, size); } 72 65 /*----------------------------------------------------------------------------*/ 73 66 /** Physical mallocator simulator … … 76 69 */ 77 70 static inline void free32(void *addr) 78 { free(addr); }71 { if (addr) free(addr); } 79 72 #endif 80 73 /**
Note:
See TracChangeset
for help on using the changeset viewer.