Changeset 3e5a814 in mainline


Ignore:
Timestamp:
2009-02-25T21:32:18Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6b1de7a
Parents:
f542825
Message:

Add simple userspace FHC driver.
Modify the z8530 userspace driver
to send BUS_CLEAR_INTERRUPT
notification to the FHC driver.

Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/loader/Makefile

    rf542825 r3e5a814  
    103103        $(USPACEDIR)/srv/console/console \
    104104        $(USPACEDIR)/srv/fs/tmpfs/tmpfs \
    105         $(USPACEDIR)/srv/fs/fat/fat
     105        $(USPACEDIR)/srv/fs/fat/fat \
     106        $(USPACEDIR)/srv/fhc/fhc
    106107
    107108RD_APPS = \
  • kernel/arch/sparc64/src/drivers/fhc.c

    rf542825 r3e5a814  
    4646#include <arch/types.h>
    4747#include <genarch/ofw/ofw_tree.h>
     48#include <sysinfo/sysinfo.h>
    4849
    4950fhc_t *central_fhc = NULL;
     
    8788        fhc->uart_imap = (uint32_t *) hw_map(paddr, reg->size);
    8889       
     90        /*
     91         * Set sysinfo data needed by the uspace FHC driver.
     92         */
     93        sysinfo_set_item_val("fhc.uart.size", NULL, reg->size);
     94        sysinfo_set_item_val("fhc.uart.physical", NULL, paddr);
     95
    8996        return fhc;
    9097}
  • kernel/arch/sparc64/src/drivers/kbd.c

    rf542825 r3e5a814  
    4848#include <func.h>
    4949#include <print.h>
     50#include <sysinfo/sysinfo.h>
    5051
    5152kbd_type_t kbd_type = KBD_UNKNOWN;
     
    116117                        return;
    117118                }
     119                sysinfo_set_item_val("kbd.cir.fhc", NULL, 1);
    118120                break;
    119121               
  • uspace/Makefile

    rf542825 r3e5a814  
    6363endif
    6464
     65ifeq ($(UARCH),sparc64)
     66        DIRS += srv/fhc
     67endif
     68
    6569BUILDS := $(addsuffix .build,$(DIRS))
    6670CLEANS := $(addsuffix .clean,$(DIRS))
  • uspace/app/init/init.c

    rf542825 r3e5a814  
    109109        spawn("/srv/kbd");
    110110        spawn("/srv/console");
     111        spawn("/srv/fhc");
    111112       
    112113        console_wait();
  • uspace/lib/libc/include/ipc/services.h

    rf542825 r3e5a814  
    4545        SERVICE_CONSOLE,
    4646        SERVICE_VFS,
    47         SERVICE_DEVMAP
     47        SERVICE_DEVMAP,
     48        SERVICE_FHC
    4849} services_t;
    4950
  • uspace/srv/kbd/generic/kbd.c

    rf542825 r3e5a814  
    3838#include <ipc/ipc.h>
    3939#include <ipc/services.h>
     40#include <sysinfo.h>
    4041#include <stdio.h>
    4142#include <unistd.h>
     
    6667/** Currently pressed lock keys. We track these to tackle autorepeat. */
    6768static unsigned lock_keys;
     69
     70int cir_service = 0;
     71int cir_phone = -1;
    6872
    6973void kbd_push_scancode(int scancode)
     
    173177        ipcarg_t phonead;
    174178       
     179        if (sysinfo_value("kbd.cir.fhc") == 1)
     180                cir_service = SERVICE_FHC;
     181       
     182        if (cir_service) {
     183                while (cir_phone < 0) {
     184                        cir_phone = ipc_connect_me_to(PHONE_NS, cir_service,
     185                            0, 0);
     186                }
     187        }
     188       
    175189        /* Initialize port driver. */
    176190        if (kbd_port_init())
  • uspace/srv/kbd/include/kbd.h

    rf542825 r3e5a814  
    4646#define KBD_MS_MOVE     1028
    4747
     48extern int cir_service;
     49extern int cir_phone;
     50
    4851extern void kbd_push_scancode(int);
    4952extern void kbd_push_ev(int, unsigned int);
  • uspace/srv/kbd/port/z8530.c

    rf542825 r3e5a814  
    3636
    3737#include <ipc/ipc.h>
     38#include <ipc/bus.h>
    3839#include <async.h>
    3940#include <sysinfo.h>
     
    8990            CHAN_A_DATA;
    9091        ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
    91             0, &z8530_kbd);
     92            sysinfo_value("kbd.inr"), &z8530_kbd);
    9293        return 0;
    9394}
     
    9798        int scan_code = IPC_GET_ARG2(*call);
    9899        kbd_push_scancode(scan_code);
     100       
     101        if (cir_service)
     102                async_msg_1(cir_phone, BUS_CLEAR_INTERRUPT,
     103                    IPC_GET_METHOD(*call));
    99104}
    100105
Note: See TracChangeset for help on using the changeset viewer.