Changeset 4fe3b6d in mainline for uspace/lib/c/generic/dlfcn.c
- Timestamp:
- 2011-05-20T11:07:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8bb61e6
- Parents:
- 3476be8 (diff), 7941bd6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/dlfcn.c
r3476be8 r4fe3b6d 1 1 /* 2 * Copyright (c) 20 11 Lubos Slovak2 * Copyright (c) 2008 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup drvusbhid 29 /** @addtogroup rtld rtld 30 * @brief 30 31 * @{ 31 */ 32 /** @file33 * USB HID keyboard autorepeat facilities32 */ 33 /** 34 * @file 34 35 */ 35 36 36 #ifndef USB_KBDREPEAT_H_ 37 #define USB_KBDREPEAT_H_ 37 #include <stdio.h> 38 #include <stdlib.h> 39 #include <dlfcn.h> 38 40 39 struct usb_kbd_t; 41 #include <rtld/module.h> 42 #include <rtld/symbol.h> 40 43 41 /*----------------------------------------------------------------------------*/ 42 /** 43 * Structure for keeping information needed for auto-repeat of keys. 44 void *dlopen(const char *path, int flag) 45 { 46 module_t *m; 47 48 if (runtime_env == NULL) { 49 printf("Dynamic linker not set up -- initializing.\n"); 50 rtld_init_static(); 51 } 52 53 printf("dlopen(\"%s\", %d)\n", path, flag); 54 55 printf("module_find('%s')\n", path); 56 m = module_find(path); 57 if (m == NULL) { 58 printf("NULL. module_load('%s')\n", path); 59 m = module_load(path); 60 printf("module_load_deps(m)\n"); 61 module_load_deps(m); 62 /* Now relocate. */ 63 printf("module_process_relocs(m)\n"); 64 module_process_relocs(m); 65 } else { 66 printf("not NULL\n"); 67 } 68 69 return (void *) m; 70 } 71 72 /* 73 * @note Symbols with NULL values are not accounted for. 44 74 */ 45 typedef struct { 46 /** Last pressed key. */ 47 unsigned int key_new; 48 /** Key to be repeated. */ 49 unsigned int key_repeated; 50 /** Delay before first repeat in microseconds. */ 51 unsigned int delay_before; 52 /** Delay between repeats in microseconds. */ 53 unsigned int delay_between; 54 } usb_kbd_repeat_t; 75 void *dlsym(void *mod, const char *sym_name) 76 { 77 elf_symbol_t *sd; 78 module_t *sm; 55 79 56 /*----------------------------------------------------------------------------*/ 80 printf("dlsym(0x%lx, \"%s\")\n", (long)mod, sym_name); 81 sd = symbol_bfs_find(sym_name, (module_t *) mod, &sm); 82 if (sd != NULL) { 83 return symbol_get_addr(sd, sm); 84 } 57 85 58 int usb_kbd_repeat_fibril(void *arg); 86 return NULL; 87 } 59 88 60 void usb_kbd_repeat_start(struct usb_kbd_t *kbd, unsigned int key); 61 62 void usb_kbd_repeat_stop(struct usb_kbd_t *kbd, unsigned int key); 63 64 #endif /* USB_KBDREPEAT_H_ */ 65 66 /** 67 * @} 89 /** @} 68 90 */
Note:
See TracChangeset
for help on using the changeset viewer.