Changeset e4f8c77 in mainline for uspace/srv/hid/input/port/ski.c


Ignore:
Timestamp:
2011-07-13T22:39:18Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e6910c8
Parents:
5974661 (diff), 8ecef91 (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 libposix.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/port/ski.c

    r5974661 re4f8c77  
    11/*
    22 * Copyright (c) 2005 Jakub Jermar
    3  * Copyright (c) 2009 Jiri Svoboda
     3 * Copyright (c) 2011 Jiri Svoboda
    44 * All rights reserved.
    55 *
     
    4545#include <bool.h>
    4646
     47static int ski_port_init(kbd_dev_t *);
     48static void ski_port_yield(void);
     49static void ski_port_reclaim(void);
     50static void ski_port_write(uint8_t data);
     51
     52kbd_port_ops_t ski_port = {
     53        .init = ski_port_init,
     54        .yield = ski_port_yield,
     55        .reclaim = ski_port_reclaim,
     56        .write = ski_port_write
     57};
     58
     59static kbd_dev_t *kbd_dev;
     60
    4761#define SKI_GETCHAR             21
    4862
     
    5569
    5670/** Initialize Ski port driver. */
    57 int kbd_port_init(void)
     71static int ski_port_init(kbd_dev_t *kdev)
    5872{
    5973        thread_id_t tid;
    6074        int rc;
     75
     76        kbd_dev = kdev;
    6177
    6278        rc = thread_create(ski_thread_impl, NULL, "kbd_poll", &tid);
     
    6884}
    6985
    70 void kbd_port_yield(void)
     86static void ski_port_yield(void)
    7187{
    7288        polling_disabled = true;
    7389}
    7490
    75 void kbd_port_reclaim(void)
     91static void ski_port_reclaim(void)
    7692{
    7793        polling_disabled = false;
    7894}
    7995
    80 void kbd_port_write(uint8_t data)
     96static void ski_port_write(uint8_t data)
    8197{
    8298        (void) data;
     
    94110                        if (c == 0)
    95111                                break;
    96                         kbd_push_scancode(c);
     112                        kbd_push_data(kbd_dev, c);
    97113                }
    98114
     
    112128        uint64_t ch;
    113129       
     130#ifdef UARCH_ia64
    114131        asm volatile (
    115132                "mov r15 = %1\n"
     
    121138                : "r15", "r8"
    122139        );
    123 
     140#else
     141        ch = 0;
     142#endif
    124143        return (int32_t) ch;
    125144}
Note: See TracChangeset for help on using the changeset viewer.