Changes in uspace/srv/hid/kbd/port/sgcn.c [36e9cd1:d9fae235] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/kbd/port/sgcn.c
r36e9cd1 rd9fae235 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> 46 47 47 #define POLL_INTERVAL 48 #define POLL_INTERVAL 10000 48 49 49 50 /** 50 51 * SGCN buffer header. It is placed at the very beginning of the SGCN 51 * buffer. 52 * buffer. 52 53 */ 53 54 typedef struct { … … 102 103 int kbd_port_init(void) 103 104 { 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) { 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) { 108 120 printf("SGCN: uspace driver could not map physical memory."); 109 121 return -1; 110 122 } 111 123 112 sram_buffer_offset = sysinfo_value("sram.buffer.offset");113 114 124 thread_id_t tid; 115 int rc; 116 117 rc = thread_create(sgcn_thread_impl, NULL, "kbd_poll", &tid); 118 if (rc != 0) { 125 int rc = thread_create(sgcn_thread_impl, NULL, "kbd_poll", &tid); 126 if (rc != 0) 119 127 return rc; 120 } 121 128 122 129 return 0; 123 130 }
Note:
See TracChangeset
for help on using the changeset viewer.