Changeset 113aef8 in mainline for uspace/drv/uhci/utils/malloc32.h
- Timestamp:
- 2011-01-29T08:58:46Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d956aa5
- Parents:
- 245b56b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/utils/malloc32.h
r245b56b5 r113aef8 42 42 #include <as.h> 43 43 44 #define UHCI_STRCUTURES_ALIGNMENT 16 45 #define UHCI_REQUIRED_PAGE_SIZE 4096 46 44 47 static inline void * addr_to_phys(void *addr) 45 48 { … … 52 55 53 56 static inline void * malloc32(size_t size) 54 /* TODO: this is ugly */ 55 { return memalign(16, size); } 57 { return memalign(UHCI_STRCUTURES_ALIGNMENT, size); } 56 58 57 59 static inline void * get_page() 58 60 { 59 void * free_address = as_get_mappable_page( 4096);61 void * free_address = as_get_mappable_page(UHCI_REQUIRED_PAGE_SIZE); 60 62 assert(free_address); 61 63 if (free_address == 0) 62 64 return 0; 63 65 void* ret = 64 as_area_create(free_address, 4096, AS_AREA_READ | AS_AREA_WRITE |AS_AREA_CACHEABLE); 66 as_area_create(free_address, UHCI_REQUIRED_PAGE_SIZE, 67 AS_AREA_READ | AS_AREA_WRITE); 65 68 if (ret != free_address) 66 69 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.