Changeset f4f866c in mainline for uspace/srv/hid/kbd/port/niagara.c


Ignore:
Timestamp:
2010-04-23T21:42:26Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
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.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/kbd/port/niagara.c

    r38aaacc2 rf4f866c  
    4444#include <thread.h>
    4545#include <bool.h>
     46#include <errno.h>
    4647
    47 #define POLL_INTERVAL           10000
     48#define POLL_INTERVAL  10000
    4849
    4950/**
     
    5758 * kernel/arch/sparc64/src/drivers/niagara.c.
    5859 */
    59 #define INPUT_BUFFER_SIZE       ((PAGE_SIZE) - 2 * 8)
     60#define INPUT_BUFFER_SIZE  ((PAGE_SIZE) - 2 * 8)
     61
    6062typedef volatile struct {
    6163        uint64_t write_ptr;
     
    7981int kbd_port_init(void)
    8082{
     83        sysarg_t paddr;
     84        if (sysinfo_get_value("niagara.inbuf.address", &paddr) != EOK)
     85                return -1;
     86       
    8187        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) {
    8892                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);
    9994                return rc;
    10095        }
     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       
    101104        return 0;
    102105}
Note: See TracChangeset for help on using the changeset viewer.