Changeset d09f3720 in mainline for uspace/drv/ohci/utils/malloc32.h


Ignore:
Timestamp:
2011-05-19T15:20:48Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4939490
Parents:
df44fa2 (diff), 7941bd6 (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:

Development changes.

File:
1 edited

Legend:

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

    rdf44fa2 rd09f3720  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup usb
     28/** @addtogroup drvusbohci
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief UHCI driver
     32 * @brief OHCI driver
    3333 */
    34 #ifndef DRV_UHCI_TRANSLATOR_H
    35 #define DRV_UHCI_TRANSLATOR_H
     34#ifndef DRV_OHCI_UTILS_MALLOC32_H
     35#define DRV_OHCI_UTILS_MALLOC32_H
    3636
    3737#include <assert.h>
     
    4040#include <mem.h>
    4141#include <as.h>
    42 
    43 #define UHCI_REQUIRED_PAGE_SIZE 4096
    4442
    4543/** Get physical address translation
     
    6159 *
    6260 * @param[in] size Size of the required memory space
    63  * @return Address of the alligned and big enough memory place, NULL on failure.
     61 * @return Address of the aligned and big enough memory place, NULL on failure.
    6462 */
    6563static inline void * malloc32(size_t size)
     
    7270static inline void free32(void *addr)
    7371        { if (addr) free(addr); }
    74 /*----------------------------------------------------------------------------*/
    75 /** Create 4KB page mapping
    76  *
    77  * @return Address of the mapped page, NULL on failure.
    78  */
    79 static inline void * get_page(void)
    80 {
    81         void * free_address = as_get_mappable_page(UHCI_REQUIRED_PAGE_SIZE);
    82         assert(free_address);
    83         if (free_address == 0)
    84                 return NULL;
    85         void* ret =
    86           as_area_create(free_address, UHCI_REQUIRED_PAGE_SIZE,
    87                   AS_AREA_READ | AS_AREA_WRITE);
    88         if (ret != free_address)
    89                 return NULL;
    90         return ret;
    91 }
    92 
    9372#endif
    9473/**
Note: See TracChangeset for help on using the changeset viewer.