Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/nathanw_sa]: src/sys/arch/arc split pccons driver into "pccons" and "opms",
details: https://anonhg.NetBSD.org/src/rev/d63acf1da59b
branches: nathanw_sa
changeset: 504750:d63acf1da59b
user: soda <soda%NetBSD.org@localhost>
date: Wed Jun 13 15:05:44 2001 +0000
description:
split pccons driver into "pccons" and "opms",
also split into bus-dependent frontend and bus-independent backend.
diffstat:
sys/arch/arc/dev/opmsvar.h | 66 ++++++++++++++++++++
sys/arch/arc/dev/pcconsvar.h | 113 +++++++++++++++++++++++++++++++++++
sys/arch/arc/include/pccons.h | 46 ++++++++++++++
sys/arch/arc/isa/pccons_isavar.h | 33 ++++++++++
sys/arch/arc/jazz/pccons_jazziovar.h | 33 ++++++++++
5 files changed, 291 insertions(+), 0 deletions(-)
diffs (truncated from 311 to 300 lines):
diff -r 9360ccb49d35 -r d63acf1da59b sys/arch/arc/dev/opmsvar.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/dev/opmsvar.h Wed Jun 13 15:05:44 2001 +0000
@@ -0,0 +1,66 @@
+/* $NetBSD: opmsvar.h,v 1.1.10.2 2001/06/13 15:05:45 soda Exp $ */
+/* $OpenBSD: pccons.c,v 1.22 1999/01/30 22:39:37 imp Exp $ */
+/* NetBSD: pms.c,v 1.21 1995/04/18 02:25:18 mycroft Exp */
+
+/*-
+ * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz and Don Ahn.
+ *
+ * Copyright (c) 1994 Charles M. Hannum.
+ * Copyright (c) 1992, 1993 Erik Forsberg.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#)pccons.c 5.11 (Berkeley) 5/21/91
+ */
+
+struct opms_softc { /* driver status information */
+ struct device sc_dev;
+
+ struct clist sc_q;
+ struct selinfo sc_rsel;
+ u_char sc_state; /* mouse driver state */
+#define PMS_OPEN 0x01 /* device is open */
+#define PMS_ASLP 0x02 /* waiting for mouse data */
+ u_char sc_status; /* mouse button status */
+ int sc_x, sc_y; /* accumulated motion in the X,Y axis */
+
+#if 0
+ struct pccons_kbd_context *sc_pkc; /* pckbd device software context */
+#endif
+};
+
+int opms_common_match __P((bus_space_tag_t, struct pccons_config *));
+void opms_common_attach __P((struct opms_softc *, bus_space_tag_t,
+ struct pccons_config *));
+int opmsintr __P((void *));
diff -r 9360ccb49d35 -r d63acf1da59b sys/arch/arc/dev/pcconsvar.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/dev/pcconsvar.h Wed Jun 13 15:05:44 2001 +0000
@@ -0,0 +1,113 @@
+/* $NetBSD: pcconsvar.h,v 1.1.10.2 2001/06/13 15:05:44 soda Exp $ */
+/* $OpenBSD: pccons.c,v 1.22 1999/01/30 22:39:37 imp Exp $ */
+/* NetBSD: pccons.c,v 1.89 1995/05/04 19:35:20 cgd Exp */
+
+/*-
+ * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz and Don Ahn.
+ *
+ * Copyright (c) 1994 Charles M. Hannum.
+ * Copyright (c) 1992, 1993 Erik Forsberg.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#)pccons.c 5.11 (Berkeley) 5/21/91
+ */
+
+struct pccons_config {
+ bus_addr_t pc_mono_iobase, pc_mono_memaddr;
+ bus_addr_t pc_cga_iobase, pc_cga_memaddr;
+ bus_addr_t pc_kbd_cmdp, pc_kbd_datap;
+
+ void (*pc_init) __P((void));
+};
+
+struct pccons_kbd_context {
+ bus_space_tag_t pkc_iot;
+ bus_space_handle_t pkc_cmd_ioh, pkc_data_ioh;
+
+ int pkc_initialized;
+};
+
+struct pccons_context {
+ struct pccons_kbd_context pc_pkc;
+
+ bus_space_tag_t pc_crt_iot, pc_crt_memt;
+
+ bus_space_handle_t pc_6845_ioh, pc_crt_memh;
+
+ bus_space_handle_t pc_mono_ioh, pc_mono_memh;
+ bus_space_handle_t pc_cga_ioh, pc_cga_memh;
+
+ struct pccons_config *pc_config;
+
+ int pc_initialized;
+};
+
+struct tty;
+
+struct pc_softc {
+ struct device sc_dev;
+ struct tty *sc_tty;
+
+#if 0
+ struct pccons_context *sc_pc; /* pccons device software context */
+#endif
+};
+
+#define kbd_cmd_read_1() \
+ bus_space_read_1(pccons_console_context.pc_pkc.pkc_iot, \
+ pccons_console_context.pc_pkc.pkc_cmd_ioh, 0)
+#define kbd_data_read_1() \
+ bus_space_read_1(pccons_console_context.pc_pkc.pkc_iot, \
+ pccons_console_context.pc_pkc.pkc_data_ioh, 0)
+#define kbd_cmd_write_1(cmd) \
+ bus_space_write_1(pccons_console_context.pc_pkc.pkc_iot, \
+ pccons_console_context.pc_pkc.pkc_cmd_ioh, 0, cmd)
+#define kbd_data_write_1(data) \
+ bus_space_write_1(pccons_console_context.pc_pkc.pkc_iot, \
+ pccons_console_context.pc_pkc.pkc_data_ioh, 0, data)
+
+extern struct pccons_context pccons_console_context;
+
+void kbd_context_init __P((bus_space_tag_t, struct pccons_config *));
+int kbc_put8042cmd __P((u_char));
+void kbd_flush_input __P((void));
+
+int pccons_common_match __P((bus_space_tag_t,
+ bus_space_tag_t, bus_space_tag_t, struct pccons_config *));
+void pccons_common_attach __P((struct pc_softc *, bus_space_tag_t,
+ bus_space_tag_t, bus_space_tag_t, struct pccons_config *));
+void pccons_common_cnattach __P((bus_space_tag_t, bus_space_tag_t,
+ bus_space_tag_t, struct pccons_config *));
+int pcintr __P((void *));
diff -r 9360ccb49d35 -r d63acf1da59b sys/arch/arc/include/pccons.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/include/pccons.h Wed Jun 13 15:05:44 2001 +0000
@@ -0,0 +1,46 @@
+/* $NetBSD: pccons.h,v 1.6.8.2 2001/06/13 15:05:48 soda Exp $ */
+/* $OpenBSD: pccons.h,v 1.2 1996/09/01 16:50:12 deraadt Exp $ */
+/* NetBSD: pccons.h,v 1.4 1996/02/02 18:06:06 mycroft Exp */
+
+/*
+ * pccons.h -- pccons ioctl definitions
+ */
+
+#ifndef _PCCONS_H_
+#define _PCCONS_H_
+
+#include <sys/ioctl.h>
+
+/* key types -- warning: pccons.c depends on most values */
+
+#define KB_SCROLL 0x0001 /* stop output */
+#define KB_NUM 0x0002 /* numeric shift cursors vs. numeric */
+#define KB_CAPS 0x0004 /* caps shift -- swaps case of letter */
+#define KB_SHIFT 0x0008 /* keyboard shift */
+#define KB_CTL 0x0010 /* control shift -- allows ctl function */
+#define KB_ASCII 0x0020 /* ascii code for this key */
+#define KB_ALTGR 0x0040 /* alternate graphics shift */
+#define KB_ALT 0x0080 /* alternate shift -- alternate chars */
+#define KB_FUNC 0x0100 /* function key */
+#define KB_KP 0x0200 /* Keypad keys */
+#define KB_NONE 0x0400 /* no function */
+
+#define KB_CODE_SIZE 4 /* Use a max of 4 for now... */
+#define KB_NUM_KEYS 128 /* Number of scan codes */
+typedef struct {
+ u_short type;
+ char unshift[KB_CODE_SIZE];
+ char shift[KB_CODE_SIZE];
+ char ctl[KB_CODE_SIZE];
+ char altgr[KB_CODE_SIZE];
+ char shift_altgr[KB_CODE_SIZE];
+} pccons_keymap_t;
+
+#define CONSOLE_X_MODE_ON _IO('t',121)
+#define CONSOLE_X_MODE_OFF _IO('t',122)
+#define CONSOLE_X_BELL _IOW('t',123,int[2])
+#define CONSOLE_SET_TYPEMATIC_RATE _IOW('t',124,u_char)
+#define CONSOLE_GET_KEYMAP _IOR('t',128,pccons_keymap_t[KB_NUM_KEYS])
+#define CONSOLE_SET_KEYMAP _IOW('t',129,pccons_keymap_t[KB_NUM_KEYS])
+
+#endif /* _PCCONS_H_ */
diff -r 9360ccb49d35 -r d63acf1da59b sys/arch/arc/isa/pccons_isavar.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/isa/pccons_isavar.h Wed Jun 13 15:05:44 2001 +0000
@@ -0,0 +1,33 @@
+/* $NetBSD: pccons_isavar.h,v 1.1.10.2 2001/06/13 15:05:46 soda Exp $ */
+/* NetBSD: vga_isavar.h,v 1.1 1998/03/22 15:14:36 drochner Exp */
+
+/*
+ * Copyright (c) 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution%CS.CMU.EDU@localhost
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+int pccons_isa_cnattach __P((bus_space_tag_t, bus_space_tag_t));
+
+extern struct pccons_config *pccons_isa_conf;
diff -r 9360ccb49d35 -r d63acf1da59b sys/arch/arc/jazz/pccons_jazziovar.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/jazz/pccons_jazziovar.h Wed Jun 13 15:05:44 2001 +0000
@@ -0,0 +1,33 @@
+/* $NetBSD: pccons_jazziovar.h,v 1.1.10.2 2001/06/13 15:05:47 soda Exp $ */
+/* NetBSD: vga_isavar.h,v 1.1 1998/03/22 15:14:36 drochner Exp */
+
+/*
+ * Copyright (c) 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution%CS.CMU.EDU@localhost
Home |
Main Index |
Thread Index |
Old Index