Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset f9599b9c in mainline


Ignore:
Timestamp:
2015-06-29T04:46:48Z (6 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
a6abe20
Parents:
ac96b11
Message:

ehci: Use page size allocations to make sure we have non-cacheable access to memory

Need DMA allocator.

File:
1 edited

Legend:

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

    rac96b11 rf9599b9c  
    6565}
    6666
    67 /** Physical mallocator simulator
    68  *
    69  * @param[in] size Size of the required memory space
    70  * @return Address of the aligned and big enough memory place, NULL on failure.
    71  */
    72 static inline void * malloc32(size_t size)
    73         { return memalign(EHCI_ALIGN, size); }
    74 
    75 /** Physical mallocator simulator
    76  *
    77  * @param[in] addr Address of the place allocated by malloc32
    78  */
    79 static inline void free32(void *addr)
    80         { free(addr); }
    81 
    8267/** Create 4KB page mapping
    8368 *
     
    10085        dmamem_unmap_anonymous(page);
    10186}
     87
     88/** Physical mallocator simulator
     89 *
     90 * @param[in] size Size of the required memory space
     91 * @return Address of the aligned and big enough memory place, NULL on failure.
     92 */
     93static inline void * malloc32(size_t size)
     94{
     95        assert(size < PAGE_SIZE);
     96        return get_page();
     97}
     98
     99/** Physical mallocator simulator
     100 *
     101 * @param[in] addr Address of the place allocated by malloc32
     102 */
     103static inline void free32(void *addr)
     104{
     105        return_page(addr);
     106}
     107
    102108#endif
    103109/**
Note: See TracChangeset for help on using the changeset viewer.