Changeset 00aece0 in mainline for uspace/drv/bus/usb/ohci/utils/malloc32.h
- Timestamp:
- 2012-02-18T16:47:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4449c6c
- Parents:
- bd5f3b7 (diff), f943dd3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/utils/malloc32.h
rbd5f3b7 r00aece0 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 32 48 43 49 /** Get physical address translation 44 50 * … … 46 52 * @return Physical address if exists, NULL otherwise. 47 53 */ 48 static inline uintptr_t addr_to_phys( void *addr)54 static inline uintptr_t addr_to_phys(const void *addr) 49 55 { 50 56 uintptr_t result; 51 57 int ret = as_get_physical_mapping(addr, &result); 52 58 53 59 if (ret != EOK) 54 60 return 0; 55 return (result | ((uintptr_t)addr & 0xfff)); 61 62 return result; 56 63 } 57 64 /*----------------------------------------------------------------------------*/ … … 62 69 */ 63 70 static inline void * malloc32(size_t size) 64 { return memalign( size, size); }71 { return memalign(OHCI_ALIGN, size); } 65 72 /*----------------------------------------------------------------------------*/ 66 73 /** Physical mallocator simulator … … 69 76 */ 70 77 static inline void free32(void *addr) 71 { if (addr)free(addr); }78 { free(addr); } 72 79 #endif 73 80 /**
Note:
See TracChangeset
for help on using the changeset viewer.