Changes in uspace/srv/hid/kbd/port/niagara.c [d9fae235:8e33e1d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/kbd/port/niagara.c
rd9fae235 r8e33e1d 44 44 #include <thread.h> 45 45 #include <bool.h> 46 #include <errno.h>47 46 48 #define POLL_INTERVAL 47 #define POLL_INTERVAL 10000 49 48 50 49 /** … … 58 57 * kernel/arch/sparc64/src/drivers/niagara.c. 59 58 */ 60 #define INPUT_BUFFER_SIZE ((PAGE_SIZE) - 2 * 8) 61 59 #define INPUT_BUFFER_SIZE ((PAGE_SIZE) - 2 * 8) 62 60 typedef volatile struct { 63 61 uint64_t write_ptr; … … 73 71 74 72 static volatile bool polling_disabled = false; 75 static void niagara_thread_impl(void *arg);73 static void *niagara_thread_impl(void *arg); 76 74 77 75 /** … … 81 79 int kbd_port_init(void) 82 80 { 83 sysarg_t paddr;84 if (sysinfo_get_value("niagara.inbuf.address", &paddr) != EOK)85 return -1;86 87 81 input_buffer_addr = (uintptr_t) as_get_mappable_page(PAGE_SIZE); 88 int rc = physmem_map((void *) paddr, (void *) input_buffer_addr, 89 1, AS_AREA_READ | AS_AREA_WRITE); 90 82 int result = physmem_map( 83 (void *) sysinfo_value("niagara.inbuf.address"), 84 (void *) input_buffer_addr, 85 1, AS_AREA_READ | AS_AREA_WRITE); 86 87 if (result != 0) { 88 printf("Niagara: uspace driver couldn't map physical memory: %d\n", 89 result); 90 } 91 92 input_buffer = (input_buffer_t) input_buffer_addr; 93 94 thread_id_t tid; 95 int rc; 96 97 rc = thread_create(niagara_thread_impl, NULL, "kbd_poll", &tid); 91 98 if (rc != 0) { 92 printf("Niagara: uspace driver couldn't map physical memory: %d\n",93 rc);94 99 return rc; 95 100 } 96 97 input_buffer = (input_buffer_t) input_buffer_addr;98 99 thread_id_t tid;100 rc = thread_create(niagara_thread_impl, NULL, "kbd_poll", &tid);101 if (rc != 0)102 return rc;103 104 101 return 0; 105 102 } … … 139 136 * Thread to poll SGCN for keypresses. 140 137 */ 141 static void niagara_thread_impl(void *arg)138 static void *niagara_thread_impl(void *arg) 142 139 { 143 140 (void) arg; … … 148 145 usleep(POLL_INTERVAL); 149 146 } 147 return 0; 150 148 } 151 149 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.