Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 1873 → Rev 1872

/trunk/uspace/kbd/genarch/include/kbd.h
File deleted
/trunk/uspace/kbd/genarch/include/scanc.h
File deleted
/trunk/uspace/kbd/genarch/src/kbd.c
File deleted
/trunk/uspace/kbd/arch/sparc64/include/scanc.h
File deleted
/trunk/uspace/kbd/arch/sparc64/include/kbd.h
34,9 → 34,13
/** @file
*/
 
#ifndef KBD_sparc64_KBD_H_
#define KBD_sparc64_KBD_H_
#ifndef __sparc64_KBD_H__
#define __sparc64_KBD_H__
 
#include <key_buffer.h>
 
int kbd_arch_init(void);
 
#endif
 
/** @}
/trunk/uspace/kbd/arch/sparc64/src/scanc.c
File deleted
/trunk/uspace/kbd/arch/sparc64/src/kbd.c
39,42 → 39,16
#include <sysinfo.h>
#include <kbd.h>
#include <keys.h>
#include <stdio.h>
#include <types.h>
#include <genarch/kbd.h>
 
#define KBD_KEY_RELEASE 0x80
#define KBD_ALL_KEYS_UP 0x7f
 
irq_cmd_t z8530_cmds[] = {
{ CMD_MEM_READ_1, 0, 0, 1 }
};
irq_code_t z8530_kbd = {
1,
z8530_cmds
};
 
int kbd_arch_init(void)
{
z8530_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual") + 6;
ipc_register_irq(sysinfo_value("kbd.irq"), &z8530_kbd);
return 0;
}
 
/** Process keyboard events */
int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
 
int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
{
int scan_code = IPC_GET_ARG1(*call);
 
if (scan_code == KBD_ALL_KEYS_UP)
return 1;
if (scan_code & KBD_KEY_RELEASE)
key_released(keybuffer, scan_code ^ KBD_KEY_RELEASE);
else
key_pressed(keybuffer, scan_code);
 
return 1;
}
 
/trunk/uspace/kbd/Makefile
49,32 → 49,18
arch/$(ARCH)/src/kbd.c
 
ifeq ($(ARCH), ia32)
ARCH_SOURCES += \
arch/$(ARCH)/src/mouse.c \
arch/$(ARCH)/src/scanc.c
GENARCH_SOURCES = \
genarch/src/kbd.c
ARCH_SOURCES += arch/$(ARCH)/src/mouse.c
CFLAGS += -DMOUSE_ENABLED
endif
ifeq ($(ARCH), amd64)
ARCH_SOURCES += \
arch/$(ARCH)/src/mouse.c \
arch/$(ARCH)/src/scanc.c
GENARCH_SOURCES = \
genarch/src/kbd.c
ARCH_SOURCES += arch/$(ARCH)/src/mouse.c
CFLAGS += -DMOUSE_ENABLED
endif
ifeq ($(ARCH), sparc64)
ARCH_SOURCES += \
arch/$(ARCH)/src/scanc.c
GENARCH_SOURCES = \
genarch/src/kbd.c
endif
 
 
 
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
 
.PHONY: all clean depend disasm links
 
84,16 → 70,15
 
links:
ln -sfn ../arch/$(ARCH)/include include/arch
ln -sfn ../genarch/include include/genarch
 
clean:
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch
 
depend:
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
 
$(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) $(LIBS)
$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld -e __entry_driver $(GENERIC_OBJECTS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
$(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS)
$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld -e __entry_driver $(GENERIC_OBJECTS) $(ARCH_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
disasm:
$(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm