Changeset 9141377 in mainline


Ignore:
Timestamp:
2006-09-07T19:45:46Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
801579fe
Parents:
9dae51d7
Message:

sparc64 support for the kbd userspace service.

Location:
uspace/kbd
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/kbd/Makefile

    r9dae51d7 r9141377  
    5050
    5151ifeq ($(ARCH), ia32)
    52         ARCH_SOURCES += arch/$(ARCH)/src/mouse.c
     52        ARCH_SOURCES += \
     53                arch/$(ARCH)/src/mouse.c \
     54                arch/$(ARCH)/src/scanc.c
     55        GENARCH_SOURCES = \
     56                genarch/src/kbd.c
    5357        CFLAGS += -DMOUSE_ENABLED
    5458endif
    5559ifeq ($(ARCH), amd64)
    56         ARCH_SOURCES += arch/$(ARCH)/src/mouse.c
     60        ARCH_SOURCES += \
     61                arch/$(ARCH)/src/mouse.c \
     62                arch/$(ARCH)/src/scanc.c
     63        GENARCH_SOURCES = \
     64                genarch/src/kbd.c
    5765        CFLAGS += -DMOUSE_ENABLED
    5866endif
    59 
     67ifeq ($(ARCH), sparc64)
     68        ARCH_SOURCES += \
     69                arch/$(ARCH)/src/scanc.c
     70        GENARCH_SOURCES = \
     71                genarch/src/kbd.c
     72endif
    6073
    6174
    6275GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
    6376ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
     77GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
    6478
    6579.PHONY: all clean depend disasm links
     
    7185links:
    7286        ln -sfn ../arch/$(ARCH)/include include/arch
     87        ln -sfn ../genarch/include include/genarch
    7388
    7489clean:
    75         -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch
     90        -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch
    7691
    7792depend:
    7893        $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
    7994
    80 $(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS)
    81         $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld -e __entry_driver $(GENERIC_OBJECTS) $(ARCH_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
     95$(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) $(LIBS)
     96        $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld -e __entry_driver $(GENERIC_OBJECTS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    8297
    8398disasm:
  • uspace/kbd/arch/sparc64/include/kbd.h

    r9dae51d7 r9141377  
    3535 */
    3636
    37 #ifndef __sparc64_KBD_H__
    38 #define __sparc64_KBD_H__
    39 
    40 #include <key_buffer.h>
    41 
    42 int kbd_arch_init(void);
     37#ifndef KBD_sparc64_KBD_H_
     38#define KBD_sparc64_KBD_H_
    4339
    4440#endif
  • uspace/kbd/arch/sparc64/src/kbd.c

    r9dae51d7 r9141377  
    4040#include <kbd.h>
    4141#include <keys.h>
     42#include <stdio.h>
     43#include <types.h>
     44#include <genarch/kbd.h>
    4245
     46#define KBD_KEY_RELEASE         0x80
     47#define KBD_ALL_KEYS_UP         0x7f
     48
     49irq_cmd_t z8530_cmds[] = {
     50        { CMD_MEM_READ_1, 0, 0, 1 }
     51};
     52       
     53irq_code_t z8530_kbd = {
     54        1,
     55        z8530_cmds
     56};
    4357
    4458int kbd_arch_init(void)
    4559{
     60        z8530_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual") + 6;
     61        ipc_register_irq(sysinfo_value("kbd.irq"), &z8530_kbd);
    4662        return 0;
    4763}
    4864
     65/** Process keyboard events */
     66int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
     67{
     68        int scan_code = IPC_GET_ARG1(*call);
    4969
    50 int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
    51 {
     70        if (scan_code == KBD_ALL_KEYS_UP)
     71                return 1;
     72               
     73        if (scan_code & KBD_KEY_RELEASE)
     74                key_released(keybuffer, scan_code ^ KBD_KEY_RELEASE);
     75        else
     76                key_pressed(keybuffer, scan_code);
     77
    5278        return 1;
    5379}
Note: See TracChangeset for help on using the changeset viewer.