Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/utils/malloc32.h

    re2718e1 rd394f1b8  
    4141#include <as.h>
    4242
    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 
    4943/** Get physical address translation
    5044 *
     
    5650        uintptr_t result;
    5751        int ret = as_get_physical_mapping(addr, &result);
    58        
     52
    5953        if (ret != EOK)
    6054                return 0;
    61        
    62         return result;
     55        return (result | ((uintptr_t)addr & 0xfff));
    6356}
    6457/*----------------------------------------------------------------------------*/
     
    6962 */
    7063static inline void * malloc32(size_t size)
    71         { return memalign(OHCI_ALIGN, size); }
     64        { return memalign(size, size); }
    7265/*----------------------------------------------------------------------------*/
    7366/** Physical mallocator simulator
     
    7669 */
    7770static inline void free32(void *addr)
    78         { free(addr); }
     71        { if (addr) free(addr); }
    7972#endif
    8073/**
Note: See TracChangeset for help on using the changeset viewer.