Index: uspace/srv/console/console.c
===================================================================
--- uspace/srv/console/console.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/console/console.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -36,5 +36,5 @@
 #include <fb.h>
 #include <ipc/ipc.h>
-#include <keys.h>
+#include <kbd.h>
 #include <kbd/keycode.h>
 #include <ipc/fb.h>
Index: uspace/srv/kbd/Makefile
===================================================================
--- uspace/srv/kbd/Makefile	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/Makefile	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -111,6 +111,6 @@
 ifeq ($(UARCH), sparc64)
 	GENARCH_SOURCES += \
-		port/dummy.c \
-		ctl/stty.c
+		port/z8350.c \
+		ctl/sun.c
 endif
 
Index: pace/srv/kbd/arch/amd64
===================================================================
--- uspace/srv/kbd/arch/amd64	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,1 +1,0 @@
-ia32
Index: pace/srv/kbd/arch/arm32/include/kbd.h
===================================================================
--- uspace/srv/kbd/arch/arm32/include/kbd.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdarm32
- * @{
- */ 
-/** @file
- *  @brief Empty.
- */
-
-#ifndef KBD_arm32_KBD_H_
-#define KBD_arm32_KBD_H_
-
-#endif
-
-/** @}
- */
Index: pace/srv/kbd/arch/arm32/src/kbd.c
===================================================================
--- uspace/srv/kbd/arch/arm32/src/kbd.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,40 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdarm32 arm32
- * @brief	HelenOS arm32 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- *  @brief Empty, required by generic Makefile.
- */
-
-
-/** @}
- */
Index: pace/srv/kbd/arch/arm32/src/kbd_gxemul.c
===================================================================
--- uspace/srv/kbd/arch/arm32/src/kbd_gxemul.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,424 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdarm32gxemul GXemul
- * @brief	HelenOS arm32 GXEmul uspace keyboard handler.
- * @ingroup  kbdarm32
- * @{
- */ 
-/** @file
- *  @brief GXemul uspace keyboard handler.
- */
-
-#include <ipc/ipc.h>
-#include <sysinfo.h>
-#include <kbd.h>
-#include <keys.h>
-#include <bool.h>
-
-
-/* GXemul key codes in no-framebuffer mode. */
-#define GXEMUL_KEY_F1  0x504f1bL
-#define GXEMUL_KEY_F2  0x514f1bL
-#define GXEMUL_KEY_F3  0x524f1bL
-#define GXEMUL_KEY_F4  0x534f1bL
-#define GXEMUL_KEY_F5  0x35315b1bL
-#define GXEMUL_KEY_F6  0x37315b1bL
-#define GXEMUL_KEY_F7  0x38315b1bL
-#define GXEMUL_KEY_F8  0x39315b1bL
-#define GXEMUL_KEY_F9  0x30325b1bL
-#define GXEMUL_KEY_F10 0x31325b1bL
-#define GXEMUL_KEY_F11 0x33325d1bL
-#define GXEMUL_KEY_F12 0x34325b1bL 
-
-/** Start code of F5-F12 keys. */
-#define GXEMUL_KEY_F5_F12_START_CODE 0x7e
-
-/* GXemul key codes in framebuffer mode. */
-#define GXEMUL_FB_KEY_F1 0x504f5b1bL
-#define GXEMUL_FB_KEY_F2 0x514f5b1bL
-#define GXEMUL_FB_KEY_F3 0x524f5b1bL
-#define GXEMUL_FB_KEY_F4 0x534f5b1bL
-#define GXEMUL_FB_KEY_F5 0x35315b1bL
-#define GXEMUL_FB_KEY_F6 0x37315b1bL
-#define GXEMUL_FB_KEY_F7 0x38315b1bL
-#define GXEMUL_FB_KEY_F8 0x39315b1bL
-#define GXEMUL_FB_KEY_F9 0x38325b1bL
-#define GXEMUL_FB_KEY_F10 0x39325b1bL
-#define GXEMUL_FB_KEY_F11 0x33325b1bL
-#define GXEMUL_FB_KEY_F12 0x34325b1bL
-
-
-/** Function keys start code (F1=0x101) */
-#define FUNCTION_KEYS 0x100
-
-static irq_cmd_t gxemul_cmds[] = {
-	{ 
-		CMD_MEM_READ_1, 
-		(void *) 0, 
-		0, 
-		2
-	}
-};
-
-static irq_code_t gxemul_kbd = {
-	1,
-	gxemul_cmds
-};
-
-
-/** Framebuffer switched on. */
-static bool fb;
-
-
-/*
-// Please preserve this code (it can be used to determine scancodes)
-int to_hex(int v) 
-{
-        return "0123456789ABCDEF"[v];
-}
-*/
-
-
-/** Process data sent when a key is pressed (in no-framebuffer mode).
- *  
- *  @param keybuffer Buffer of pressed key.
- *  @param scan_code Scan code.
- *
- *  @return Always 1.
- */
-static int gxemul_kbd_process_no_fb(keybuffer_t *keybuffer, int scan_code)
-{
-	// holds at most 4 latest scan codes
-	static unsigned long buf = 0;
-
-	// number of scan codes in #buf
-	static int count = 0;	
-
-	/*
-	// Preserve for detecting scan codes. 
-	keybuffer_push0(keybuffer, to_hex((scan_code>>4)&0xf));
-	keybuffer_push0(keybuffer, to_hex(scan_code&0xf));
-	keybuffer_push0(keybuffer, 'X');
-	keybuffer_push0(keybuffer, 'Y');
-	return 1;
-	*/
-
-	if (scan_code == '\r') {
-		scan_code = '\n';
-	}
-	
-	if (scan_code == GXEMUL_KEY_F5_F12_START_CODE) {
-		switch (buf) {
-		case GXEMUL_KEY_F5:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 5);
-			buf = count = 0;
-			return 1;
-		case GXEMUL_KEY_F6:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 6);
-			buf = count = 0;
-			return 1;
-		case GXEMUL_KEY_F7:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 7);
-			buf = count = 0;
-			return 1;
-		case GXEMUL_KEY_F8:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 8);
-			buf = count = 0;
-			return 1;
-		case GXEMUL_KEY_F9:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 9);
-			buf = count = 0;
-			return 1;
-		case GXEMUL_KEY_F10:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 10);
-			buf = count = 0;
-			return 1;
-		case GXEMUL_KEY_F11:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 11);
-			buf = count = 0;
-			return 1;
-		case GXEMUL_KEY_F12:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 12);
-			buf = count = 0;
-			return 1;
-		default:
-			keybuffer_push0(keybuffer, buf & 0xff);
-			keybuffer_push0(keybuffer, (buf >> 8)  & 0xff);
-			keybuffer_push0(keybuffer, (buf >> 16) & 0xff);
-			keybuffer_push0(keybuffer, (buf >> 24) & 0xff);
-			keybuffer_push0(keybuffer, scan_code);
-			buf = count = 0;
-			return 1;
-		}
-	}
-
-	// add to buffer
-	buf |= ((unsigned long) scan_code) << (8 * (count++));
-	
-	if ((buf & 0xff) != (GXEMUL_KEY_F1 & 0xff)) {
-		keybuffer_push0(keybuffer, buf);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 1) { 
-		return 1;
-	}
-
-	if ((buf & 0xffff) != (GXEMUL_KEY_F1 & 0xffff) 
-		&& (buf & 0xffff) != (GXEMUL_KEY_F5 & 0xffff) ) {
-
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 2) {
-		return 1;
-	}
-
-	switch (buf) {
-	case GXEMUL_KEY_F1:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 1);
-		buf = count = 0;
-		return 1;
-	case GXEMUL_KEY_F2:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 2);
-		buf = count = 0;
-		return 1;
-	case GXEMUL_KEY_F3:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 3);
-		buf = count = 0;
-		return 1;
-	case GXEMUL_KEY_F4:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 4);
-		buf = count = 0;
-		return 1;
-	}
-
-
-	if ((buf & 0xffffff) != (GXEMUL_KEY_F5 & 0xffffff)
-		&& (buf & 0xffffff) != (GXEMUL_KEY_F9 & 0xffffff)) {
-
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) & 0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 3) {
-		return 1;
-	}
-	
-	switch (buf) {
-	case GXEMUL_KEY_F5:
-	case GXEMUL_KEY_F6:
-	case GXEMUL_KEY_F7:
-	case GXEMUL_KEY_F8:
-	case GXEMUL_KEY_F9:
-	case GXEMUL_KEY_F10:
-	case GXEMUL_KEY_F11:
-	case GXEMUL_KEY_F12:
-		return 1;
-	default:
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8)  & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 24) & 0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	return 1;
-}
-
-
-/** Process data sent when a key is pressed (in framebuffer mode).
- *  
- *  @param keybuffer Buffer of pressed keys.
- *  @param scan_code Scan code.
- *
- *  @return Always 1.
- */
-static int gxemul_kbd_process_fb(keybuffer_t *keybuffer, int scan_code)
-{
-	// holds at most 4 latest scan codes
-	static unsigned long buf = 0;
-
-	// number of scan codes in #buf
-	static int count = 0;	
-
-	/*
-	// Please preserve this code (it can be used to determine scancodes)
-	keybuffer_push0(keybuffer, to_hex((scan_code>>4)&0xf));
-	keybuffer_push0(keybuffer, to_hex(scan_code&0xf));
-	keybuffer_push0(keybuffer, ' ');
-	keybuffer_push0(keybuffer, ' ');
-	return 1;
-	*/
-	
-	if (scan_code == '\r') {
-		scan_code = '\n';
-	}
-	
-	// add to buffer
-	buf |= ((unsigned long) scan_code) << (8*(count++));
-	
-	
-	if ((buf & 0xff) != (GXEMUL_FB_KEY_F1 & 0xff)) {
-		keybuffer_push0(keybuffer, buf);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 1) {
-		return 1;
-	}
-
-	if ((buf & 0xffff) != (GXEMUL_FB_KEY_F1 & 0xffff)) {
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 2) {
-		return 1;
-	}
-
-	if ((buf & 0xffffff) != (GXEMUL_FB_KEY_F1 & 0xffffff)
-		&& (buf & 0xffffff) != (GXEMUL_FB_KEY_F5 & 0xffffff)
-		&& (buf & 0xffffff) != (GXEMUL_FB_KEY_F9 & 0xffffff)) {
-
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) & 0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 3) {
-		return 1;
-	}
-
-	switch (buf) {
-	case GXEMUL_FB_KEY_F1:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 1 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F2:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 2 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F3:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 3 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F4:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 4 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F5:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 5 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F6:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 6 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F7:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 7 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F8:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 8 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F9:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 9 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F10:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 10 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F11:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 11 );
-		buf = count = 0;
-		return 1;
-	case GXEMUL_FB_KEY_F12:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 12 );
-		buf = count = 0;
-		return 1;
-	default:
-		keybuffer_push0(keybuffer, buf & 0xff );
-		keybuffer_push0(keybuffer, (buf >> 8)  & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 24) & 0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	return 1;
-}
-
-
-/** Initializes keyboard handler. */
-int kbd_arch_init(void)
-{
-	fb = (sysinfo_value("fb.kind") == 1);
-	gxemul_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual");
-	ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &gxemul_kbd);
-	return 0;
-}
-
-
-/** Process data sent when a key is pressed.
- *  
- *  @param keybuffer Buffer of pressed keys.
- *  @param call      IPC call.
- *
- *  @return Always 1.
- */
-int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call) 
-{
-	int scan_code = IPC_GET_ARG2(*call);
-
-	if (fb) {
-		return gxemul_kbd_process_fb(keybuffer, scan_code);
-	} else {
-		return gxemul_kbd_process_no_fb(keybuffer, scan_code);
-	}
-
-}
-
-/** @}
- */
Index: pace/srv/kbd/arch/ia32/include/kbd.h
===================================================================
--- uspace/srv/kbd/arch/ia32/include/kbd.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdamd64 amd64
- * @brief	HelenOS ia32 / amd64 arch dependent parts of uspace keyboard and mouse handler.
- * @ingroup  kbd
- * @{
- */
-
-/** @file
- * @ingroup kbdia32
- */
-
-#ifndef KBD_ia32_KBD_H_
-#define KBD_ia32_KBD_H_
-
-#include <ddi.h>
-#include <libarch/ddi.h>
-
-#define i8042_DATA      0x60
-#define i8042_STATUS    0X64
-
-
-typedef unsigned char u8;
-typedef short u16;
-
-static inline void i8042_data_write(u8 data)
-{
-	outb(i8042_DATA, data);
-}
-
-static inline u8 i8042_data_read(void)
-{
-	return inb(i8042_DATA);
-}
-
-static inline u8 i8042_status_read(void)
-{
-	return inb(i8042_STATUS);
-}
-
-static inline void i8042_command_write(u8 command)
-{
-	outb(i8042_STATUS, command);
-}
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/ia32/include/scanc.h
===================================================================
--- uspace/srv/kbd/arch/ia32/include/scanc.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*
- * Copyright (c) 2001-2004 Jakub Jermar
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdia32
- * @{
- */ 
-/** @file
- * @ingroup kbdamd64
- */
-
-#ifndef KBD_ia32_SCANC_H_
-#define KBD_ia32_SCANC_H_
-
-/** Scancodes. */
-#define SC_ESC		0x01
-#define SC_BACKSPACE	0x0e
-#define SC_LSHIFT	0x2a
-#define SC_RSHIFT	0x36
-#define SC_CAPSLOCK	0x3a
-#define SC_SPEC_ESCAPE  0xe0
-#define SC_LEFTARR      0x4b
-#define SC_RIGHTARR     0x4d
-#define SC_UPARR        0x48
-#define SC_DOWNARR      0x50
-#define SC_DELETE       0x53
-#define SC_HOME         0x47
-#define SC_END          0x4f
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/ia32/src/kbd.c
===================================================================
--- uspace/srv/kbd/arch/ia32/src/kbd.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,166 +1,0 @@
-/*
- * Copyright (c) 2001-2004 Jakub Jermar
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdia32 ia32
- * @brief	HelenOS ia32 / amd64 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- * @ingroup kbdamd64
- */
-
-#include <arch/kbd.h>
-#include <ipc/ipc.h>
-#include <unistd.h>
-#include <kbd.h>
-#include <keys.h>
-#include <genarch/kbd.h>
-#include <sysinfo.h>
-
-/* Interesting bits for status register */
-#define i8042_OUTPUT_FULL  0x1
-#define i8042_INPUT_FULL   0x2
-#define i8042_MOUSE_DATA   0x20
-
-/* Command constants */
-#define i8042_CMD_KBD 0x60
-#define i8042_CMD_MOUSE  0xd4
-
-/* Keyboard cmd byte */
-#define i8042_KBD_IE        0x1
-#define i8042_MOUSE_IE      0x2
-#define i8042_KBD_DISABLE   0x10
-#define i8042_MOUSE_DISABLE 0x20
-#define i8042_KBD_TRANSLATE 0x40
-
-/* Mouse constants */
-#define MOUSE_OUT_INIT  0xf4
-#define MOUSE_ACK       0xfa
-
-#define KEY_RELEASE	0x80
-
-static volatile int keyflags;		/**< Tracking of multiple keypresses. */
-static volatile int lockflags;		/**< Tracking of multiple keys lockings. */
-
-irq_cmd_t i8042_cmds[2] = {
-	{ CMD_PORT_READ_1, (void *) 0x64, 0, 1 },
-	{ CMD_PORT_READ_1, (void *) 0x60, 0, 2 }
-};
-
-irq_code_t i8042_kbd = {
-	2,
-	i8042_cmds
-};
-
-static void wait_ready(void) {
-	while (i8042_status_read() & i8042_INPUT_FULL)
-		;
-}
-
-/** Register uspace irq handler
- * @return 
- */
-int kbd_arch_init(void)
-{
-	int i;
-	int mouseenabled = 0;
-
-	iospace_enable(task_get_id(), (void *) i8042_DATA, 5);
-	/* Disable kbd, enable mouse */
-	i8042_command_write(i8042_CMD_KBD);
-	wait_ready();
-	i8042_command_write(i8042_CMD_KBD);
-	wait_ready();
-	i8042_data_write(i8042_KBD_DISABLE);
-	wait_ready();
-
-	/* Flush all current IO */
-	while (i8042_status_read() & i8042_OUTPUT_FULL)
-		i8042_data_read();
-	
-	/* Initialize mouse */
-	i8042_command_write(i8042_CMD_MOUSE);
-	wait_ready();
-	i8042_data_write(MOUSE_OUT_INIT);
-	wait_ready();
-	
-	int mouseanswer = 0;
-	for (i=0;i < 1000; i++) {
-		int status = i8042_status_read();
-		if (status & i8042_OUTPUT_FULL) {
-			int data = i8042_data_read();
-			if (status & i8042_MOUSE_DATA) {
-				mouseanswer = data;
-				break;
-			}
-		}
-		usleep(1000);
-	}
-	if (mouseanswer == MOUSE_ACK) {
-		/* enable mouse */
-		mouseenabled = 1;
-		
-		ipc_register_irq(sysinfo_value("mouse.inr"), sysinfo_value("mouse.devno"), 0, &i8042_kbd);
-	}
-	/* Enable kbd */
-	ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &i8042_kbd);
-
-	int newcontrol = i8042_KBD_IE | i8042_KBD_TRANSLATE;
-	if (mouseenabled)
-		newcontrol |= i8042_MOUSE_IE;
-	
-	i8042_command_write(i8042_CMD_KBD);
-	wait_ready();
-	i8042_data_write(newcontrol);
-	wait_ready();
-	
-	return 0;
-}
-
-/** Process keyboard & mouse events */
-int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
-{
-	int status = IPC_GET_ARG1(*call);
-
-	if ((status & i8042_MOUSE_DATA))
-		return 0;
-	
-	int scan_code = IPC_GET_ARG2(*call);
-	
-	if (scan_code & KEY_RELEASE)
-		key_released(keybuffer, scan_code ^ KEY_RELEASE);
-	else
-		key_pressed(keybuffer, scan_code);
-	return 	1;
-}
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/ia32/src/mouse.c
===================================================================
--- uspace/srv/kbd/arch/ia32/src/mouse.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,117 +1,0 @@
-/*
- * Copyright (c) 2006 Ondrej Palkovsky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <ipc/ipc.h>
-#include <async.h>
-#include <kbd.h>
-#include <keys.h>
-
-#define i8042_MOUSE_DATA   0x20
-
-#define BUFSIZE 3
-
-typedef struct {
-	union {
-		unsigned char data[BUFSIZE];
-		struct {
-			unsigned leftbtn : 1;
-			unsigned rightbtn : 1;
-			unsigned middlebtn : 1;
-			unsigned isone : 1; /* Always one */
-			unsigned xsign : 1;
-			unsigned ysign : 1;
-			unsigned xovfl : 1;
-			unsigned yovfl : 1;
-			unsigned char x;
-			unsigned char y;
-		} val;
-	}u;
-}ps2packet_t;
-
-static ps2packet_t buf;
-static int bufpos = 0;
-static int leftbtn = 0;
-static int rightbtn = 0;
-static int middlebtn = 0;
-
-/** Convert 9-bit 2-complement signed number to integer */
-static int bit9toint(int sign, unsigned char data)
-{
-	int tmp;
-
-	if (!sign)
-		return data;
-
-	tmp = ((unsigned char)~data) + 1;
-	return -tmp;
-}
-
-/** Process mouse data
- *
- * @return True if mouse command was recognized and processed
- */
-int mouse_arch_process(int phoneid, ipc_call_t *call)
-{
-	int status = IPC_GET_ARG1(*call);
-	int data = IPC_GET_ARG2(*call);
-	int x,y;
-
-	if (!(status & i8042_MOUSE_DATA))
-		return 0;
-
-	/* Check that we have not lost synchronization */
-	if (bufpos == 0 && !(data & 0x8))
-		return 1; /* Synchro lost, ignore byte */
-
-	buf.u.data[bufpos++] = data;
-	if (bufpos == BUFSIZE) {
-		bufpos = 0;
-		if (phoneid != -1) {
-			if (buf.u.val.leftbtn ^ leftbtn) {
-				leftbtn = buf.u.val.leftbtn;
-				async_msg_1(phoneid, KBD_MS_LEFT, leftbtn);
-			}
-			if (buf.u.val.rightbtn & rightbtn) {
-				rightbtn = buf.u.val.middlebtn;
-				async_msg_1(phoneid, KBD_MS_RIGHT, rightbtn);
-			}
-			if (buf.u.val.rightbtn & rightbtn) {
-				middlebtn = buf.u.val.middlebtn;
-				async_msg_1(phoneid, KBD_MS_MIDDLE, middlebtn);
-			}
-			x = bit9toint(buf.u.val.xsign, buf.u.val.x);
-			y = bit9toint(buf.u.val.ysign, buf.u.val.y);
-			if (x || y)
-				async_msg_2(phoneid, KBD_MS_MOVE, (ipcarg_t)x,
-				    (ipcarg_t)(-y));
-		}
-	}
-
-	
-	return 1;
-}
Index: pace/srv/kbd/arch/ia32/src/scanc.c
===================================================================
--- uspace/srv/kbd/arch/ia32/src/scanc.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,202 +1,0 @@
-/*
- * Copyright (c) 2001-2004 Jakub Jermar
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdia32
- * @brief	Scancodes for PC keyboards.
- * @{
- */ 
-/** @file
- * @ingroup kbdamd64
- */
-
-#include <genarch/scanc.h>
-
-/** Primary meaning of scancodes. */
-int sc_primary_map[] = {
-	SPECIAL, /* 0x00 */
-	SPECIAL, /* 0x01 - Esc */
-	'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',
-	'\b', /* 0x0e - Backspace */
-	'\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
-	SPECIAL, /* 0x1d - LCtrl */
-	'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'',
-	'`',
-	SPECIAL, /* 0x2a - LShift */ 
-	'\\',
-	'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/',
-	SPECIAL, /* 0x36 - RShift */
-	'*',
-	SPECIAL, /* 0x38 - LAlt */
-	' ',
-	SPECIAL, /* 0x3a - CapsLock */
-	(FUNCTION_KEYS | 1), /* 0x3b - F1 */
-	(FUNCTION_KEYS | 2), /* 0x3c - F2 */
-	(FUNCTION_KEYS | 3), /* 0x3d - F3 */
-	(FUNCTION_KEYS | 4), /* 0x3e - F4 */
-	(FUNCTION_KEYS | 5), /* 0x3f - F5 */
-	(FUNCTION_KEYS | 6), /* 0x40 - F6 */
-	(FUNCTION_KEYS | 7), /* 0x41 - F7 */
-	(FUNCTION_KEYS | 8), /* 0x42 - F8 */
-	(FUNCTION_KEYS | 9), /* 0x43 - F9 */
-	(FUNCTION_KEYS | 10), /* 0x44 - F10 */
-	SPECIAL, /* 0x45 - NumLock */
-	SPECIAL, /* 0x46 - ScrollLock */
-	'7', '8', '9', '-',
-	'4', '5', '6', '+',
-	'1', '2', '3',
-	'0', '.',
-	SPECIAL, /* 0x54 - Alt-SysRq */
-	SPECIAL, /* 0x55 - F11/F12/PF1/FN */
-	SPECIAL, /* 0x56 - unlabelled key next to LAlt */
-	(FUNCTION_KEYS | 11), /* 0x57 - F11 */
-	(FUNCTION_KEYS | 12), /* 0x58 - F12 */
-	SPECIAL, /* 0x59 */
-	SPECIAL, /* 0x5a */
-	SPECIAL, /* 0x5b */
-	SPECIAL, /* 0x5c */
-	SPECIAL, /* 0x5d */
-	SPECIAL, /* 0x5e */
-	SPECIAL, /* 0x5f */
-	SPECIAL, /* 0x60 */
-	SPECIAL, /* 0x61 */
-	SPECIAL, /* 0x62 */
-	SPECIAL, /* 0x63 */
-	SPECIAL, /* 0x64 */
-	SPECIAL, /* 0x65 */
-	SPECIAL, /* 0x66 */
-	SPECIAL, /* 0x67 */
-	SPECIAL, /* 0x68 */
-	SPECIAL, /* 0x69 */
-	SPECIAL, /* 0x6a */
-	SPECIAL, /* 0x6b */
-	SPECIAL, /* 0x6c */
-	SPECIAL, /* 0x6d */
-	SPECIAL, /* 0x6e */
-	SPECIAL, /* 0x6f */
-	SPECIAL, /* 0x70 */
-	SPECIAL, /* 0x71 */
-	SPECIAL, /* 0x72 */
-	SPECIAL, /* 0x73 */
-	SPECIAL, /* 0x74 */
-	SPECIAL, /* 0x75 */
-	SPECIAL, /* 0x76 */
-	SPECIAL, /* 0x77 */
-	SPECIAL, /* 0x78 */
-	SPECIAL, /* 0x79 */
-	SPECIAL, /* 0x7a */
-	SPECIAL, /* 0x7b */
-	SPECIAL, /* 0x7c */
-	SPECIAL, /* 0x7d */
-	SPECIAL, /* 0x7e */
-	SPECIAL, /* 0x7f */
-};
-
-/** Secondary meaning of scancodes. */
-int sc_secondary_map[] = {
-	SPECIAL, /* 0x00 */
-	0x1b, /* 0x01 - Esc */
-	'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
-	SPECIAL, /* 0x0e - Backspace */
-	'\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
-	SPECIAL, /* 0x1d - LCtrl */
-	'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"',
-	'~',
-	SPECIAL, /* 0x2a - LShift */ 
-	'|',
-	'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?',
-	SPECIAL, /* 0x36 - RShift */
-	'*',
-	SPECIAL, /* 0x38 - LAlt */
-	' ',
-	SPECIAL, /* 0x3a - CapsLock */
-	SPECIAL, /* 0x3b - F1 */
-	SPECIAL, /* 0x3c - F2 */
-	SPECIAL, /* 0x3d - F3 */
-	SPECIAL, /* 0x3e - F4 */
-	SPECIAL, /* 0x3f - F5 */
-	SPECIAL, /* 0x40 - F6 */
-	SPECIAL, /* 0x41 - F7 */
-	SPECIAL, /* 0x42 - F8 */
-	SPECIAL, /* 0x43 - F9 */
-	SPECIAL, /* 0x44 - F10 */
-	SPECIAL, /* 0x45 - NumLock */
-	SPECIAL, /* 0x46 - ScrollLock */
-	'7', '8', '9', '-',
-	'4', '5', '6', '+',
-	'1', '2', '3',
-	'0', '.',
-	SPECIAL, /* 0x54 - Alt-SysRq */
-	SPECIAL, /* 0x55 - F11/F12/PF1/FN */
-	SPECIAL, /* 0x56 - unlabelled key next to LAlt */
-	SPECIAL, /* 0x57 - F11 */
-	SPECIAL, /* 0x58 - F12 */
-	SPECIAL, /* 0x59 */
-	SPECIAL, /* 0x5a */
-	SPECIAL, /* 0x5b */
-	SPECIAL, /* 0x5c */
-	SPECIAL, /* 0x5d */
-	SPECIAL, /* 0x5e */
-	SPECIAL, /* 0x5f */
-	SPECIAL, /* 0x60 */
-	SPECIAL, /* 0x61 */
-	SPECIAL, /* 0x62 */
-	SPECIAL, /* 0x63 */
-	SPECIAL, /* 0x64 */
-	SPECIAL, /* 0x65 */
-	SPECIAL, /* 0x66 */
-	SPECIAL, /* 0x67 */
-	SPECIAL, /* 0x68 */
-	SPECIAL, /* 0x69 */
-	SPECIAL, /* 0x6a */
-	SPECIAL, /* 0x6b */
-	SPECIAL, /* 0x6c */
-	SPECIAL, /* 0x6d */
-	SPECIAL, /* 0x6e */
-	SPECIAL, /* 0x6f */
-	SPECIAL, /* 0x70 */
-	SPECIAL, /* 0x71 */
-	SPECIAL, /* 0x72 */
-	SPECIAL, /* 0x73 */
-	SPECIAL, /* 0x74 */
-	SPECIAL, /* 0x75 */
-	SPECIAL, /* 0x76 */
-	SPECIAL, /* 0x77 */
-	SPECIAL, /* 0x78 */
-	SPECIAL, /* 0x79 */
-	SPECIAL, /* 0x7a */
-	SPECIAL, /* 0x7b */
-	SPECIAL, /* 0x7c */
-	SPECIAL, /* 0x7d */
-	SPECIAL, /* 0x7e */
-	SPECIAL, /* 0x7f */	
-};
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/ia64/include/kbd.h
===================================================================
--- uspace/srv/kbd/arch/ia64/include/kbd.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdia64 ia64
- * @brief	HelenOS ia64 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#ifndef KBD_ia64_KBD_H_
-#define KBD_ia64_KBD_H_
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/ia64/include/lkbd.h
===================================================================
--- uspace/srv/kbd/arch/ia64/include/lkbd.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdamd64 amd64
- * @brief	HelenOS ia32 / amd64 arch dependent parts of uspace keyboard and mouse handler.
- * @ingroup  kbd
- * @{
- */
-
-/** @file
- * @ingroup kbdia32
- */
-
-#ifndef KBD_ia32_KBD_H_
-#define KBD_ia32_KBD_H_
-
-#include <ddi.h>
-#include <libarch/ddi.h>
-
-#define i8042_DATA      0x60
-#define i8042_STATUS    0X64
-
-
-typedef unsigned char u8;
-typedef short u16;
-
-static inline void i8042_data_write(u8 data)
-{
-	outb(i8042_DATA, data);
-}
-
-static inline u8 i8042_data_read(void)
-{
-	return inb(i8042_DATA);
-}
-
-static inline u8 i8042_status_read(void)
-{
-	return inb(i8042_STATUS);
-}
-
-static inline void i8042_command_write(u8 command)
-{
-	outb(i8042_STATUS, command);
-}
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/ia64/include/scanc.h
===================================================================
--- uspace/srv/kbd/arch/ia64/include/scanc.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*
- * Copyright (c) 2001-2004 Jakub Jermar
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdia32
- * @{
- */ 
-/** @file
- * @ingroup kbdamd64
- */
-
-#ifndef KBD_ia32_SCANC_H_
-#define KBD_ia32_SCANC_H_
-
-/** Scancodes. */
-#define SC_ESC		0x01
-#define SC_BACKSPACE	0x0e
-#define SC_LSHIFT	0x2a
-#define SC_RSHIFT	0x36
-#define SC_CAPSLOCK	0x3a
-#define SC_SPEC_ESCAPE  0xe0
-#define SC_LEFTARR      0x4b
-#define SC_RIGHTARR     0x4d
-#define SC_UPARR        0x48
-#define SC_DOWNARR      0x50
-#define SC_DELETE       0x53
-#define SC_HOME         0x47
-#define SC_END          0x4f
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/ia64/src/kbd.c
===================================================================
--- uspace/srv/kbd/arch/ia64/src/kbd.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,392 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdia64 ia64
- * @brief	HelenOS ia64 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#include <arch/kbd.h>
-#include <ipc/ipc.h>
-#include <sysinfo.h>
-#include <kbd.h>
-#include <keys.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <unistd.h>
-#include <align.h>
-#include <async.h>
-#include <ipc/ipc.h>
-#include <errno.h>
-#include <stdio.h>
-#include <ddi.h>
-#include <sysinfo.h>
-#include <as.h>
-#include <ipc/fb.h>
-#include <ipc/ipc.h>
-#include <ipc/ns.h>
-#include <ipc/services.h>
-#include <libarch/ddi.h>
-
-
-extern int lkbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call);
-extern int lkbd_arch_init(void);
-
-
-
-#define KEY_F1 0x504f1b
-#define KEY_F2 0x514f1b
-#define KEY_F3 0x524f1b
-#define KEY_F4 0x534f1b
-#define KEY_F5 0x7e35315b1b
-#define KEY_F6 0x7e37315b1b
-#define KEY_F7 0x7e38315b1b
-#define KEY_F8 0x7e39315b1b
-#define KEY_F9 0x7e30325b1b
-#define KEY_F10 0x7e31325b1b
-#define KEY_F11 0x7e33325b1b
-#define KEY_F12 0x7e34325b1b
-
-
-
-
-#define NSKEY_F1 0x415b5b1b
-#define NSKEY_F2 0x425b5b1b
-#define NSKEY_F3 0x435b5b1b
-#define NSKEY_F4 0x445b5b1b
-#define NSKEY_F5 0x455b5b1b
-#define NSKEY_F6 0x37315b1b
-#define NSKEY_F7 0x38315b1b
-#define NSKEY_F8 0x39315b1b
-#define NSKEY_F9 0x30325b1b
-#define NSKEY_F10 0x31325b1b
-#define NSKEY_F11 0x33325b1b
-#define NSKEY_F12 0x34325b1b
-
-
-#define FUNCTION_KEYS 0x100
-
-
-#define KBD_SKI 1
-#define	KBD_LEGACY 2
-#define	KBD_NS16550 3
-
-
-
-
-/* NS16550 registers */
-#define RBR_REG		0	/** Receiver Buffer Register. */
-#define IER_REG		1	/** Interrupt Enable Register. */
-#define IIR_REG		2	/** Interrupt Ident Register (read). */
-#define FCR_REG		2	/** FIFO control register (write). */
-#define LCR_REG		3	/** Line Control register. */
-#define MCR_REG		4	/** Modem Control Register. */
-#define LSR_REG		5	/** Line Status Register. */
-
-
-
-irq_cmd_t ns16550_cmds[1] = {
-	{ CMD_PORT_READ_1, 0, 0, 2 },
-};
-
-irq_code_t ns16550_kbd = {
-	1,
-	ns16550_cmds
-};
-
-
-uint16_t ns16550_port;
-
-int kbd_type;
-
-int kbd_arch_init(void)
-{
-	if (sysinfo_value("kbd")) {
-		kbd_type=sysinfo_value("kbd.type");
-		if (kbd_type == KBD_LEGACY)
-			return lkbd_arch_init();
-		if (kbd_type == KBD_NS16550) {
-			ns16550_kbd.cmds[0].addr = (void *) (sysinfo_value("kbd.port") + RBR_REG);
-			ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ns16550_kbd);
-			iospace_enable(task_get_id(), ns16550_port = sysinfo_value("kbd.port"), 8);
-		}
-		return 0;
-	}
-	return 1;
-}
-
-/*
-* Please preserve this code (it can be used to determine scancodes)
-*
-int to_hex(int v) 
-{
-    return "0123456789ABCDEF"[v];
-}
-*/
-#define LSR_DATA_READY	0x01
-
-int kbd_ns16550_process(keybuffer_t *keybuffer, ipc_call_t *call) 
-{
-	static unsigned long buf = 0;
-	static int count = 0, esc_count=0;	
-	
-	int scan_code = IPC_GET_ARG2(*call);
-	
-	if (scan_code == 0x1b) {
-		esc_count++;
-		if (esc_count == 3) {
-			__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE);
-		}	
-	} else {
-		esc_count = 0;
-	}
-	
-	if (scan_code == 0x0d)
-		return 1;        /* Delete CR */
-	if (scan_code == 0x7f)
-		scan_code='\b';  /* Convert backspace */
-	
-	if(scan_code == 0x7e) {
-		switch (buf) {
-		case NSKEY_F6:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 6);
-			buf = count = 0;
-			return 1;
-		case NSKEY_F7:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 7);
-			buf = count = 0;
-			return 1;
-		case NSKEY_F8:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 8);
-			buf = count = 0;
-			return 1;
-		case NSKEY_F9:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 9);
-			buf = count = 0;
-			return 1;
-		case NSKEY_F10:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 10);
-			buf = count = 0;
-			return 1;
-		case NSKEY_F11:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 11);
-			buf = count = 0;
-			return 1;
-		case NSKEY_F12:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 12);
-			buf = count = 0;
-			return 1;
-		default:
-			keybuffer_push0(keybuffer, buf & 0xff);
-			keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-			keybuffer_push0(keybuffer, (buf >> 16) &0xff);
-			keybuffer_push0(keybuffer, (buf >> 24) &0xff);
-			keybuffer_push0(keybuffer, scan_code);
-			buf = count = 0;
-			return 1;
-		}
-	}
-
-	buf |= ((unsigned long) scan_code)<<(8*(count++));
-	
-	if((buf & 0xff) != (NSKEY_F1 & 0xff)) {
-		keybuffer_push0(keybuffer, buf);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 1) 
-		return 1;
-
-	if ((buf & 0xffff) != (NSKEY_F1 & 0xffff))  {
-
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 2) 
-		return 1;
-
-
-	if ((buf & 0xffffff) != (NSKEY_F1 & 0xffffff) 
-		&& (buf & 0xffffff) != (NSKEY_F6 & 0xffffff) 
-		&& (buf & 0xffffff) != (NSKEY_F9 & 0xffffff) ) {
-
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) &0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 3) 
-		return 1;
-
-	switch (buf) {
-	case NSKEY_F1:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 1);
-		buf = count = 0;
-		return 1;
-	case NSKEY_F2:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 2);
-		buf = count = 0;
-		return 1;
-	case NSKEY_F3:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 3);
-		buf = count = 0;
-		return 1;
-	case NSKEY_F4:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 4);
-		buf = count = 0;
-		return 1;
-	case NSKEY_F5:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 5);
-		buf = count = 0;
-		return 1;
-	}
-
-
-	
-	switch (buf) {
-	case NSKEY_F6:
-	case NSKEY_F7:
-	case NSKEY_F8:
-	case NSKEY_F9:
-	case NSKEY_F10:
-	case NSKEY_F11:
-	case NSKEY_F12:
-		return 1;
-	default:
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) &0xff);
-		keybuffer_push0(keybuffer, (buf >> 24) &0xff);
-		buf = count = 0;
-		return 1;
-	}
-	return 1;
-}
-
-int kbd_ski_process(keybuffer_t *keybuffer, ipc_call_t *call) 
-{
-	static unsigned long long buf = 0;
-	static int count = 0;	
-	static int esc_count = 0;
-	int scan_code = IPC_GET_ARG2(*call);
-	
-	/*
-	 * Please preserve this code (it can be used to determine scancodes)
-	 */
-	//keybuffer_push0(keybuffer, to_hex((scan_code>>4)&0xf));
-	//keybuffer_push0(keybuffer, to_hex(scan_code&0xf));
-	//keybuffer_push0(keybuffer, ' ');
-	//keybuffer_push0(keybuffer, ' ');
-	//*/
-	
-	if (scan_code) {
-		buf |= (unsigned long long) scan_code<<(8*(count++));
-	} else {
-		
-		if (buf == 0x1b) {
-			esc_count++;
-			if (esc_count == 3) {
-				__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE);
-			}	
-		} else {
-			esc_count = 0;
-		}
-	
-		if (!(buf & 0xff00)) {
-			keybuffer_push0(keybuffer, buf);
-		} else {
-			switch (buf) {
-			case KEY_F1:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 1);
-				break;
-			case KEY_F2:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 2);
-				break;
-			case KEY_F3:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 3);
-				break;
-			case KEY_F4:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 4);
-				break;
-			case KEY_F5:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 5);
-				break;
-			case KEY_F6:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 6);
-				break;
-			case KEY_F7:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 7);
-				break;
-			case KEY_F8:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 8);
-				break;
-			case KEY_F9:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 9);
-				break;
-			case KEY_F10:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 10);
-				break;
-			case KEY_F11:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 11);
-				break;
-			case KEY_F12:
-				keybuffer_push0(keybuffer, FUNCTION_KEYS | 12);
-				break;
-			}
-		}
-		buf = count = 0;
-	}
-	return 	1;
-}
-
-int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call) 
-{
-	printf("KBD Key pressed: %x(%c)\n",IPC_GET_ARG2(*call),IPC_GET_ARG2(*call));
-	if (kbd_type == KBD_SKI)
-		return kbd_ski_process(keybuffer, call);
-	if (kbd_type == KBD_NS16550)
-		return kbd_ns16550_process(keybuffer,call);
-	if (kbd_type == KBD_LEGACY)
-		return lkbd_arch_process(keybuffer,call);
-}
-
-
-
-/**
- * @}
- */
Index: pace/srv/kbd/arch/ia64/src/lkbd.c
===================================================================
--- uspace/srv/kbd/arch/ia64/src/lkbd.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,166 +1,0 @@
-/*
- * Copyright (c) 2001-2004 Jakub Jermar
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdia64 ia64
- * @brief	HelenOS ia64
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- * @ingroup kbdia64
- */
-
-#include <arch/lkbd.h>
-#include <ipc/ipc.h>
-#include <unistd.h>
-#include <kbd.h>
-#include <keys.h>
-#include <genarch/kbd.h>
-#include <sysinfo.h>
-
-/* Interesting bits for status register */
-#define i8042_OUTPUT_FULL  0x1
-#define i8042_INPUT_FULL   0x2
-#define i8042_MOUSE_DATA   0x20
-
-/* Command constants */
-#define i8042_CMD_KBD 0x60
-#define i8042_CMD_MOUSE  0xd4
-
-/* Keyboard cmd byte */
-#define i8042_KBD_IE        0x1
-#define i8042_MOUSE_IE      0x2
-#define i8042_KBD_DISABLE   0x10
-#define i8042_MOUSE_DISABLE 0x20
-#define i8042_KBD_TRANSLATE 0x40
-
-/* Mouse constants */
-#define MOUSE_OUT_INIT  0xf4
-#define MOUSE_ACK       0xfa
-
-#define KEY_RELEASE	0x80
-
-static volatile int keyflags;		/**< Tracking of multiple keypresses. */
-static volatile int lockflags;		/**< Tracking of multiple keys lockings. */
-
-irq_cmd_t i8042_cmds[2] = {
-	{ CMD_PORT_READ_1, (void *) 0x64, 0, 1 },
-	{ CMD_PORT_READ_1, (void *) 0x60, 0, 2 }
-};
-
-irq_code_t i8042_kbd = {
-	2,
-	i8042_cmds
-};
-
-static void wait_ready(void) {
-	while (i8042_status_read() & i8042_INPUT_FULL)
-		;
-}
-
-/** Register uspace irq handler
- * @return 
- */
-int lkbd_arch_init(void)
-{
-	int i;
-	int mouseenabled = 0;
-
-	iospace_enable(task_get_id(), (void *) i8042_DATA, 5);
-	/* Disable kbd, enable mouse */
-	i8042_command_write(i8042_CMD_KBD);
-	wait_ready();
-	i8042_command_write(i8042_CMD_KBD);
-	wait_ready();
-	i8042_data_write(i8042_KBD_DISABLE);
-	wait_ready();
-
-	/* Flush all current IO */
-	while (i8042_status_read() & i8042_OUTPUT_FULL)
-		i8042_data_read();
-	
-	/* Initialize mouse */
-	i8042_command_write(i8042_CMD_MOUSE);
-	wait_ready();
-	i8042_data_write(MOUSE_OUT_INIT);
-	wait_ready();
-	
-	int mouseanswer = 0;
-	for (i=0;i < 1000; i++) {
-		int status = i8042_status_read();
-		if (status & i8042_OUTPUT_FULL) {
-			int data = i8042_data_read();
-			if (status & i8042_MOUSE_DATA) {
-				mouseanswer = data;
-				break;
-			}
-		}
-		usleep(1000);
-	}
-	if (mouseanswer == MOUSE_ACK) {
-		/* enable mouse */
-		mouseenabled = 1;
-		
-		ipc_register_irq(sysinfo_value("mouse.inr"), sysinfo_value("mouse.devno"), 0, &i8042_kbd);
-	}
-	/* Enable kbd */
-	ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &i8042_kbd);
-
-	int newcontrol = i8042_KBD_IE | i8042_KBD_TRANSLATE;
-	if (mouseenabled)
-		newcontrol |= i8042_MOUSE_IE;
-	
-	i8042_command_write(i8042_CMD_KBD);
-	wait_ready();
-	i8042_data_write(newcontrol);
-	wait_ready();
-	
-	return 0;
-}
-
-/** Process keyboard & mouse events */
-int lkbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
-{
-	int status = IPC_GET_ARG1(*call);
-
-	if ((status & i8042_MOUSE_DATA))
-		return 0;
-	
-	int scan_code = IPC_GET_ARG2(*call);
-	
-	if (scan_code & KEY_RELEASE)
-		key_released(keybuffer, scan_code ^ KEY_RELEASE);
-	else
-		key_pressed(keybuffer, scan_code);
-	return 	1;
-}
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/ia64/src/mouse.c
===================================================================
--- uspace/srv/kbd/arch/ia64/src/mouse.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,117 +1,0 @@
-/*
- * Copyright (c) 2006 Ondrej Palkovsky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <ipc/ipc.h>
-#include <async.h>
-#include <kbd.h>
-#include <keys.h>
-
-#define i8042_MOUSE_DATA   0x20
-
-#define BUFSIZE 3
-
-typedef struct {
-	union {
-		unsigned char data[BUFSIZE];
-		struct {
-			unsigned leftbtn : 1;
-			unsigned rightbtn : 1;
-			unsigned middlebtn : 1;
-			unsigned isone : 1; /* Always one */
-			unsigned xsign : 1;
-			unsigned ysign : 1;
-			unsigned xovfl : 1;
-			unsigned yovfl : 1;
-			unsigned char x;
-			unsigned char y;
-		} val;
-	}u;
-}ps2packet_t;
-
-static ps2packet_t buf;
-static int bufpos = 0;
-static int leftbtn = 0;
-static int rightbtn = 0;
-static int middlebtn = 0;
-
-/** Convert 9-bit 2-complement signed number to integer */
-static int bit9toint(int sign, unsigned char data)
-{
-	int tmp;
-
-	if (!sign)
-		return data;
-
-	tmp = ((unsigned char)~data) + 1;
-	return -tmp;
-}
-
-/** Process mouse data
- *
- * @return True if mouse command was recognized and processed
- */
-int mouse_arch_process(int phoneid, ipc_call_t *call)
-{
-	int status = IPC_GET_ARG1(*call);
-	int data = IPC_GET_ARG2(*call);
-	int x,y;
-
-	if (!(status & i8042_MOUSE_DATA))
-		return 0;
-
-	/* Check that we have not lost synchronization */
-	if (bufpos == 0 && !(data & 0x8))
-		return 1; /* Synchro lost, ignore byte */
-
-	buf.u.data[bufpos++] = data;
-	if (bufpos == BUFSIZE) {
-		bufpos = 0;
-		if (phoneid != -1) {
-			if (buf.u.val.leftbtn ^ leftbtn) {
-				leftbtn = buf.u.val.leftbtn;
-				async_msg_1(phoneid, KBD_MS_LEFT, leftbtn);
-			}
-			if (buf.u.val.rightbtn & rightbtn) {
-				rightbtn = buf.u.val.middlebtn;
-				async_msg_1(phoneid, KBD_MS_RIGHT, rightbtn);
-			}
-			if (buf.u.val.rightbtn & rightbtn) {
-				middlebtn = buf.u.val.middlebtn;
-				async_msg_1(phoneid, KBD_MS_MIDDLE, middlebtn);
-			}
-			x = bit9toint(buf.u.val.xsign, buf.u.val.x);
-			y = bit9toint(buf.u.val.ysign, buf.u.val.y);
-			if (x || y)
-				async_msg_2(phoneid, KBD_MS_MOVE, (ipcarg_t)x,
-				    (ipcarg_t)(-y));
-		}
-	}
-
-	
-	return 1;
-}
Index: pace/srv/kbd/arch/ia64/src/scanc.c
===================================================================
--- uspace/srv/kbd/arch/ia64/src/scanc.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,202 +1,0 @@
-/*
- * Copyright (c) 2001-2004 Jakub Jermar
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdia32
- * @brief	Scancodes for PC keyboards.
- * @{
- */ 
-/** @file
- * @ingroup kbdamd64
- */
-
-#include <genarch/scanc.h>
-
-/** Primary meaning of scancodes. */
-int sc_primary_map[] = {
-	SPECIAL, /* 0x00 */
-	SPECIAL, /* 0x01 - Esc */
-	'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',
-	'\b', /* 0x0e - Backspace */
-	'\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
-	SPECIAL, /* 0x1d - LCtrl */
-	'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'',
-	'`',
-	SPECIAL, /* 0x2a - LShift */ 
-	'\\',
-	'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/',
-	SPECIAL, /* 0x36 - RShift */
-	'*',
-	SPECIAL, /* 0x38 - LAlt */
-	' ',
-	SPECIAL, /* 0x3a - CapsLock */
-	(FUNCTION_KEYS | 1), /* 0x3b - F1 */
-	(FUNCTION_KEYS | 2), /* 0x3c - F2 */
-	(FUNCTION_KEYS | 3), /* 0x3d - F3 */
-	(FUNCTION_KEYS | 4), /* 0x3e - F4 */
-	(FUNCTION_KEYS | 5), /* 0x3f - F5 */
-	(FUNCTION_KEYS | 6), /* 0x40 - F6 */
-	(FUNCTION_KEYS | 7), /* 0x41 - F7 */
-	(FUNCTION_KEYS | 8), /* 0x42 - F8 */
-	(FUNCTION_KEYS | 9), /* 0x43 - F9 */
-	(FUNCTION_KEYS | 10), /* 0x44 - F10 */
-	SPECIAL, /* 0x45 - NumLock */
-	SPECIAL, /* 0x46 - ScrollLock */
-	'7', '8', '9', '-',
-	'4', '5', '6', '+',
-	'1', '2', '3',
-	'0', '.',
-	SPECIAL, /* 0x54 - Alt-SysRq */
-	SPECIAL, /* 0x55 - F11/F12/PF1/FN */
-	SPECIAL, /* 0x56 - unlabelled key next to LAlt */
-	(FUNCTION_KEYS | 11), /* 0x57 - F11 */
-	(FUNCTION_KEYS | 12), /* 0x58 - F12 */
-	SPECIAL, /* 0x59 */
-	SPECIAL, /* 0x5a */
-	SPECIAL, /* 0x5b */
-	SPECIAL, /* 0x5c */
-	SPECIAL, /* 0x5d */
-	SPECIAL, /* 0x5e */
-	SPECIAL, /* 0x5f */
-	SPECIAL, /* 0x60 */
-	SPECIAL, /* 0x61 */
-	SPECIAL, /* 0x62 */
-	SPECIAL, /* 0x63 */
-	SPECIAL, /* 0x64 */
-	SPECIAL, /* 0x65 */
-	SPECIAL, /* 0x66 */
-	SPECIAL, /* 0x67 */
-	SPECIAL, /* 0x68 */
-	SPECIAL, /* 0x69 */
-	SPECIAL, /* 0x6a */
-	SPECIAL, /* 0x6b */
-	SPECIAL, /* 0x6c */
-	SPECIAL, /* 0x6d */
-	SPECIAL, /* 0x6e */
-	SPECIAL, /* 0x6f */
-	SPECIAL, /* 0x70 */
-	SPECIAL, /* 0x71 */
-	SPECIAL, /* 0x72 */
-	SPECIAL, /* 0x73 */
-	SPECIAL, /* 0x74 */
-	SPECIAL, /* 0x75 */
-	SPECIAL, /* 0x76 */
-	SPECIAL, /* 0x77 */
-	SPECIAL, /* 0x78 */
-	SPECIAL, /* 0x79 */
-	SPECIAL, /* 0x7a */
-	SPECIAL, /* 0x7b */
-	SPECIAL, /* 0x7c */
-	SPECIAL, /* 0x7d */
-	SPECIAL, /* 0x7e */
-	SPECIAL, /* 0x7f */
-};
-
-/** Secondary meaning of scancodes. */
-int sc_secondary_map[] = {
-	SPECIAL, /* 0x00 */
-	0x1b, /* 0x01 - Esc */
-	'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
-	SPECIAL, /* 0x0e - Backspace */
-	'\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
-	SPECIAL, /* 0x1d - LCtrl */
-	'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"',
-	'~',
-	SPECIAL, /* 0x2a - LShift */ 
-	'|',
-	'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?',
-	SPECIAL, /* 0x36 - RShift */
-	'*',
-	SPECIAL, /* 0x38 - LAlt */
-	' ',
-	SPECIAL, /* 0x3a - CapsLock */
-	SPECIAL, /* 0x3b - F1 */
-	SPECIAL, /* 0x3c - F2 */
-	SPECIAL, /* 0x3d - F3 */
-	SPECIAL, /* 0x3e - F4 */
-	SPECIAL, /* 0x3f - F5 */
-	SPECIAL, /* 0x40 - F6 */
-	SPECIAL, /* 0x41 - F7 */
-	SPECIAL, /* 0x42 - F8 */
-	SPECIAL, /* 0x43 - F9 */
-	SPECIAL, /* 0x44 - F10 */
-	SPECIAL, /* 0x45 - NumLock */
-	SPECIAL, /* 0x46 - ScrollLock */
-	'7', '8', '9', '-',
-	'4', '5', '6', '+',
-	'1', '2', '3',
-	'0', '.',
-	SPECIAL, /* 0x54 - Alt-SysRq */
-	SPECIAL, /* 0x55 - F11/F12/PF1/FN */
-	SPECIAL, /* 0x56 - unlabelled key next to LAlt */
-	SPECIAL, /* 0x57 - F11 */
-	SPECIAL, /* 0x58 - F12 */
-	SPECIAL, /* 0x59 */
-	SPECIAL, /* 0x5a */
-	SPECIAL, /* 0x5b */
-	SPECIAL, /* 0x5c */
-	SPECIAL, /* 0x5d */
-	SPECIAL, /* 0x5e */
-	SPECIAL, /* 0x5f */
-	SPECIAL, /* 0x60 */
-	SPECIAL, /* 0x61 */
-	SPECIAL, /* 0x62 */
-	SPECIAL, /* 0x63 */
-	SPECIAL, /* 0x64 */
-	SPECIAL, /* 0x65 */
-	SPECIAL, /* 0x66 */
-	SPECIAL, /* 0x67 */
-	SPECIAL, /* 0x68 */
-	SPECIAL, /* 0x69 */
-	SPECIAL, /* 0x6a */
-	SPECIAL, /* 0x6b */
-	SPECIAL, /* 0x6c */
-	SPECIAL, /* 0x6d */
-	SPECIAL, /* 0x6e */
-	SPECIAL, /* 0x6f */
-	SPECIAL, /* 0x70 */
-	SPECIAL, /* 0x71 */
-	SPECIAL, /* 0x72 */
-	SPECIAL, /* 0x73 */
-	SPECIAL, /* 0x74 */
-	SPECIAL, /* 0x75 */
-	SPECIAL, /* 0x76 */
-	SPECIAL, /* 0x77 */
-	SPECIAL, /* 0x78 */
-	SPECIAL, /* 0x79 */
-	SPECIAL, /* 0x7a */
-	SPECIAL, /* 0x7b */
-	SPECIAL, /* 0x7c */
-	SPECIAL, /* 0x7d */
-	SPECIAL, /* 0x7e */
-	SPECIAL, /* 0x7f */	
-};
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/mips32/include/kbd.h
===================================================================
--- uspace/srv/kbd/arch/mips32/include/kbd.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdmips32 mips32
- * @brief	HelenOS mips32 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#ifndef KBD_mips32_KBD_H_
-#define KBD_mips32_KBD_H_
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/arch/mips32/src/kbd.c
===================================================================
--- uspace/srv/kbd/arch/mips32/src/kbd.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,238 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdmips32 mips32
- * @brief	HelenOS mips32 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-#include <arch/kbd.h>
-#include <genarch/nofb.h>
-#include <ipc/ipc.h>
-#include <sysinfo.h>
-#include <kbd.h>
-#include <keys.h>
-
-#define MSIM_KEY_F1 0x504f1bL
-#define MSIM_KEY_F2 0x514f1bL
-#define MSIM_KEY_F3 0x524f1bL
-#define MSIM_KEY_F4 0x534f1bL
-#define MSIM_KEY_F5 0x35315b1bL
-#define MSIM_KEY_F6 0x37315b1bL
-#define MSIM_KEY_F7 0x38315b1bL
-#define MSIM_KEY_F8 0x39315b1bL
-#define MSIM_KEY_F9 0x30325b1bL
-#define MSIM_KEY_F10 0x31325b1bL
-#define MSIM_KEY_F11 0x33325b1bL
-#define MSIM_KEY_F12 0x34325b1bL
-
-#define GXEMUL_KEY_F1 0x504f5b1bL
-#define GXEMUL_KEY_F2 0x514f5b1bL
-#define GXEMUL_KEY_F3 0x524f5b1bL
-#define GXEMUL_KEY_F4 0x534f5b1bL
-#define GXEMUL_KEY_F5 0x35315b1bL
-#define GXEMUL_KEY_F6 0x37315b1bL
-#define GXEMUL_KEY_F7 0x38315b1bL
-#define GXEMUL_KEY_F8 0x39315b1bL
-#define GXEMUL_KEY_F9 0x38325b1bL
-#define GXEMUL_KEY_F10 0x39325b1bL
-#define GXEMUL_KEY_F11 0x33325b1bL
-#define GXEMUL_KEY_F12 0x34325b1bL
-
-#define FUNCTION_KEYS 0x100
-
-irq_cmd_t msim_cmds[1] = {
-	{ CMD_MEM_READ_1, (void *) 0, 0, 2 }
-};
-
-irq_code_t msim_kbd = {
-	1,
-	msim_cmds
-};
-
-static int msim,gxemul;
-static int fb_fb;
-
-
-int kbd_arch_init(void)
-{
-	fb_fb = (sysinfo_value("fb.kind") == 1);
-	msim_cmds[0].addr = sysinfo_value("kbd.address.virtual");
-	ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &msim_kbd);
-	return 0;
-}
-
-
-/*
-//*
-//* Please preserve this code (it can be used to determine scancodes)
-//*
-int to_hex(int v) 
-{
-        return "0123456789ABCDEF"[v];
-}
-*/
-
-static int kbd_arch_process_fb(keybuffer_t *keybuffer, int scan_code)
-{
-	static unsigned long buf = 0;
-	static int count = 0;
-
-	/* Please preserve this code (it can be used to determine scancodes)
-	
-	keybuffer_push0(keybuffer, to_hex((scan_code>>4)&0xf));
-	keybuffer_push0(keybuffer, to_hex(scan_code&0xf));
-	keybuffer_push0(keybuffer, ' ');
-	keybuffer_push0(keybuffer, ' ');
-	
-	return 1;
-	*/
-	
-	if (scan_code == '\r')
-		scan_code = '\n';
-	
-	buf |= ((unsigned long) scan_code)<<(8*(count++));
-	
-	
-	if ((buf & 0xff) != (GXEMUL_KEY_F1 & 0xff)) {
-		keybuffer_push0(keybuffer, buf);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 1)
-		return 1;
-
-	if ((buf & 0xffff) != (GXEMUL_KEY_F1 & 0xffff)) {
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 2) 
-		return 1;
-
-
-	if ((buf & 0xffffff) != (GXEMUL_KEY_F1 & 0xffffff)
-		&& (buf & 0xffffff) != (GXEMUL_KEY_F5 & 0xffffff)
-		&& (buf & 0xffffff) != (GXEMUL_KEY_F9 & 0xffffff)) {
-
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) & 0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if ( count <= 3 ) 
-		return 1;
-	
-
-	switch (buf) {
-	case GXEMUL_KEY_F1:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 1 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F2:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 2 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F3:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 3 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F4:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 4 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F5:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 5 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F6:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 6 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F7:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 7 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F8:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 8 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F9:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 9 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F10:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 10 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F11:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 11 );
-		buf=count=0;
-		return 1;
-	case GXEMUL_KEY_F12:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 12 );
-		buf=count=0;
-		return 1;
-	default:
-		keybuffer_push0(keybuffer, buf & 0xff );
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff );
-		keybuffer_push0(keybuffer, (buf >> 16) &0xff );
-		keybuffer_push0(keybuffer, (buf >> 24) &0xff );
-		buf=count=0;
-		return 1;
-	}
-	return 1;
-}
-
-int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
-{
-	int scan_code = IPC_GET_ARG2(*call);
-	static int esc_count=0;
-
-	if (scan_code == 0x1b) {
-		esc_count++;
-		if (esc_count == 3)
-			__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE);
-	} else {
-		esc_count=0;
-	}
-
-	if (fb_fb)
-		return kbd_arch_process_fb(keybuffer, scan_code);
-
-	return kbd_process_no_fb(keybuffer, scan_code);
-}
-/** @}
-*/
Index: pace/srv/kbd/arch/mips32eb
===================================================================
--- uspace/srv/kbd/arch/mips32eb	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,1 +1,0 @@
-mips32
Index: pace/srv/kbd/arch/ppc32/include/kbd.h
===================================================================
--- uspace/srv/kbd/arch/ppc32/include/kbd.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdppc32 ppc32
- * @brief	HelenOS ppc32 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#ifndef KBD_ppc32_KBD_H_
-#define KBD_ppc32_KBD_H_
-
-#endif
-
-/** @}
- */
-
Index: pace/srv/kbd/arch/ppc32/src/kbd.c
===================================================================
--- uspace/srv/kbd/arch/ppc32/src/kbd.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,203 +1,0 @@
-/*
- * Copyright (c) 2006 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdppc32 ppc32
- * @brief	HelenOS ppc32 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#include <arch/kbd.h>
-#include <ipc/ipc.h>
-#include <sysinfo.h>
-#include <kbd.h>
-#include <keys.h>
-
-
-#define SPECIAL		255
-#define FUNCTION_KEYS 0x100
-
-
-static int lchars[0x80] = {
-	'a',
-	's',
-	'd',
-	'f',
-	'h',
-	'g',
-	'z',
-	'x',
-	'c',
-	'v', 
-	SPECIAL,
-	'b',
-	'q',
-	'w',
-	'e',
-	'r',
-	'y',
-	't',
-	'1',
-	'2',
-	'3',
-	'4',
-	'6',
-	'5',
-	'=',
-	'9',
-	'7',
-	'-',
-	'8',
-	'0',
-	']',
-	'o',
-	'u',
-	'[',
-	'i', 
-	'p',
-	'\n',                 /* Enter */
-	'l',
-	'j',
-	'\'',
-	'k',
-	';',
-	'\\',
-	',',
-	'/',
-	'n',
-	'm',
-	'.',
-	'\t',                 /* Tab */
-	' ',
-	'`',
-	'\b',                 /* Backspace */
-	SPECIAL,
-	SPECIAL,              /* Escape */
-	SPECIAL,              /* Ctrl */
-	SPECIAL,              /* Alt */
-	SPECIAL,              /* Shift */
-	SPECIAL,              /* Caps-Lock */
-	SPECIAL,              /* RAlt */
-	SPECIAL,              /* Left */
-	SPECIAL,              /* Right */
-	SPECIAL,              /* Down */
-	SPECIAL,              /* Up */
-	SPECIAL, 
-	SPECIAL,
-	'.',                  /* Keypad . */
-	SPECIAL, 
-	'*',                  /* Keypad * */
-	SPECIAL,
-	'+',                  /* Keypad + */
-	SPECIAL,
-	SPECIAL,              /* NumLock */
-	SPECIAL,
-	SPECIAL,
-	SPECIAL,
-	'/',                  /* Keypad / */
-	'\n',                 /* Keypad Enter */
-	SPECIAL,
-	'-',                  /* Keypad - */
-	SPECIAL,
-	SPECIAL,
-	SPECIAL,
-	'0',                  /* Keypad 0 */
-	'1',                  /* Keypad 1 */
-	'2',                  /* Keypad 2 */
-	'3',                  /* Keypad 3 */
-	'4',                  /* Keypad 4 */
-	'5',                  /* Keypad 5 */
-	'6',                  /* Keypad 6 */
-	'7',                  /* Keypad 7 */
-	SPECIAL,
-	'8',                  /* Keypad 8 */
-	'9',                  /* Keypad 9 */
-	SPECIAL,
-	SPECIAL,
-	SPECIAL,
-	(FUNCTION_KEYS | 5),  /* F5 */
-	(FUNCTION_KEYS | 6),  /* F6 */
-	(FUNCTION_KEYS | 7),  /* F7 */
-	(FUNCTION_KEYS | 3),  /* F3 */
-	(FUNCTION_KEYS | 8),  /* F8 */
-	(FUNCTION_KEYS | 9),  /* F9 */
-	SPECIAL,
-	(FUNCTION_KEYS | 11), /* F11 */
-	SPECIAL,
-	(FUNCTION_KEYS | 13), /* F13 */
-	SPECIAL,
-	SPECIAL,              /* ScrollLock */
-	SPECIAL,
-	(FUNCTION_KEYS | 10), /* F10 */
-	SPECIAL,
-	(FUNCTION_KEYS | 12), /* F12 */
-	SPECIAL,
-	SPECIAL,              /* Pause */
-	SPECIAL,              /* Insert */
-	SPECIAL,              /* Home */
-	SPECIAL,              /* PageUp */
-	SPECIAL,              /* Delete */
-	(FUNCTION_KEYS | 4),  /* F4 */
-	SPECIAL,              /* End */
-	(FUNCTION_KEYS | 2),  /* F2 */
-	SPECIAL,              /* PageDown */
-	(FUNCTION_KEYS | 1)   /* F1 */
-};
-
-
-int kbd_arch_init(void)
-{
-	if (!sysinfo_value("kbd"))
-		return 0;
-	
-	return ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, 0);
-}
-
-
-int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call) 
-{
-	int param = IPC_GET_ARG2(*call);
-
-	if (param != -1) {
-		uint8_t scancode = (uint8_t) param;
-	
-		if ((scancode & 0x80) != 0x80) {
-			int key = lchars[scancode & 0x7f];
-			
-			if (key != SPECIAL)
-				keybuffer_push0(keybuffer, key);
-		}
-	}
-	
-	return 1;
-}
-
-/** @}
- */
Index: pace/srv/kbd/arch/sparc64/include/kbd.h
===================================================================
--- uspace/srv/kbd/arch/sparc64/include/kbd.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdsparc64 sparc64
- * @brief	HelenOS sparc64 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#ifndef KBD_sparc64_KBD_H_
-#define KBD_sparc64_KBD_H_
-
-#endif
-
-/** @}
- */
Index: pace/srv/kbd/arch/sparc64/include/scanc.h
===================================================================
--- uspace/srv/kbd/arch/sparc64/include/scanc.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/*
- * Copyright (c) 2006 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup genarch	
- * @{
- */
-/**
- * @file
- * @brief	Scan codes for sun keyboards.
- */
-
-#ifndef KBD_SCANC_SUN_H_
-#define KBD_SCANC_SUN_H_
-
-#define SC_ESC		0x1d
-#define SC_BACKSPACE	0x2b
-#define SC_LSHIFT       0x63
-#define SC_RSHIFT       0x6e
-#define SC_CAPSLOCK     0x77
-#define SC_SPEC_ESCAPE  0xe0	/* ??? */
-#define SC_LEFTARR      0x18
-#define SC_RIGHTARR     0x1c
-#define SC_UPARR        0x14
-#define SC_DOWNARR      0x1b
-#define SC_DELETE       0x42
-#define SC_HOME         0x34
-#define SC_END          0x4a
-
-#endif
-
-/** @}
- */
Index: pace/srv/kbd/arch/sparc64/include/sgcn.h
===================================================================
--- uspace/srv/kbd/arch/sparc64/include/sgcn.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2008 Pavel Rimsky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdsparc64 sparc64
- * @brief	Serengeti-specific parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#ifndef KBD_sparc64_SGCN_H_
-#define KBD_sparc64_SGCN_H_
-
-void sgcn_init(void);
-void sgcn_key_pressed(void);
-
-#endif
-
-/** @}
- */
Index: pace/srv/kbd/arch/sparc64/src/kbd.c
===================================================================
--- uspace/srv/kbd/arch/sparc64/src/kbd.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,127 +1,0 @@
-/*
- * Copyright (c) 2006 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdsparc64 sparc64
- * @brief	HelenOS sparc64 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#include <arch/kbd.h>
-#include <arch/sgcn.h>
-#include <ipc/ipc.h>
-#include <sysinfo.h>
-#include <kbd.h>
-#include <keys.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <genarch/kbd.h>
-
-#define KBD_KEY_RELEASE		0x80
-#define KBD_ALL_KEYS_UP		0x7f
-
-/** Top-half pseudocode for z8530. */
-irq_cmd_t z8530_cmds[] = {
-	{
-		CMD_MEM_READ_1,
-		0,			/**< Address. Will be patched in run-time. */
-		0,			/**< Value. Not used. */
-		1			/**< Arg 1 will contain the result. */
-	}
-};
-	
-irq_code_t z8530_kbd = {
-	1,
-	z8530_cmds
-};
-
-/** Top-half pseudocode for ns16550. */
-irq_cmd_t ns16550_cmds[] = {
-	{
-		CMD_MEM_READ_1,
-		0,			/**< Address. Will be patched in run-time. */
-		0,			/**< Value. Not used. */
-		1			/**< Arg 1 will contain the result. */
-	}
-};
-	
-irq_code_t ns16550_kbd = {
-	1,
-	ns16550_cmds
-};
-
-#define KBD_Z8530	1
-#define KBD_NS16550	2
-#define KBD_SGCN	3
-
-int kbd_arch_init(void)
-{
-	int type = sysinfo_value("kbd.type");
-	switch (type) {
-	case KBD_Z8530:
-		z8530_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual") + 6;
-		ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &z8530_kbd);
-		break;
-	case KBD_NS16550:
-		ns16550_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual");
-		ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ns16550_kbd);
-		break;
-	case KBD_SGCN:
-		sgcn_init();
-		break;
-	default:
-		break;
-	}
-	return 0;
-}
-
-/** Process keyboard events */
-int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
-{
-	if (sysinfo_value("kbd.type") == KBD_SGCN) {
-		sgcn_key_pressed();
-		return 1;
-	}
-	
-	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;
-}
-
-/** @}
- */
Index: pace/srv/kbd/arch/sparc64/src/scanc.c
===================================================================
--- uspace/srv/kbd/arch/sparc64/src/scanc.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,304 +1,0 @@
-/*
- * Copyright (c) 2006 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup genarch	
- * @{
- */
-/**
- * @file
- * @brief	Scan codes for Sun keyboards.
- */
-
-#include <genarch/scanc.h>
-
-/** Primary meaning of scancodes. */
-int sc_primary_map[] = {
-	[0x00] = SPECIAL,
-	[0x01] = SPECIAL,
-	[0x02] = SPECIAL,
-	[0x03] = SPECIAL,
-	[0x04] = SPECIAL,
-	[0x05] = FUNCTION_KEYS + 1,	/* F1 */
-	[0x06] = FUNCTION_KEYS + 2,	/* F2 */
-	[0x07] = FUNCTION_KEYS + 10,	/* F10 */
-	[0x08] = FUNCTION_KEYS + 3,	/* F3 */
-	[0x09] = FUNCTION_KEYS + 11,	/* F11 */
-	[0x0a] = FUNCTION_KEYS + 4,	/* F4 */
-	[0x0b] = FUNCTION_KEYS + 12,	/* F12 */
-	[0x0c] = FUNCTION_KEYS + 5,	/* F5 */
-	[0x0d] = SPECIAL,	/* RAlt */
-	[0x0e] = FUNCTION_KEYS + 6,	/* F6 */
-	[0x0f] = SPECIAL,
-	[0x10] = FUNCTION_KEYS + 7,	/* F7 */
-	[0x11] = FUNCTION_KEYS + 8,	/* F8 */
-	[0x12] = FUNCTION_KEYS + 9,	/* F9 */
-	[0x13] = SPECIAL,	/* LAlt */
-	[0x14] = SPECIAL,	/* Up Arrow */
-	[0x15] = SPECIAL,	/* Pause */
-	[0x16] = SPECIAL,
-	[0x17] = SPECIAL,	/* Scroll Lock */
-	[0x18] = SPECIAL,	/* Left Arrow */
-	[0x19] = SPECIAL,
-	[0x1a] = SPECIAL,
-	[0x1b] = SPECIAL,	/* Down Arrow */
-	[0x1c] = SPECIAL,	/* Right Arrow */
-	[0x1d] = SPECIAL,	/* Esc */
-	[0x1e] = '1',
-	[0x1f] = '2',
-	[0x20] = '3',
-	[0x21] = '4',
-	[0x22] = '5',
-	[0x23] = '6',
-	[0x24] = '7',
-	[0x25] = '8',
-	[0x26] = '9',
-	[0x27] = '0',
-	[0x28] = '-',
-	[0x29] = '=',
-	[0x2a] = '`',
-	[0x2b] = '\b',		/* Backspace */
-	[0x2c] = SPECIAL,	/* Insert */
-	[0x2d] = SPECIAL,
-	[0x2e] = '/',		/* numeric keypad */
-	[0x2f] = '*',		/* numeric keypad */
-	[0x30] = SPECIAL,
-	[0x31] = SPECIAL,
-	[0x32] = '.',		/* numeric keypad */
-	[0x33] = SPECIAL,
-	[0x34] = SPECIAL,	/* Home */
-	[0x35] = '\t',		/* Tab */
-	[0x36] = 'q',
-	[0x37] = 'w',
-	[0x38] = 'e',
-	[0x39] = 'r',
-	[0x3a] = 't',
-	[0x3b] = 'y',
-	[0x3c] = 'u',
-	[0x3d] = 'i',
-	[0x3e] = 'o',
-	[0x3f] = 'p',
-	[0x40] = '[',
-	[0x41] = ']',
-	[0x42] = SPECIAL,	/* Del */
-	[0x43] = SPECIAL,
-	[0x44] = '7',		/* numeric keypad */
-	[0x45] = '8',		/* numeric keypad */
-	[0x46] = '9',		/* numeric keypad */
-	[0x47] = '-',		/* numeric keypad */
-	[0x48] = SPECIAL,
-	[0x49] = SPECIAL,
-	[0x4a] = SPECIAL,	/* End */
-	[0x4b] = SPECIAL,
-	[0x4c] = SPECIAL,	/* Control */
-	[0x4d] = 'a',
-	[0x4e] = 's',
-	[0x4f] = 'd',
-	[0x50] = 'f',
-	[0x51] = 'g',
-	[0x52] = 'h',
-	[0x53] = 'j',
-	[0x54] = 'k',
-	[0x55] = 'l',
-	[0x56] = ';',
-	[0x57] = '\'',
-	[0x58] = '\\',
-	[0x59] = '\n',		/* Enter */
-	[0x5a] = '\n',		/* Enter on numeric keypad */
-	[0x5b] = '4',		/* numeric keypad */
-	[0x5c] = '5',		/* numeric keypad */
-	[0x5d] = '6',		/* numeric keypad */
-	[0x5e] = '0',		/* numeric keypad */
-	[0x5f] = SPECIAL,
-	[0x60] = SPECIAL,	/* Page Up */
-	[0x61] = SPECIAL,
-	[0x62] = SPECIAL,	/* Num Lock */
-	[0x63] = SPECIAL,	/* LShift */
-	[0x64] = 'z',
-	[0x65] = 'x',
-	[0x66] = 'c',
-	[0x67] = 'v',
-	[0x68] = 'b',
-	[0x69] = 'n',
-	[0x6a] = 'm',
-	[0x6b] = ',',
-	[0x6c] = '.',
-	[0x6d] = '/',
-	[0x6e] = SPECIAL,	/* RShift */
-	[0x6f] = SPECIAL,
-	[0x70] = '1',		/* numeric keypad */
-	[0x71] = '2',		/* numeric keypad */
-	[0x72] = '3',		/* numeric keypad */
-	[0x73] = SPECIAL,
-	[0x74] = SPECIAL,
-	[0x75] = SPECIAL,
-	[0x76] = SPECIAL,
-	[0x77] = SPECIAL,	/* Caps Lock */
-	[0x78] = SPECIAL,
-	[0x79] = ' ',
-	[0x7a] = SPECIAL,
-	[0x7b] = SPECIAL,	/* Page Down */
-	[0x7c] = SPECIAL,
-	[0x7d] = '+',		/* numeric key pad */
-	[0x7e] = SPECIAL,
-	[0x7f] = SPECIAL
-};
-
-/** Secondary meaning of scancodes. */
-int sc_secondary_map[] = {
-	[0x00] = SPECIAL,
-	[0x01] = SPECIAL,
-	[0x02] = SPECIAL,
-	[0x03] = SPECIAL,
-	[0x04] = SPECIAL,
-	[0x05] = SPECIAL,	/* F1 */
-	[0x06] = SPECIAL,	/* F2 */
-	[0x07] = SPECIAL,	/* F10 */
-	[0x08] = SPECIAL,	/* F3 */
-	[0x09] = SPECIAL,	/* F11 */
-	[0x0a] = SPECIAL,	/* F4 */
-	[0x0b] = SPECIAL,	/* F12 */
-	[0x0c] = SPECIAL,	/* F5 */
-	[0x0d] = SPECIAL,	/* RAlt */
-	[0x0e] = SPECIAL,	/* F6 */
-	[0x0f] = SPECIAL,
-	[0x10] = SPECIAL,	/* F7 */
-	[0x11] = SPECIAL,	/* F8 */
-	[0x12] = SPECIAL,	/* F9 */
-	[0x13] = SPECIAL,	/* LAlt */
-	[0x14] = SPECIAL,	/* Up Arrow */
-	[0x15] = SPECIAL,	/* Pause */
-	[0x16] = SPECIAL,
-	[0x17] = SPECIAL,	/* Scroll Lock */
-	[0x18] = SPECIAL,	/* Left Arrow */
-	[0x19] = SPECIAL,
-	[0x1a] = SPECIAL,
-	[0x1b] = SPECIAL,	/* Down Arrow */
-	[0x1c] = SPECIAL,	/* Right Arrow */
-	[0x1d] = SPECIAL,	/* Esc */
-	[0x1e] = '!',
-	[0x1f] = '@',
-	[0x20] = '#',
-	[0x21] = '$',
-	[0x22] = '%',
-	[0x23] = '^',
-	[0x24] = '&',
-	[0x25] = '*',
-	[0x26] = '(',
-	[0x27] = ')',
-	[0x28] = '_',
-	[0x29] = '+',
-	[0x2a] = '~',
-	[0x2b] = SPECIAL,	/* Backspace */
-	[0x2c] = SPECIAL,	/* Insert */
-	[0x2d] = SPECIAL,
-	[0x2e] = '/',		/* numeric keypad */
-	[0x2f] = '*',		/* numeric keypad */
-	[0x30] = SPECIAL,
-	[0x31] = SPECIAL,
-	[0x32] = '.',		/* numeric keypad */
-	[0x33] = SPECIAL,
-	[0x34] = SPECIAL,	/* Home */
-	[0x35] = SPECIAL,	/* Tab */
-	[0x36] = 'Q',
-	[0x37] = 'W',
-	[0x38] = 'E',
-	[0x39] = 'R',
-	[0x3a] = 'T',
-	[0x3b] = 'Y',
-	[0x3c] = 'U',
-	[0x3d] = 'I',
-	[0x3e] = 'O',
-	[0x3f] = 'P',
-	[0x40] = '{',
-	[0x41] = '}',
-	[0x42] = SPECIAL,	/* Del */
-	[0x43] = SPECIAL,
-	[0x44] = '7',		/* numeric keypad */
-	[0x45] = '8',		/* numeric keypad */
-	[0x46] = '9',		/* numeric keypad */
-	[0x47] = '-',		/* numeric keypad */
-	[0x48] = SPECIAL,
-	[0x49] = SPECIAL,
-	[0x4a] = SPECIAL,	/* End */
-	[0x4b] = SPECIAL,
-	[0x4c] = SPECIAL,	/* Control */
-	[0x4d] = 'A',
-	[0x4e] = 'S',
-	[0x4f] = 'D',
-	[0x50] = 'F',
-	[0x51] = 'G',
-	[0x52] = 'H',
-	[0x53] = 'J',
-	[0x54] = 'K',
-	[0x55] = 'L',
-	[0x56] = ':',
-	[0x57] = '"',
-	[0x58] = '|',
-	[0x59] = SPECIAL,	/* Enter */
-	[0x5a] = SPECIAL,	/* Enter on numeric keypad */
-	[0x5b] = '4',		/* numeric keypad */
-	[0x5c] = '5',		/* numeric keypad */
-	[0x5d] = '6',		/* numeric keypad */
-	[0x5e] = '0',		/* numeric keypad */
-	[0x5f] = SPECIAL,
-	[0x60] = SPECIAL,	/* Page Up */
-	[0x61] = SPECIAL,
-	[0x62] = SPECIAL,	/* Num Lock */
-	[0x63] = SPECIAL,	/* LShift */
-	[0x64] = 'Z',
-	[0x65] = 'X',
-	[0x66] = 'C',
-	[0x67] = 'V',
-	[0x68] = 'B',
-	[0x69] = 'N',
-	[0x6a] = 'M',
-	[0x6b] = '<',
-	[0x6c] = '>',
-	[0x6d] = '?',
-	[0x6e] = SPECIAL,	/* RShift */
-	[0x6f] = SPECIAL,
-	[0x70] = '1',		/* numeric keypad */
-	[0x71] = '2',		/* numeric keypad */
-	[0x72] = '3',		/* numeric keypad */
-	[0x73] = SPECIAL,
-	[0x74] = SPECIAL,
-	[0x75] = SPECIAL,
-	[0x76] = SPECIAL,
-	[0x77] = SPECIAL,	/* Caps Lock */
-	[0x78] = SPECIAL,
-	[0x79] = ' ',
-	[0x7a] = SPECIAL,
-	[0x7b] = SPECIAL,	/* Page Down */
-	[0x7c] = SPECIAL,
-	[0x7d] = '+',		/* numeric key pad */
-	[0x7e] = SPECIAL,
-	[0x7f] = SPECIAL
-};
-
-/** @}
- */
Index: pace/srv/kbd/arch/sparc64/src/sgcn.c
===================================================================
--- uspace/srv/kbd/arch/sparc64/src/sgcn.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,141 +1,0 @@
-/*
- * Copyright (c) 2008 Pavel Rimsky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdsparc64 sparc64
- * @brief	Serengeti-specific parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#include <arch/sgcn.h>
-#include <as.h>
-#include <ddi.h>
-#include <ipc/ipc.h>
-#include <kbd.h>
-#include <genarch/nofb.h>
-#include <genarch/kbd.h>
-#include <sysinfo.h>
-#include <stdio.h>
-#include <futex.h>
-
-/**
- * SGCN buffer header. It is placed at the very beginning of the SGCN
- * buffer. 
- */
-typedef struct {
-	/** hard-wired to "CON" */
-	char magic[4];
-	
-	/** we don't need this */
-	char unused[8];
-	
-	/** offset within the SGCN buffer of the input buffer start */
-	uint32_t in_begin;
-	
-	/** offset within the SGCN buffer of the input buffer end */
-	uint32_t in_end;
-	
-	/** offset within the SGCN buffer of the input buffer read pointer */
-	uint32_t in_rdptr;
-	
-	/** offset within the SGCN buffer of the input buffer write pointer */
-	uint32_t in_wrptr;
-} __attribute__ ((packed)) sgcn_buffer_header_t;
-
-/*
- * Returns a pointer to the object of a given type which is placed at the given
- * offset from the console buffer beginning.
- */
-#define SGCN_BUFFER(type, offset) \
-		((type *) (sram_virt_addr + sram_buffer_offset + (offset)))
-
-/** Returns a pointer to the console buffer header. */
-#define SGCN_BUFFER_HEADER	(SGCN_BUFFER(sgcn_buffer_header_t, 0))
-
-extern keybuffer_t keybuffer;
-
-/**
- * Virtual address mapped to SRAM.
- */
-static uintptr_t sram_virt_addr;
-
-/**
- * SGCN buffer offset within SGCN.
- */
-static uintptr_t sram_buffer_offset;
-
-/**
- * Initializes the SGCN driver.
- * Maps the physical memory (SRAM) and registers the interrupt. 
- */
-void sgcn_init(void)
-{
-	sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size"));
-	if (physmem_map((void *) sysinfo_value("sram.address.physical"),
-	    (void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE,
-	    AS_AREA_READ | AS_AREA_WRITE) != 0)
-		printf("SGCN: uspace driver could not map physical memory.");
-	
-	sram_buffer_offset = sysinfo_value("sram.buffer.offset");
-	ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
-		0, (void *) 0);
-}
-
-/**
- * Handler of the "key pressed" event. Reads codes of all the pressed keys from
- * the buffer. 
- */
-void sgcn_key_pressed(void)
-{
-	char c;
-	
-	uint32_t begin = SGCN_BUFFER_HEADER->in_begin;
-	uint32_t end = SGCN_BUFFER_HEADER->in_end;
-	uint32_t size = end - begin;
-	
-	volatile char *buf_ptr = (volatile char *)
-		SGCN_BUFFER(char, SGCN_BUFFER_HEADER->in_rdptr);
-	volatile uint32_t *in_wrptr_ptr = &(SGCN_BUFFER_HEADER->in_wrptr);
-	volatile uint32_t *in_rdptr_ptr = &(SGCN_BUFFER_HEADER->in_rdptr);
-	
-	while (*in_rdptr_ptr != *in_wrptr_ptr) {
-		c = *buf_ptr;
-		*in_rdptr_ptr = (((*in_rdptr_ptr) - begin + 1) % size) + begin;
-		buf_ptr = (volatile char *)
-			SGCN_BUFFER(char, SGCN_BUFFER_HEADER->in_rdptr);
-		if (c == '\r') {
-                        c = '\n';
-                }
-		kbd_process_no_fb(&keybuffer, c);
-	}
-}
-
-/** @}
- */
Index: uspace/srv/kbd/ctl/gxe_fb.c
===================================================================
--- uspace/srv/kbd/ctl/gxe_fb.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/ctl/gxe_fb.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -27,8 +27,12 @@
  */
 
-/** @addtogroup kbd
+/** @addtogroup kbd_ctl
+ * @ingroup kbd
+ * @{
+ */
+/**
+ * @file
  * @brief	GXEmul framebuffer-mode keyboard controller driver.
- * @{
- */ 
+ */
 
 #include <kbd.h>
Index: uspace/srv/kbd/ctl/pc.c
===================================================================
--- uspace/srv/kbd/ctl/pc.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/ctl/pc.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -27,8 +27,12 @@
  */
 
-/** @addtogroup kbd
+/** @addtogroup kbd_ctl
+ * @ingroup kbd
+ * @{
+ */
+/**
+ * @file
  * @brief	PC keyboard controller driver.
- * @{
- */ 
+ */
 
 #include <kbd.h>
@@ -37,5 +41,5 @@
 #include <kbd_ctl.h>
 
-int scanmap_simple[];
+static int scanmap_simple[];
 
 void kbd_ctl_parse_scancode(int scancode)
@@ -44,5 +48,6 @@
 	unsigned int key;
 
-	if (scancode < 0 || scancode >= 0x100) return;
+	if (scancode < 0 || scancode >= 0x100)
+		return;
 
 	if (scancode & 0x80) {
@@ -58,5 +63,5 @@
 }
 
-int scanmap_simple[128] = {
+static int scanmap_simple[128] = {
 
 	[0x29] = KC_BACKTICK,
Index: uspace/srv/kbd/ctl/stty.c
===================================================================
--- uspace/srv/kbd/ctl/stty.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/ctl/stty.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -27,8 +27,12 @@
  */
 
-/** @addtogroup kbd
+/** @addtogroup kbd_ctl
+ * @ingroup kbd
+ * @{
+ */
+/**
+ * @file
  * @brief	Serial TTY-like keyboard controller driver.
- * @{
- */ 
+ */
 
 #include <kbd.h>
Index: uspace/srv/kbd/ctl/sun.c
===================================================================
--- uspace/srv/kbd/ctl/sun.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
+++ uspace/srv/kbd/ctl/sun.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup kbd_ctl
+ * @ingroup kbd
+ * @{
+ */
+/**
+ * @file
+ * @brief	Sun keyboard controller driver.
+ */
+
+#include <kbd.h>
+#include <kbd/kbd.h>
+#include <kbd/keycode.h>
+#include <kbd_ctl.h>
+
+#define KBD_KEY_RELEASE		0x80
+#define KBD_ALL_KEYS_UP		0x7f
+
+static int scanmap_simple[];
+
+void kbd_ctl_parse_scancode(int scancode)
+{
+	kbd_ev_type_t type;
+	unsigned int key;
+
+	if (scancode < 0 || scancode >= 0x100)
+		return;
+
+	if (scancode == KBD_ALL_KEYS_UP)
+		return;
+
+	if (scancode & KBD_KEY_RELEASE) {
+		scancode &= ~KBD_KEY_RELEASE;
+		type = KE_RELEASE;
+	} else {
+		type = KE_PRESS;
+	}
+
+	key = scanmap_simple[scancode];
+	if (key != 0)
+		kbd_push_ev(type, key, 0);
+}
+
+/** Primary meaning of scancodes. */
+static int scanmap_simple[] = {
+	[0x00] = 0,
+	[0x01] = 0,
+	[0x02] = 0,
+	[0x03] = 0,
+	[0x04] = 0,
+	[0x05] = KC_F1,
+	[0x06] = KC_F2,
+	[0x07] = KC_F10,
+	[0x08] = KC_F3,
+	[0x09] = KC_F11,
+	[0x0a] = KC_F4,
+	[0x0b] = KC_F12,
+	[0x0c] = KC_F5,
+	[0x0d] = KC_RALT,
+	[0x0e] = KC_F6,
+	[0x0f] = 0,
+	[0x10] = KC_F7,
+	[0x11] = KC_F8,
+	[0x12] = KC_F9,
+	[0x13] = KC_LALT,
+	[0x14] = KC_UP,
+	[0x15] = KC_PAUSE,
+	[0x16] = 0,
+	[0x17] = KC_SCROLL_LOCK,
+	[0x18] = KC_LEFT,
+	[0x19] = 0,
+	[0x1a] = 0,
+	[0x1b] = KC_DOWN,
+	[0x1c] = KC_RIGHT,
+	[0x1d] = KC_ESCAPE,
+	[0x1e] = KC_1,
+	[0x1f] = KC_2,
+	[0x20] = KC_3,
+	[0x21] = KC_4,
+	[0x22] = KC_5,
+	[0x23] = KC_6,
+	[0x24] = KC_7,
+	[0x25] = KC_8,
+	[0x26] = KC_9,
+	[0x27] = KC_0,
+	[0x28] = KC_MINUS,
+	[0x29] = KC_EQUALS,
+	[0x2a] = KC_BACKTICK,
+	[0x2b] = KC_BACKSPACE,
+	[0x2c] = KC_INSERT,
+	[0x2d] = 0,
+	[0x2e] = KC_NSLASH,
+	[0x2f] = KC_NTIMES,
+	[0x30] = 0,
+	[0x31] = 0,
+	[0x32] = KC_NPERIOD,
+	[0x33] = 0,
+	[0x34] = KC_HOME,
+	[0x35] = KC_TAB,
+	[0x36] = KC_Q,
+	[0x37] = KC_W,
+	[0x38] = KC_E,
+	[0x39] = KC_R,
+	[0x3a] = KC_T,
+	[0x3b] = KC_Y,
+	[0x3c] = KC_U,
+	[0x3d] = KC_I,
+	[0x3e] = KC_O,
+	[0x3f] = KC_P,
+	[0x40] = KC_LBRACKET,
+	[0x41] = KC_RBRACKET,
+	[0x42] = KC_DELETE,
+	[0x43] = 0,
+	[0x44] = KC_N7,
+	[0x45] = KC_N8,
+	[0x46] = KC_N9,
+	[0x47] = KC_NMINUS,
+	[0x48] = 0,
+	[0x49] = 0,
+	[0x4a] = KC_END,
+	[0x4b] = 0,
+	[0x4c] = KC_LCTRL,
+	[0x4d] = KC_A,
+	[0x4e] = KC_S,
+	[0x4f] = KC_D,
+	[0x50] = KC_F,
+	[0x51] = KC_G,
+	[0x52] = KC_H,
+	[0x53] = KC_J,
+	[0x54] = KC_K,
+	[0x55] = KC_L,
+	[0x56] = KC_SEMICOLON,
+	[0x57] = KC_QUOTE,
+	[0x58] = KC_BACKSLASH,
+	[0x59] = KC_ENTER,
+	[0x5a] = KC_NENTER,
+	[0x5b] = KC_N4,
+	[0x5c] = KC_N5,
+	[0x5d] = KC_N6,
+	[0x5e] = KC_N0,
+	[0x5f] = 0,
+	[0x60] = KC_PAGE_UP,
+	[0x61] = 0,
+	[0x62] = KC_NUM_LOCK,
+	[0x63] = KC_LSHIFT,
+	[0x64] = KC_Z,
+	[0x65] = KC_X,
+	[0x66] = KC_C,
+	[0x67] = KC_V,
+	[0x68] = KC_B,
+	[0x69] = KC_N,
+	[0x6a] = KC_M,
+	[0x6b] = KC_COMMA,
+	[0x6c] = KC_PERIOD,
+	[0x6d] = KC_SLASH,
+	[0x6e] = KC_RSHIFT,
+	[0x6f] = 0,
+	[0x70] = KC_N1,
+	[0x71] = KC_N2,
+	[0x72] = KC_N3,
+	[0x73] = 0,
+	[0x74] = 0,
+	[0x75] = 0,
+	[0x76] = 0,
+	[0x77] = KC_CAPS_LOCK,
+	[0x78] = 0,
+	[0x79] = KC_SPACE,
+	[0x7a] = 0,
+	[0x7b] = KC_PAGE_DOWN,
+	[0x7c] = 0,
+	[0x7d] = KC_NPLUS,
+	[0x7e] = 0,
+	[0x7f] = 0
+};
+
+/** @}
+ */
Index: pace/srv/kbd/genarch/include/kbd.h
===================================================================
--- uspace/srv/kbd/genarch/include/kbd.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2006 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbd
- * @{
- */ 
-/** @file
- */
-
-#ifndef KBD_genarch_KBD_H_
-#define KBD_genarch_KBD_H_
-
-#include <key_buffer.h>
-
-extern void key_released(keybuffer_t *keybuffer, unsigned char key);
-extern void key_pressed(keybuffer_t *keybuffer, unsigned char key);
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/genarch/include/nofb.h
===================================================================
--- uspace/srv/kbd/genarch/include/nofb.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2008 Pavel Rimsky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbd
- * @{
- */ 
-/** @file
- */
-
-#ifndef KBD_genarch_NOFB_H_
-#define KBD_genarch_NOFB_H_
-
-
-#include <key_buffer.h>
-#include <genarch/scanc.h>
-
-extern int kbd_process_no_fb(keybuffer_t *keybuffer, int scan_code);
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/genarch/include/scanc.h
===================================================================
--- uspace/srv/kbd/genarch/include/scanc.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- * Copyright (c) 2001-2004 Jakub Jermar
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbd
- * @{
- */ 
-/** @file
- */
-
-#ifndef KBD_SCANC_H_
-#define KBD_SCANC_H_
-
-#define FUNCTION_KEYS 0x100
-
-#define SPECIAL		255
-
-extern int sc_primary_map[];
-extern int sc_secondary_map[];
-
-#endif
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/genarch/src/kbd.c
===================================================================
--- uspace/srv/kbd/genarch/src/kbd.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,118 +1,0 @@
-/*
- * Copyright (c) 2001-2004 Jakub Jermar
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbd
- * @brief	Handling of keyboard IRQ notifications for several architectures.
- * @ingroup  kbd
- * @{
- */ 
-/** @file
- */
-
-#include <key_buffer.h>
-#include <arch/scanc.h>
-#include <genarch/scanc.h>
-#include <genarch/kbd.h>
-#include <libc.h>
-
-#define PRESSED_SHIFT		(1<<0)
-#define PRESSED_CAPSLOCK	(1<<1)
-#define LOCKED_CAPSLOCK		(1<<0)
-
-static volatile int keyflags;		/**< Tracking of multiple keypresses. */
-static volatile int lockflags;		/**< Tracking of multiple keys lockings. */
-
-void key_released(keybuffer_t *keybuffer, unsigned char key)
-{
-	switch (key) {
-	case SC_LSHIFT:
-	case SC_RSHIFT:
-		keyflags &= ~PRESSED_SHIFT;
-		break;
-	case SC_CAPSLOCK:
-		keyflags &= ~PRESSED_CAPSLOCK;
-		if (lockflags & LOCKED_CAPSLOCK)
-			lockflags &= ~LOCKED_CAPSLOCK;
-		else
-			lockflags |= LOCKED_CAPSLOCK;
-		break;
-	default:
-		break;
-	}
-}
-
-void key_pressed(keybuffer_t *keybuffer, unsigned char key)
-{
-	int *map = sc_primary_map;
-	int ascii = sc_primary_map[key];
-	int shift, capslock;
-	int letter = 0;
-	kbd_event_t ev;
-
-	static int esc_count = 0;
-
-	if (key == SC_ESC) {
-		esc_count++;
-		if (esc_count == 3)
-			__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE);
-	} else {
-		esc_count = 0;
-	}
-	
-	switch (key) {
-	case SC_LSHIFT:
-	case SC_RSHIFT:
-	    	keyflags |= PRESSED_SHIFT;
-		break;
-	case SC_CAPSLOCK:
-		keyflags |= PRESSED_CAPSLOCK;
-		break;
-	case SC_SPEC_ESCAPE:
-		break;
-	default:
-	    	letter = ((ascii >= 'a') && (ascii <= 'z'));
-		capslock = (keyflags & PRESSED_CAPSLOCK) || (lockflags & LOCKED_CAPSLOCK);
-		shift = keyflags & PRESSED_SHIFT;
-		if (letter && capslock)
-			shift = !shift;
-		if (shift)
-			map = sc_secondary_map;
-		if (map[key] != SPECIAL) {
-			ev.key = map[key];
-			ev.mods = 0;
-			ev.c = map[key];
-			keybuffer_push(keybuffer, &ev);
-		}
-		break;
-	}
-}
-
-/**
- * @}
- */ 
Index: pace/srv/kbd/genarch/src/nofb.c
===================================================================
--- uspace/srv/kbd/genarch/src/nofb.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,190 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbdmips32 mips32
- * @brief	HelenOS mips32 arch dependent parts of uspace keyboard handler.
- * @ingroup  kbd
- * @{
- */ 
- 
-/** @file
- */
-
-#include <genarch/nofb.h>
-#include <stdio.h> // DELETE!!!
-
-#define KEY_F1 0x504f1bL
-#define KEY_F2 0x514f1bL
-#define KEY_F3 0x524f1bL
-#define KEY_F4 0x534f1bL
-#define KEY_F5 0x35315b1bL
-#define KEY_F6 0x37315b1bL
-#define KEY_F7 0x38315b1bL
-#define KEY_F8 0x39315b1bL
-#define KEY_F9 0x30325b1bL
-#define KEY_F10 0x31325b1bL
-#define KEY_F11 0x33325b1bL
-#define KEY_F12 0x34325b1bL
-
-/**
- * Processes the key pressed - pushes the key code into the key buffer.
- * Used in MSIM and Serengeti, i.e. non-framebuffer consoles.
- */
-int kbd_process_no_fb(keybuffer_t *keybuffer, int scan_code)
-{
-	static unsigned long buf = 0;
-	static int count = 0;	
-
-	if (scan_code == '\r')
-		scan_code = '\n';
-
-	if (scan_code == 0x7e) {
-		switch (buf) {
-		case KEY_F5:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 5);
-			buf = count = 0;
-			return 1;
-		case KEY_F6:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 6);
-			buf = count = 0;
-			return 1;
-		case KEY_F7:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 7);
-			buf = count = 0;
-			return 1;
-		case KEY_F8:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 8);
-			buf = count = 0;
-			return 1;
-		case KEY_F9:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 9);
-			buf = count = 0;
-			return 1;
-		case KEY_F10:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 10);
-			buf = count = 0;
-			return 1;
-		case KEY_F11:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 11);
-			buf = count = 0;
-			return 1;
-		case KEY_F12:
-			keybuffer_push0(keybuffer,FUNCTION_KEYS | 12);
-			buf = count = 0;
-			return 1;
-		default:
-			keybuffer_push0(keybuffer, buf & 0xff);
-			keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-			keybuffer_push0(keybuffer, (buf >> 16) &0xff);
-			keybuffer_push0(keybuffer, (buf >> 24) &0xff);
-			keybuffer_push0(keybuffer, scan_code);
-			buf = count = 0;
-			return 1;
-		}
-	}
-
-	buf |= ((unsigned long) scan_code)<<(8*(count++));
-	
-	if((buf & 0xff) != (KEY_F1 & 0xff)) {
-		keybuffer_push0(keybuffer, buf);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 1) 
-		return 1;
-
-	if ((buf & 0xffff) != (KEY_F1 & 0xffff) 
-		&& (buf & 0xffff) != (KEY_F5 & 0xffff) ) {
-
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	if (count <= 2) 
-		return 1;
-
-	switch (buf) {
-	case KEY_F1:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 1);
-		buf = count = 0;
-		return 1;
-	case KEY_F2:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 2);
-		buf = count = 0;
-		return 1;
-	case KEY_F3:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 3);
-		buf = count = 0;
-		return 1;
-	case KEY_F4:
-		keybuffer_push0(keybuffer,FUNCTION_KEYS | 4);
-		buf = count = 0;
-		return 1;
-	}
-
-
-	if((buf & 0xffffff) != (KEY_F5 & 0xffffff)
-		&& (buf & 0xffffff) != (KEY_F9 & 0xffffff)) {
-
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) & 0xff);
-		buf=count=0;
-		return 1;
-	}
-
-	if (count <= 3)
-		return 1;
-	
-	switch (buf) {
-	case KEY_F5:
-	case KEY_F6:
-	case KEY_F7:
-	case KEY_F8:
-	case KEY_F9:
-	case KEY_F10:
-	case KEY_F11:
-	case KEY_F12:
-		return 1;
-	default:
-		keybuffer_push0(keybuffer, buf & 0xff);
-		keybuffer_push0(keybuffer, (buf >> 8) &0xff);
-		keybuffer_push0(keybuffer, (buf >> 16) &0xff);
-		keybuffer_push0(keybuffer, (buf >> 24) &0xff);
-		buf = count = 0;
-		return 1;
-	}
-
-	return 1;
-}
-
-/** @}
- */
Index: pace/srv/kbd/include/keys.h
===================================================================
--- uspace/srv/kbd/include/keys.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @addtogroup kbdgen
- * @{
- */
-/**
- * @file
- */
-
-#ifndef _KBD_KEYS_H_
-#define _KBD_KEYS_H_
-
-#define KBD_EVENT	1024
-#define KBD_MS_LEFT	1025
-#define KBD_MS_RIGHT	1026
-#define KBD_MS_MIDDLE	1027
-#define KBD_MS_MOVE	1028
-
-#define KBD_KEY_F1	0x3b
-#define KBD_KEY_F2	0x3c
-#define KBD_KEY_F3	0x3d
-#define KBD_KEY_F4	0x3e
-#define KBD_KEY_F5	0x3f
-#define KBD_KEY_F6	0x40
-#define KBD_KEY_F7	0x41
-#define KBD_KEY_F8	0x42
-#define KBD_KEY_F9	0x43
-#define KBD_KEY_F10	0x44
-#define KBD_KEY_F11	0x45
-#define KBD_KEY_F12	0x46
-
-#endif
-
-/** @}
-*/
Index: uspace/srv/kbd/port/dummy.c
===================================================================
--- uspace/srv/kbd/port/dummy.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/port/dummy.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -27,6 +27,7 @@
  */
 
-/** @addtogroup kbd
+/** @addtogroup kbd_port
  * @brief	Dummy keyboard port driver.
+ * @ingroup  kbd
  * @{
  */ 
Index: uspace/srv/kbd/port/gxemul.c
===================================================================
--- uspace/srv/kbd/port/gxemul.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/port/gxemul.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -27,6 +27,7 @@
  */
 
-/** @addtogroup kbd
+/** @addtogroup kbd_port
  * @{
+ * @ingroup  kbd
  */ 
 /** @file
Index: uspace/srv/kbd/port/i8042.c
===================================================================
--- uspace/srv/kbd/port/i8042.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/port/i8042.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -28,8 +28,10 @@
  */
 
-/** @addtogroup kbd
+/** @addtogroup kbd_port
+ * @ingroup kbd
  * @{
  */ 
 /** @file
+ * @brief i8042 port driver.
  */
 
Index: uspace/srv/kbd/port/i8042.h
===================================================================
--- uspace/srv/kbd/port/i8042.h	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/port/i8042.h	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -27,6 +27,5 @@
  */
 
-/** @addtogroup kbdamd64 amd64
- * @brief	HelenOS ia32 / amd64 arch dependent parts of uspace keyboard and mouse handler.
+/** @addtogroup kbd_port
  * @ingroup  kbd
  * @{
@@ -34,5 +33,5 @@
 
 /** @file
- * @ingroup kbdia32
+ * @brief i8042 port driver.
  */
 
Index: uspace/srv/kbd/port/msim.c
===================================================================
--- uspace/srv/kbd/port/msim.c	(revision f89979b1e04f036c3b08e99110d2269a0314f7c9)
+++ uspace/srv/kbd/port/msim.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -27,9 +27,10 @@
  */
 
-/** @addtogroup kbd
- * @brief	Msim keyboard port driver.
+/** @addtogroup kbd_port
+ * @ingroup  kbd
  * @{
  */ 
 /** @file
+ * @brief	Msim keyboard port driver.
  */
 
Index: uspace/srv/kbd/port/ns16550.c
===================================================================
--- uspace/srv/kbd/port/ns16550.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
+++ uspace/srv/kbd/port/ns16550.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2006 Josef Cejka
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup kbd_port
+ * @ingroup  kbd
+ * @{
+ */ 
+/** @file
+ * @brief	NS16550 port driver.
+ */
+
+#include <ipc/ipc.h>
+#include <async.h>
+#include <sysinfo.h>
+#include <kbd.h>
+#include <kbd_port.h>
+#include <ddi.h>
+
+/* NS16550 registers */
+#define RBR_REG		0	/** Receiver Buffer Register. */
+#define IER_REG		1	/** Interrupt Enable Register. */
+#define IIR_REG		2	/** Interrupt Ident Register (read). */
+#define FCR_REG		2	/** FIFO control register (write). */
+#define LCR_REG		3	/** Line Control register. */
+#define MCR_REG		4	/** Modem Control Register. */
+#define LSR_REG		5	/** Line Status Register. */
+
+irq_cmd_t ns16550_cmds[1] = {
+	{ CMD_PORT_READ_1, 0, 0, 2 },
+};
+
+irq_code_t ns16550_kbd = {
+	1,
+	ns16550_cmds
+};
+
+static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call);
+
+uint16_t ns16550_port;
+
+int kbd_port_init(void)
+{
+	async_set_interrupt_received(ns16550_irq_handler);
+
+	ns16550_port = sysinfo_value("kbd.port");
+	ns16550_kbd.cmds[0].addr = (void *) (ns16550_port + RBR_REG);
+	ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
+	    0, &ns16550_kbd);
+	iospace_enable(task_get_id(), ns16550_port, 8);
+
+	return 0;
+}
+
+#define LSR_DATA_READY	0x01
+
+static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call)
+{
+	int scan_code = IPC_GET_ARG2(*call);
+	kbd_push_scancode(scan_code);
+}
+
+/**
+ * @}
+ */
Index: uspace/srv/kbd/port/sgcn.c
===================================================================
--- uspace/srv/kbd/port/sgcn.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
+++ uspace/srv/kbd/port/sgcn.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2008 Pavel Rimsky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup kbd_port
+ * @ingroup  kbd
+ * @{
+ */ 
+/** @file
+ * @brief	Z8350 keyboard port driver.
+ * @brief	SGCN (Serengeti Console) keyboard port driver.
+ */
+
+#include <as.h>
+#include <ddi.h>
+#include <ipc/ipc.h>
+#include <async.h>
+#include <kbd.h>
+#include <kbd_port.h>
+#include <sysinfo.h>
+#include <stdio.h>
+
+/**
+ * SGCN buffer header. It is placed at the very beginning of the SGCN
+ * buffer. 
+ */
+typedef struct {
+	/** hard-wired to "CON" */
+	char magic[4];
+	
+	/** we don't need this */
+	char unused[8];
+	
+	/** offset within the SGCN buffer of the input buffer start */
+	uint32_t in_begin;
+	
+	/** offset within the SGCN buffer of the input buffer end */
+	uint32_t in_end;
+	
+	/** offset within the SGCN buffer of the input buffer read pointer */
+	uint32_t in_rdptr;
+	
+	/** offset within the SGCN buffer of the input buffer write pointer */
+	uint32_t in_wrptr;
+} __attribute__ ((packed)) sgcn_buffer_header_t;
+
+/*
+ * Returns a pointer to the object of a given type which is placed at the given
+ * offset from the console buffer beginning.
+ */
+#define SGCN_BUFFER(type, offset) \
+		((type *) (sram_virt_addr + sram_buffer_offset + (offset)))
+
+/** Returns a pointer to the console buffer header. */
+#define SGCN_BUFFER_HEADER	(SGCN_BUFFER(sgcn_buffer_header_t, 0))
+
+/**
+ * Virtual address mapped to SRAM.
+ */
+static uintptr_t sram_virt_addr;
+
+/**
+ * SGCN buffer offset within SGCN.
+ */
+static uintptr_t sram_buffer_offset;
+
+static void sgcn_irq_handler(ipc_callid_t iid, ipc_call_t *call);
+
+
+/**
+ * Initializes the SGCN driver.
+ * Maps the physical memory (SRAM) and registers the interrupt. 
+ */
+int kbd_port_init(void)
+{
+	async_set_interrupt_received(sgcn_irq_handler);
+	sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size"));
+	if (physmem_map((void *) sysinfo_value("sram.address.physical"),
+	    (void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE,
+	    AS_AREA_READ | AS_AREA_WRITE) != 0) {
+		printf("SGCN: uspace driver could not map physical memory.");
+		return -1;
+	}
+	
+	sram_buffer_offset = sysinfo_value("sram.buffer.offset");
+	ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
+		0, (void *) 0);
+	return 0;
+}
+
+/**
+ * Handler of the "key pressed" event. Reads codes of all the pressed keys from
+ * the buffer. 
+ */
+static void sgcn_irq_handler(ipc_callid_t iid, ipc_call_t *call)
+{
+	char c;
+	
+	uint32_t begin = SGCN_BUFFER_HEADER->in_begin;
+	uint32_t end = SGCN_BUFFER_HEADER->in_end;
+	uint32_t size = end - begin;
+	
+	volatile char *buf_ptr = (volatile char *)
+		SGCN_BUFFER(char, SGCN_BUFFER_HEADER->in_rdptr);
+	volatile uint32_t *in_wrptr_ptr = &(SGCN_BUFFER_HEADER->in_wrptr);
+	volatile uint32_t *in_rdptr_ptr = &(SGCN_BUFFER_HEADER->in_rdptr);
+	
+	while (*in_rdptr_ptr != *in_wrptr_ptr) {
+		c = *buf_ptr;
+		*in_rdptr_ptr = (((*in_rdptr_ptr) - begin + 1) % size) + begin;
+		buf_ptr = (volatile char *)
+			SGCN_BUFFER(char, SGCN_BUFFER_HEADER->in_rdptr);
+		kbd_push_scancode(c);
+	}
+}
+
+/** @}
+ */
Index: uspace/srv/kbd/port/z8530.c
===================================================================
--- uspace/srv/kbd/port/z8530.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
+++ uspace/srv/kbd/port/z8530.c	(revision 24ff4df07b987c77595be599054e03ca51ab8264)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2006 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup kbd_port
+ * @ingroup  kbd
+ * @{
+ */ 
+/** @file
+ * @brief	Z8350 keyboard port driver.
+ */
+
+#include <ipc/ipc.h>
+#include <async.h>
+#include <sysinfo.h>
+#include <kbd.h>
+#include <kbd_port.h>
+#include <sys/types.h>
+
+/** Top-half pseudocode for z8530. */
+irq_cmd_t z8530_cmds[] = {
+	{
+		CMD_MEM_READ_1,
+		0,		/**< Address. Will be patched in run-time. */
+		0,		/**< Value. Not used. */
+		1		/**< Arg 1 will contain the result. */
+	}
+};
+
+	
+irq_code_t z8530_kbd = {
+	1,
+	z8530_cmds
+};
+
+static void z8530_irq_handler(ipc_callid_t iid, ipc_call_t *call);
+
+int kbd_port_init(void)
+{
+	async_set_interrupt_received(z8350_irq_handler);
+	z8530_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual") + 6;
+	ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
+	    0, &z8530_kbd);
+	return 0;
+}
+
+static void z8530_irq_handler(ipc_callid_t iid, ipc_call_t *call)
+{
+	int scan_code = IPC_GET_ARG1(*call);
+	kbd_push_scancode(scan_code);
+}
+
+/** @}
+ */
