Changeset 4fe3b6d in mainline for uspace/drv/ohci/utils/malloc32.h
- Timestamp:
- 2011-05-20T11:07:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8bb61e6
- Parents:
- 3476be8 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/utils/malloc32.h
r3476be8 r4fe3b6d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbohci 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI driver32 * @brief OHCI driver 33 33 */ 34 #ifndef DRV_ UHCI_TRANSLATOR_H35 #define DRV_ UHCI_TRANSLATOR_H34 #ifndef DRV_OHCI_UTILS_MALLOC32_H 35 #define DRV_OHCI_UTILS_MALLOC32_H 36 36 37 37 #include <assert.h> … … 40 40 #include <mem.h> 41 41 #include <as.h> 42 43 #define UHCI_REQUIRED_PAGE_SIZE 409644 42 45 43 /** Get physical address translation … … 61 59 * 62 60 * @param[in] size Size of the required memory space 63 * @return Address of the al ligned and big enough memory place, NULL on failure.61 * @return Address of the aligned and big enough memory place, NULL on failure. 64 62 */ 65 63 static inline void * malloc32(size_t size) … … 72 70 static inline void free32(void *addr) 73 71 { if (addr) free(addr); } 74 /*----------------------------------------------------------------------------*/75 /** Create 4KB page mapping76 *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 93 72 #endif 94 73 /**
Note:
See TracChangeset
for help on using the changeset viewer.