Changeset 001b152 in mainline
- Timestamp:
- 2011-03-23T23:04:22Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 30718cc2
- Parents:
- 05ead5c
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/Makefile
r05ead5c r001b152 40 40 root_hub.c \ 41 41 hw_struct/transfer_descriptor.c \ 42 utils/slab.c \ 42 43 pci.c \ 43 44 batch.c -
uspace/drv/uhci-hcd/hc.c
r05ead5c r001b152 223 223 ret = instance ? EOK : ENOMEM; 224 224 CHECK_RET_DEST_CMDS_RETURN(ret, "Failed to get frame list page.\n"); 225 usb_log_debug("Initialized frame list .\n");225 usb_log_debug("Initialized frame list at %p.\n", instance->frame_list); 226 226 227 227 /* Set all frames to point to the first queue head */ -
uspace/drv/uhci-hcd/transfer_list.c
r05ead5c r001b152 58 58 } 59 59 instance->queue_head_pa = addr_to_phys(instance->queue_head); 60 usb_log_debug2("Transfer list %s setup with QH: %p(%p).\n", 61 name, instance->queue_head, instance->queue_head_pa); 60 62 61 63 qh_init(instance->queue_head); … … 118 120 qh_set_next_qh(last_qh, pa); 119 121 122 asm volatile ("": : :"memory"); 123 // asm volatile("clflush (%0)": : "r"(last_qh)); 124 120 125 /* Add to the driver list */ 121 126 list_append(&batch->link, &instance->batch_list); … … 159 164 fibril_mutex_unlock(&instance->guard); 160 165 166 async_usleep(1000); 161 167 while (!list_empty(&done)) { 162 168 link_t *item = done.next; … … 212 218 == addr_to_phys(batch_qh(batch))); 213 219 instance->queue_head->next = batch_qh(batch)->next; 220 // asm volatile("clflush (%0)" : : "r"(instance->queue_head)); 214 221 qpos = "FIRST"; 215 222 } else { … … 220 227 == addr_to_phys(batch_qh(batch))); 221 228 batch_qh(prev)->next = batch_qh(batch)->next; 229 // asm volatile("clflush (%0)" : : "r"(batch_qh(prev))); 222 230 qpos = "NOT FIRST"; 223 231 } 232 asm volatile ("": : :"memory"); 224 233 /* Remove from the batch list */ 225 234 list_remove(&batch->link); -
uspace/drv/uhci-hcd/utils/malloc32.h
r05ead5c r001b152 40 40 #include <as.h> 41 41 42 #include "slab.h" 43 42 44 #define UHCI_STRCUTURES_ALIGNMENT 16 43 45 #define UHCI_REQUIRED_PAGE_SIZE 4096 46 44 47 45 48 /** Get physical address translation … … 54 57 55 58 uintptr_t result; 56 int ret = as_get_physical_mapping(addr, &result); 59 const int ret = as_get_physical_mapping(addr, &result); 60 assert(ret == EOK); 57 61 58 62 if (ret != EOK) … … 66 70 * @return Address of the alligned and big enough memory place, NULL on failure. 67 71 */ 68 static inline void * malloc32(size_t size) 69 { return memalign(UHCI_STRCUTURES_ALIGNMENT, size); } 72 static inline void * malloc32(size_t size) { 73 if (size <= SLAB_ELEMENT_SIZE) 74 return slab_malloc_g(); 75 assert(false); 76 return memalign(UHCI_STRCUTURES_ALIGNMENT, size); 77 } 70 78 /*----------------------------------------------------------------------------*/ 71 79 /** Physical mallocator simulator … … 73 81 * @param[in] addr Address of the place allocated by malloc32 74 82 */ 75 static inline void free32(void *addr) 76 { if (addr) free(addr); } 83 static inline void free32(void *addr) { 84 if (!addr) 85 return; 86 if (slab_in_range_g(addr)) 87 return slab_free_g(addr); 88 free(addr); 89 } 77 90 /*----------------------------------------------------------------------------*/ 78 91 /** Create 4KB page mapping … … 82 95 static inline void * get_page(void) 83 96 { 84 void * 85 assert(free_address); 97 void *free_address = as_get_mappable_page(UHCI_REQUIRED_PAGE_SIZE); 98 assert(free_address); /* TODO: remove this assert */ 86 99 if (free_address == 0) 87 100 return NULL; 88 void* ret = 89 as_area_create(free_address, UHCI_REQUIRED_PAGE_SIZE, 101 void *ret = as_area_create(free_address, UHCI_REQUIRED_PAGE_SIZE, 90 102 AS_AREA_READ | AS_AREA_WRITE); 91 103 if (ret != free_address)
Note:
See TracChangeset
for help on using the changeset viewer.