Changeset 113aef8 in mainline
- 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
- Location:
- uspace/drv/uhci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/uhci_struct/transfer_descriptor.c
r245b56b5 r113aef8 10 10 0 | LINK_POINTER_TERMINATE_FLAG; 11 11 12 uhci_print_verbose("Creating link field: %x.\n", instance->next);13 12 14 13 assert(size < 1024); … … 16 15 | ((error_count & TD_STATUS_ERROR_COUNT_MASK) << TD_STATUS_ERROR_COUNT_POS) 17 16 | TD_STATUS_ERROR_ACTIVE; 18 19 uhci_print_verbose("Creating status field: %x.\n", instance->status);20 17 21 18 instance->device = 0 … … 25 22 | ((pid & TD_DEVICE_PID_MASK) << TD_DEVICE_PID_POS); 26 23 27 uhci_print_verbose("Creating device field: %x.\n", instance->device); 24 instance->buffer_ptr = 0; 25 26 instance->next_va = NULL; 27 instance->callback = NULL; 28 28 29 29 if (size) { 30 30 instance->buffer_ptr = (uintptr_t)addr_to_phys(buffer); 31 32 uhci_print_verbose("Creating buffer field: %p(%p).\n",33 buffer, instance->buffer_ptr);34 35 if (size >= 8) {36 char * buff = buffer;37 38 uhci_print_verbose("Buffer dump(8B): %x %x %x %x %x %x %x %x.\n",39 buff[0], buff[1], buff[2], buff[3], buff[4], buff[5], buff[6], buff[7]);40 }41 } else {42 instance->buffer_ptr = 0;43 31 } 44 32 45 instance->next_va = NULL; 46 instance->callback = NULL; 47 uhci_print_info("Created a new TD.\n"); 33 uhci_print_info("Created TD: %X:%X:%X:%X(%p).\n", 34 instance->next, instance->status, instance->device, 35 instance->buffer_ptr, buffer); 36 37 if (size) { 38 unsigned char * buff = buffer; 39 uhci_print_verbose("TD Buffer dump(%p-%dB): ", buffer, size); 40 unsigned i = 0; 41 /* TODO: Verbose? */ 42 for (; i < size; ++i) { 43 printf((i & 1) ? "%x " : "%x", buff[i]); 44 } 45 printf("\n"); 46 } 48 47 } 49 48 -
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.