Changeset f4f866c in mainline for uspace/srv/hid/kbd/port/niagara.c
- Timestamp:
- 2010-04-23T21:42:26Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6c39a907
- Parents:
- 38aaacc2 (diff), 80badbe (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 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/kbd/port/niagara.c
r38aaacc2 rf4f866c 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 /** … … 57 58 * kernel/arch/sparc64/src/drivers/niagara.c. 58 59 */ 59 #define INPUT_BUFFER_SIZE ((PAGE_SIZE) - 2 * 8) 60 #define INPUT_BUFFER_SIZE ((PAGE_SIZE) - 2 * 8) 61 60 62 typedef volatile struct { 61 63 uint64_t write_ptr; … … 79 81 int kbd_port_init(void) 80 82 { 83 sysarg_t paddr; 84 if (sysinfo_get_value("niagara.inbuf.address", &paddr) != EOK) 85 return -1; 86 81 87 input_buffer_addr = (uintptr_t) as_get_mappable_page(PAGE_SIZE); 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 int rc = physmem_map((void *) paddr, (void *) input_buffer_addr, 89 1, AS_AREA_READ | AS_AREA_WRITE); 90 91 if (rc != 0) { 88 92 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); 98 if (rc != 0) { 93 rc); 99 94 return rc; 100 95 } 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 101 104 return 0; 102 105 }
Note:
See TracChangeset
for help on using the changeset viewer.