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

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


Ignore:
Timestamp:
2011-05-08T20:43:00Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
7e7b791
Parents:
511cfc8
Message:

Doxygen and other minor fixes (no functional change)

File:
1 edited

Legend:

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

    r511cfc8 r23f40280  
    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.