Changes in / [50cd285:8fcaeed] in mainline
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/proc/thread.h
r50cd285 r8fcaeed 259 259 extern sysarg_t sys_thread_get_id(thread_id_t *); 260 260 extern sysarg_t sys_thread_usleep(uint32_t); 261 extern sysarg_t sys_thread_udelay(uint32_t);262 261 263 262 #endif -
kernel/generic/include/syscall/syscall.h
r50cd285 r8fcaeed 44 44 SYS_THREAD_GET_ID, 45 45 SYS_THREAD_USLEEP, 46 SYS_THREAD_UDELAY,47 46 48 47 SYS_TASK_GET_ID, -
kernel/generic/src/proc/thread.c
r50cd285 r8fcaeed 918 918 } 919 919 920 sysarg_t sys_thread_udelay(uint32_t usec)921 {922 asm_delay_loop(usec * CPU->delay_loop_const);923 return 0;924 }925 926 920 /** @} 927 921 */ -
kernel/generic/src/syscall/syscall.c
r50cd285 r8fcaeed 127 127 (syshandler_t) sys_thread_get_id, 128 128 (syshandler_t) sys_thread_usleep, 129 (syshandler_t) sys_thread_udelay,130 129 131 130 (syshandler_t) sys_task_get_id, -
uspace/drv/ohci/batch.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusb ohci28 /** @addtogroup drvusbuhcihc 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief OHCI driver USB transaction structure32 * @brief UHCI driver USB transaction structure 33 33 */ 34 #ifndef DRV_ OHCI_BATCH_H35 #define DRV_ OHCI_BATCH_H34 #ifndef DRV_UHCI_BATCH_H 35 #define DRV_UHCI_BATCH_H 36 36 37 37 #include <usbhc_iface.h> -
uspace/drv/ohci/endpoint_list.h
r50cd285 r8fcaeed 41 41 #include "utils/malloc32.h" 42 42 43 typedef struct endpoint_list { 43 typedef struct endpoint_list 44 { 44 45 fibril_mutex_t guard; 45 46 ed_t *list_head; -
uspace/drv/ohci/iface.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ -
uspace/drv/ohci/ohci.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ -
uspace/drv/ohci/ohci_regs.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohcihc 29 30 * @{ -
uspace/drv/ohci/pci.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ -
uspace/drv/ohci/root_hub.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ -
uspace/drv/ohci/utils/malloc32.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbohci28 /** @addtogroup usb 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief OHCI driver32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_ OHCI_UTILS_MALLOC32_H35 #define DRV_ OHCI_UTILS_MALLOC32_H34 #ifndef DRV_UHCI_TRANSLATOR_H 35 #define DRV_UHCI_TRANSLATOR_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 4096 42 44 43 45 /** Get physical address translation … … 59 61 * 60 62 * @param[in] size Size of the required memory space 61 * @return Address of the al igned and big enough memory place, NULL on failure.63 * @return Address of the alligned and big enough memory place, NULL on failure. 62 64 */ 63 65 static inline void * malloc32(size_t size) … … 70 72 static inline void free32(void *addr) 71 73 { if (addr) free(addr); } 74 /*----------------------------------------------------------------------------*/ 75 /** Create 4KB page mapping 76 * 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 72 93 #endif 73 94 /** -
uspace/drv/uhci-hcd/batch.c
r50cd285 r8fcaeed 70 70 * @param[in] ep Communication target 71 71 * @param[in] buffer Data source/destination. 72 * @param[in] buffer_size Size of the buffer.72 * @param[in] size Size of the buffer. 73 73 * @param[in] setup_buffer Setup data source (if not NULL) 74 74 * @param[in] setup_size Size of setup_buffer (should be always 8) -
uspace/drv/uhci-hcd/hc.c
r50cd285 r8fcaeed 61 61 * @param[in] instance Memory place to initialize. 62 62 * @param[in] regs Address of I/O control registers. 63 * @param[in] reg_size Size of I/O control registers. 64 * @param[in] interrupts True if hw interrupts should be used. 63 * @param[in] size Size of I/O control registers. 65 64 * @return Error code. 66 65 * @note Should be called only once on any structure. -
uspace/drv/uhci-hcd/hc.h
r50cd285 r8fcaeed 33 33 * @brief UHCI host controller driver structure 34 34 */ 35 #ifndef DRV_UHCI_ HC_H36 #define DRV_UHCI_ HC_H35 #ifndef DRV_UHCI_UHCI_HC_H 36 #define DRV_UHCI_UHCI_HC_H 37 37 38 38 #include <fibril.h> -
uspace/drv/uhci-hcd/hw_struct/link_pointer.h
r50cd285 r8fcaeed 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ HW_STRUCT_LINK_POINTER_H35 #define DRV_UHCI_ HW_STRUCT_LINK_POINTER_H34 #ifndef DRV_UHCI_LINK_POINTER_H 35 #define DRV_UHCI_LINK_POINTER_H 36 36 37 37 /* UHCI link pointer, used by many data structures */ -
uspace/drv/uhci-hcd/hw_struct/queue_head.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drv usbuhcihc28 /** @addtogroup drv usbuhcihc 29 29 * @{ 30 30 */ … … 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ HW_STRUCT_QH_H35 #define DRV_UHCI_ HW_STRUCT_QH_H34 #ifndef DRV_UHCI_QH_H 35 #define DRV_UHCI_QH_H 36 36 #include <assert.h> 37 37 … … 65 65 * 66 66 * @param[in] instance qh_t structure to use. 67 * @param[in] next Address of the next queue.67 * @param[in] pa Physical address of the next queue head. 68 68 * 69 69 * Adds proper flag. If the pointer is NULL, sets next to terminal NULL. … … 81 81 /** Set queue head element pointer 82 82 * 83 * @param[in] instance qh_t structure to use.84 * @param[in] td Transfer descriptor to set as the first element.83 * @param[in] instance qh_t structure to initialize. 84 * @param[in] pa Physical address of the TD structure. 85 85 * 86 86 * Adds proper flag. If the pointer is NULL, sets element to terminal NULL. -
uspace/drv/uhci-hcd/hw_struct/transfer_descriptor.h
r50cd285 r8fcaeed 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ HW_STRUCT_TRANSFER_DESCRIPTOR_H35 #define DRV_UHCI_ HW_STRUCT_TRANSFER_DESCRIPTOR_H34 #ifndef DRV_UHCI_TRANSFER_DESCRIPTOR_H 35 #define DRV_UHCI_TRANSFER_DESCRIPTOR_H 36 36 37 37 #include <mem.h> -
uspace/drv/uhci-hcd/root_hub.h
r50cd285 r8fcaeed 33 33 * @brief UHCI driver 34 34 */ 35 #ifndef DRV_UHCI_ RH_H36 #define DRV_UHCI_ RH_H35 #ifndef DRV_UHCI_UHCI_RH_H 36 #define DRV_UHCI_UHCI_RH_H 37 37 38 38 #include <ddf/driver.h> -
uspace/drv/uhci-hcd/uhci.c
r50cd285 r8fcaeed 161 161 /** Initialize hc and rh DDF structures and their respective drivers. 162 162 * 163 * @param[in] instance UHCI structure to use. 163 164 * @param[in] device DDF instance of the device to use. 164 165 * … … 166 167 * - gets device's hw resources 167 168 * - disables UHCI legacy support (PCI config space) 168 * - a ttempts to enable interrupts169 * - asks for interrupt 169 170 * - registers interrupt handler 170 171 */ -
uspace/drv/uhci-hcd/utils/malloc32.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbuhci28 /** @addtogroup usb 29 29 * @{ 30 30 */ … … 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ UTILS_MALLOC32_H35 #define DRV_UHCI_ UTILS_MALLOC32_H34 #ifndef DRV_UHCI_TRANSLATOR_H 35 #define DRV_UHCI_TRANSLATOR_H 36 36 37 37 #include <assert.h> -
uspace/drv/uhci-hcd/utils/slab.c
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbuhcihc28 /** @addtogroup usb 29 29 * @{ 30 30 */ -
uspace/drv/uhci-hcd/utils/slab.h
r50cd285 r8fcaeed 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbuhcihc28 /** @addtogroup usb 29 29 * @{ 30 30 */ … … 32 32 * @brief UHCI driver 33 33 */ 34 #ifndef DRV_UHCI_ UTILS_SLAB_H35 #define DRV_UHCI_ UTILS_SLAB_H34 #ifndef DRV_UHCI_SLAB_H 35 #define DRV_UHCI_SLAB_H 36 36 37 37 #include <bool.h> -
uspace/drv/uhci-rhd/port.c
r50cd285 r8fcaeed 36 36 #include <errno.h> 37 37 #include <str_error.h> 38 #include <time.h>39 38 40 39 #include <usb/usb.h> /* usb_address_t */ … … 66 65 * 67 66 * @param[in] port Structure to use. 68 * @param[in] val New register value.67 * @param[in] value New register value. 69 68 * @return Error code. (Always EOK) 70 69 */ … … 78 77 * 79 78 * @param[in] port Memory structure to use. 80 * @param[in] addr essAddress of I/O register.79 * @param[in] addr Address of I/O register. 81 80 * @param[in] number Port number. 82 81 * @param[in] usec Polling interval. … … 225 224 uhci_port_write_status(port, port_status); 226 225 while (uhci_port_read_status(port) & STATUS_IN_RESET); 227 } 228 udelay(10); 226 // TODO: find a better way to waste time (it should be less than 227 // 10ms, if we reschedule it takes too much time (random 228 // interrupts can be solved by multiple attempts). 229 usb_log_debug2("%s: Reset Signal stop.\n", port->id_string); 230 } 229 231 /* Enable the port. */ 230 232 uhci_port_set_enabled(port, true); -
uspace/lib/c/generic/time.c
r50cd285 r8fcaeed 207 207 } 208 208 209 void udelay(useconds_t time)210 {211 (void) __SYSCALL1(SYS_THREAD_UDELAY, (sysarg_t) time);212 }213 214 215 209 /** Wait unconditionally for specified number of seconds 216 210 * -
uspace/lib/c/include/sys/time.h
r50cd285 r8fcaeed 62 62 extern int gettimeofday(struct timeval *tv, struct timezone *tz); 63 63 64 extern void udelay(useconds_t);65 66 64 #endif 67 65
Note:
See TracChangeset
for help on using the changeset viewer.