Changeset de0e6b3 in mainline
- Timestamp:
- 2011-01-28T12:43:07Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d93ff502
- Parents:
- 45c4f5a
- Location:
- uspace/drv/uhci
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/callback.c
r45c4f5a rde0e6b3 9 9 assert(instance); 10 10 assert(func_in == NULL || func_out == NULL); 11 instance->new_buffer = trans_malloc(size);11 instance->new_buffer = malloc32(size); 12 12 if (!instance->new_buffer) { 13 13 uhci_print_error("Failed to allocate device acessible buffer.\n"); … … 34 34 if (instance->new_buffer) { 35 35 memcpy(instance->new_buffer, instance->old_buffer, instance->buffer_size); 36 trans_free(instance->new_buffer);36 free32(instance->new_buffer); 37 37 instance->new_buffer = NULL; 38 38 } -
uspace/drv/uhci/callback.h
r45c4f5a rde0e6b3 39 39 40 40 #include "debug.h" 41 #include " translating_malloc.h"41 #include "utils/malloc32.h" 42 42 43 43 typedef struct callback … … 80 80 assert(instance); 81 81 if (instance->new_buffer) 82 trans_free(instance->new_buffer);82 free32(instance->new_buffer); 83 83 } 84 84 -
uspace/drv/uhci/transfer_list.c
r45c4f5a rde0e6b3 8 8 instance->first = NULL; 9 9 instance->last = NULL; 10 instance->queue_head = trans_malloc(sizeof(queue_head_t));10 instance->queue_head = malloc32(sizeof(queue_head_t)); 11 11 if (!instance->queue_head) { 12 12 uhci_print_error("Failed to allocate queue head.\n"); -
uspace/drv/uhci/transfer_list.h
r45c4f5a rde0e6b3 36 36 37 37 #include "debug.h" 38 #include "translating_malloc.h"39 38 #include "uhci_struct/queue_head.h" 40 39 #include "uhci_struct/transfer_descriptor.h" 40 #include "utils/malloc32.h" 41 41 42 42 typedef struct transfer_list … … 54 54 assert(instance); 55 55 if (instance->queue_head) 56 trans_free(instance->queue_head);56 free32(instance->queue_head); 57 57 } 58 58 -
uspace/drv/uhci/uhci.c
r45c4f5a rde0e6b3 3 3 #include <usb/usb.h> 4 4 5 #include " translating_malloc.h"5 #include "utils/malloc32.h" 6 6 7 7 #include "debug.h" … … 61 61 62 62 instance->frame_list = 63 trans_malloc(sizeof(link_pointer_t) * UHCI_FRAME_LIST_COUNT);63 malloc32(sizeof(link_pointer_t) * UHCI_FRAME_LIST_COUNT); 64 64 if (instance->frame_list == NULL) { 65 65 uhci_print_error("Failed to allocate frame list pointer.\n"); … … 200 200 callback_dispose(job); \ 201 201 } \ 202 if (td) { trans_free(td); } \202 if (td) { free32(td); } \ 203 203 return ret; \ 204 204 } else (void) 0 … … 243 243 uhci_print_verbose("Cleaning fibril found inactive transport."); 244 244 instance->transfers[i].first = transfer->next_va; 245 transfer_descriptor_fini(transfer); 246 trans_free(transfer); 245 transfer_descriptor_dispose(transfer); 247 246 } 248 247 if (!instance->transfers[i].first) -
uspace/drv/uhci/uhci_struct/transfer_descriptor.h
r45c4f5a rde0e6b3 38 38 #include <usb/usb.h> 39 39 40 #include " translating_malloc.h"40 #include "utils/malloc32.h" 41 41 #include "callback.h" 42 42 #include "link_pointer.h" … … 104 104 { 105 105 transfer_descriptor_t * instance = 106 trans_malloc(sizeof(transfer_descriptor_t));106 malloc32(sizeof(transfer_descriptor_t)); 107 107 108 108 if (instance) … … 118 118 assert(instance); 119 119 transfer_descriptor_fini(instance); 120 trans_free(instance);120 free32(instance); 121 121 } 122 122 -
uspace/drv/uhci/utils/malloc32.h
r45c4f5a rde0e6b3 35 35 #define DRV_UHCI_TRANSLATOR_H 36 36 37 #include < malloc.h>37 #include <usb/usbmem.h> 38 38 39 static inline void * addr_to_phys( void *addr)40 { return addr; }39 static inline void * addr_to_phys(void *addr) 40 { return mman_getPA(addr); } 41 41 42 static inline void * addr_to_virt( void *addr ) 43 { return addr; } 42 static inline void * malloc32(size_t size) 43 /* TODO: tis is ugly */ 44 { return mman_malloc(size, 128, 0xffffffff); } 44 45 45 static inline void * trans_malloc( size_t size ) 46 { return malloc( size ); } 47 48 static inline void trans_free( void * addr ) 49 { free( addr ); } 46 static inline void free32(void * addr) 47 { mman_free(addr); } 50 48 51 49 #endif
Note:
See TracChangeset
for help on using the changeset viewer.