Ignore:
Timestamp:
2012-08-14T18:16:39Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
669f5cae
Parents:
76d92db1 (diff), 4802dd7 (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.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r76d92db1 rcddcc4a3  
    3535#define DRV_UHCI_UTILS_MALLOC32_H
    3636
     37#include <as.h>
    3738#include <assert.h>
    38 #include <unistd.h>
     39#include <ddi.h>
    3940#include <errno.h>
    4041#include <malloc.h>
    4142#include <mem.h>
    42 #include <as.h>
     43#include <unistd.h>
    4344
    4445#define UHCI_STRCUTURES_ALIGNMENT 16
     
    6364        return result;
    6465}
    65 /*----------------------------------------------------------------------------*/
     66
    6667/** DMA malloc simulator
    6768 *
     
    8586        return memalign(alignment, size);
    8687}
    87 /*----------------------------------------------------------------------------*/
     88
    8889/** DMA malloc simulator
    8990 *
     
    9293static inline void free32(void *addr)
    9394        { free(addr); }
    94 /*----------------------------------------------------------------------------*/
     95
    9596/** Create 4KB page mapping
    9697 *
     
    99100static inline void * get_page(void)
    100101{
    101         void *address = as_area_create(AS_AREA_ANY, UHCI_REQUIRED_PAGE_SIZE,
    102             AS_AREA_READ | AS_AREA_WRITE);
    103         if (address == AS_MAP_FAILED)
    104                 return NULL;
    105        
    106         return address;
     102        void *address, *phys;
     103        const int ret = dmamem_map_anonymous(UHCI_REQUIRED_PAGE_SIZE,
     104            AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &address);
     105        return ret == EOK ? address : NULL;
    107106}
    108 /*----------------------------------------------------------------------------*/
     107
    109108static inline void return_page(void *page)
    110109{
    111         if (page)
    112                 as_area_destroy(page);
     110        dmamem_unmap_anonymous(page);
    113111}
    114112
Note: See TracChangeset for help on using the changeset viewer.