Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga/dev Tell kbd when it is the console keyboard ...
details: https://anonhg.NetBSD.org/src/rev/1149a98a7721
branches: trunk
changeset: 581454:1149a98a7721
user: jandberg <jandberg%NetBSD.org@localhost>
date: Wed Jun 01 18:50:33 2005 +0000
description:
Tell kbd when it is the console keyboard instead of always assuming
it is. Also console keyboard initialization is now made during consinit
instead of autoconf.
Reviewed by <is>.
diffstat:
sys/arch/amiga/dev/amidisplaycc.c | 11 +++++++++--
sys/arch/amiga/dev/kbd.c | 24 +++++++++++++++++-------
sys/arch/amiga/dev/kbdvar.h | 13 +++++++++++++
3 files changed, 39 insertions(+), 9 deletions(-)
diffs (129 lines):
diff -r 4eafeb473656 -r 1149a98a7721 sys/arch/amiga/dev/amidisplaycc.c
--- a/sys/arch/amiga/dev/amidisplaycc.c Wed Jun 01 18:41:51 2005 +0000
+++ b/sys/arch/amiga/dev/amidisplaycc.c Wed Jun 01 18:50:33 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amidisplaycc.c,v 1.16 2004/12/13 02:14:13 chs Exp $ */
+/* $NetBSD: amidisplaycc.c,v 1.17 2005/06/01 18:50:33 jandberg Exp $ */
/*-
* Copyright (c) 2000 Jukka Andberg.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amidisplaycc.c,v 1.16 2004/12/13 02:14:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amidisplaycc.c,v 1.17 2005/06/01 18:50:33 jandberg Exp $");
/*
* wscons interface to amiga custom chips. Contains the necessary functions
@@ -43,6 +43,7 @@
#include "grfcc.h"
#include "view.h"
#include "opt_amigaccgrf.h"
+#include "kbd.h"
#if NAMIDISPLAYCC>0
@@ -55,6 +56,7 @@
#include <sys/conf.h>
#include <amiga/dev/grfabs_reg.h>
+#include <amiga/dev/kbdvar.h>
#include <amiga/dev/viewioctl.h>
#include <amiga/amiga/device.h>
#include <dev/wscons/wsconsio.h>
@@ -399,6 +401,11 @@
&cookie, &x, &y, &attr);
wsdisplay_cnattach(&amidisplaycc_screentab[0].wsdescr,
cookie, x, y, attr);
+
+#if NKBD>0
+ /* tell kbd device it is used as console keyboard */
+ kbd_cnattach();
+#endif
}
static int
diff -r 4eafeb473656 -r 1149a98a7721 sys/arch/amiga/dev/kbd.c
--- a/sys/arch/amiga/dev/kbd.c Wed Jun 01 18:41:51 2005 +0000
+++ b/sys/arch/amiga/dev/kbd.c Wed Jun 01 18:50:33 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kbd.c,v 1.46 2003/09/21 19:16:48 jdolecek Exp $ */
+/* $NetBSD: kbd.c,v 1.47 2005/06/01 18:50:34 jandberg Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.46 2003/09/21 19:16:48 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.47 2005/06/01 18:50:34 jandberg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,6 +57,7 @@
#include <amiga/dev/itevar.h>
#include <amiga/dev/kbdreg.h>
#include <amiga/dev/kbdmap.h>
+#include <amiga/dev/kbdvar.h>
#include <amiga/dev/event_var.h>
#include <amiga/dev/vuid_event.h>
@@ -140,6 +141,7 @@
u_char k_mf2;
#endif
+ int k_console; /* true if used as console keyboard */
#if NWSKBD>0
struct device *k_wskbddev; /* pointer to wskbd for sending strokes */
int k_pollingmode; /* polling mode on? whatever it isss... */
@@ -203,11 +205,7 @@
* Try to attach the wskbd.
*/
struct wskbddev_attach_args waa;
-
- /* Maybe should be done before this?... */
- wskbd_cnattach(&kbd_consops, NULL, &kbd_mapdata);
-
- waa.console = 1;
+ waa.console = kbd_softc.k_console;
waa.keymap = &kbd_mapdata;
waa.accessops = &kbd_accessops;
waa.accesscookie = NULL;
@@ -219,6 +217,18 @@
#endif /* WSKBD */
}
+/*
+ * This is called when somebody wants to use kbd as the console keyboard.
+ */
+void
+kbd_cnattach(void)
+{
+#if NWSKBD>0
+ wskbd_cnattach(&kbd_consops, NULL, &kbd_mapdata);
+ kbd_softc.k_console = 1;
+#endif
+}
+
/* definitions for amiga keyboard encoding. */
#define KEY_CODE(c) ((c) & 0x7f)
#define KEY_UP(c) ((c) & 0x80)
diff -r 4eafeb473656 -r 1149a98a7721 sys/arch/amiga/dev/kbdvar.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/dev/kbdvar.h Wed Jun 01 18:50:33 2005 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: kbdvar.h,v 1.1 2005/06/01 18:50:34 jandberg Exp $ */
+
+/*
+ * Public domain.
+ */
+
+#ifndef _AMIGA_DEV_KBDVAR_H_
+#define _AMIGA_DEV_KBDVAR_H_
+
+void kbd_cnattach(void);
+
+#endif
+
Home |
Main Index |
Thread Index |
Old Index