Changes in uspace/srv/hid/kbd/port/sgcn.c [d9fae235:36e9cd1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/kbd/port/sgcn.c
rd9fae235 r36e9cd1 30 30 * @ingroup kbd 31 31 * @{ 32 */ 32 */ 33 33 /** @file 34 * @brief 34 * @brief SGCN (Serengeti Console) keyboard port driver. 35 35 */ 36 36 … … 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 /** 51 50 * SGCN buffer header. It is placed at the very beginning of the SGCN 52 * buffer. 51 * buffer. 53 52 */ 54 53 typedef struct { … … 103 102 int kbd_port_init(void) 104 103 { 105 sysarg_t sram_paddr; 106 if (sysinfo_get_value("sram.address.physical", &sram_paddr) != EOK) 107 return -1; 108 109 sysarg_t sram_size; 110 if (sysinfo_get_value("sram.area.size", &sram_size) != EOK) 111 return -1; 112 113 if (sysinfo_get_value("sram.buffer.offset", &sram_buffer_offset) != EOK) 114 sram_buffer_offset = 0; 115 116 sram_virt_addr = (uintptr_t) as_get_mappable_page(sram_size); 117 118 if (physmem_map((void *) sram_paddr, (void *) sram_virt_addr, 119 sram_size / PAGE_SIZE, AS_AREA_READ | AS_AREA_WRITE) != 0) { 104 sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size")); 105 if (physmem_map((void *) sysinfo_value("sram.address.physical"), 106 (void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE, 107 AS_AREA_READ | AS_AREA_WRITE) != 0) { 120 108 printf("SGCN: uspace driver could not map physical memory."); 121 109 return -1; 122 110 } 123 111 112 sram_buffer_offset = sysinfo_value("sram.buffer.offset"); 113 124 114 thread_id_t tid; 125 int rc = thread_create(sgcn_thread_impl, NULL, "kbd_poll", &tid); 126 if (rc != 0) 115 int rc; 116 117 rc = thread_create(sgcn_thread_impl, NULL, "kbd_poll", &tid); 118 if (rc != 0) { 127 119 return rc; 128 120 } 121 129 122 return 0; 130 123 }
Note:
See TracChangeset
for help on using the changeset viewer.