Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/sommerfeld_i386mp_1]: src/sys/arch/i386/isa allow default colours to be ...
details: https://anonhg.NetBSD.org/src/rev/dec9d8c88af7
branches: sommerfeld_i386mp_1
changeset: 482513:dec9d8c88af7
user: lukem <lukem%NetBSD.org@localhost>
date: Sun Apr 14 14:20:34 2002 +0000
description:
allow default colours to be overridden by
PCCONS_DEFAULT_FG PCCONS_DEFAULT_SO_FG
PCCONS_DEFAULT_BG PCCONS_DEFAULT_SO_BG
diffstat:
sys/arch/i386/isa/pccons.c | 2755 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 2755 insertions(+), 0 deletions(-)
diffs (truncated from 2759 to 300 lines):
diff -r a7b8be670da6 -r dec9d8c88af7 sys/arch/i386/isa/pccons.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/isa/pccons.c Sun Apr 14 14:20:34 2002 +0000
@@ -0,0 +1,2755 @@
+/* $NetBSD: pccons.c,v 1.153.2.2 2002/04/14 14:20:34 lukem Exp $ */
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum.
+ *
+ * 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 NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+/*-
+ * 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.
+ *
+ * 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
+ */
+
+/*
+ * code to work keyboard & display for PC-style console
+ *
+ * "NPCCONSKBD > 0" means that we access the keyboard through the MI keyboard
+ * controller driver, ==0 that we access it directly.
+ * XXX Only one of these attachments can be used in one kernel configuration.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.153.2.2 2002/04/14 14:20:34 lukem Exp $");
+
+#include "opt_ddb.h"
+#include "opt_xserver.h"
+#include "opt_compat_netbsd.h"
+
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/proc.h>
+#include <sys/user.h>
+#include <sys/select.h>
+#include <sys/tty.h>
+#include <sys/fcntl.h>
+#include <sys/uio.h>
+#include <sys/callout.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+#include <sys/device.h>
+
+#include <dev/cons.h>
+
+#include "pc.h"
+#if (NPCCONSKBD > 0)
+#include <machine/bus.h>
+#include <dev/ic/pckbcvar.h>
+#else
+/* consistency check: plain pccons can't coexist with pckbc */
+#include "pckbc.h"
+#if (NPCKBC > 0)
+#error "(pc without pcconskbd) and pckbc can't coexist"
+#endif
+#endif /* NPCCONSKBD */
+
+/* consistency check: pccons can't coexist with vga or pcdisplay */
+#include "vga.h"
+#include "pcdisplay.h"
+#if (NVGA > 0) || (NPCDISPLAY > 0)
+#error "pc and (vga or pcdisplay) can't coexist"
+#endif
+
+#include <machine/cpu.h>
+#include <machine/intr.h>
+#include <machine/pio.h>
+#include <machine/pccons.h>
+#include <machine/conf.h>
+
+#include <dev/isa/isareg.h>
+#include <dev/isa/isavar.h>
+#include <dev/ic/pcdisplay.h>
+#include <dev/ic/i8042reg.h>
+#include <dev/pckbc/pckbdreg.h>
+
+#define XFREE86_BUG_COMPAT
+
+#ifndef BEEP_FREQ
+#define BEEP_FREQ 1500
+#endif
+#ifndef BEEP_TIME
+#define BEEP_TIME (hz/5)
+#endif
+
+#define PCBURST 128
+
+/*
+ * Non-US keyboards definition
+ */
+#if defined(FRENCH_KBD) || defined(GERMAN_KBD) || defined(NORWEGIAN_KBD) || defined(FINNISH_KBD)
+# define NONUS_KBD
+# define DISPLAY_ISO8859
+# define NUMERIC_SLASH_FIX
+#endif
+
+static u_short *Crtat; /* pointer to backing store */
+static u_short *crtat; /* pointer to current char */
+#if (NPCCONSKBD == 0)
+static volatile u_char ack, nak; /* Don't ask. */
+static int poll_data = -1;
+#endif
+static u_char async, kernel, polling; /* Really, you don't want to know. */
+static u_char lock_state = 0x00; /* all off */
+#if (NPCCONSKBD == 0)
+static u_char old_lock_state = 0xff,
+ typematic_rate = 0xff, /* don't update until set by user */
+ old_typematic_rate = 0xff;
+#endif
+static u_short cursor_shape = 0xffff, /* don't update until set by user */
+ old_cursor_shape = 0xffff;
+#ifdef XSERVER
+int pc_xmode = 0;
+#endif
+int pccons_is_console = 0;
+#if (NPCCONSKBD > 0)
+static pckbc_tag_t kbctag;
+static pckbc_slot_t kbcslot;
+static int kbc_attached;
+#endif
+
+#define PCUNIT(x) (minor(x))
+
+static struct video_state {
+ int cx, cy; /* escape parameters */
+ int row, col; /* current cursor position */
+ int nrow, ncol, nchr; /* current screen geometry */
+ u_char state; /* parser state */
+#define VSS_ESCAPE 1
+#define VSS_EBRACE 2
+#define VSS_EPARAM 3
+ char so; /* in standout mode? */
+ char color; /* color or mono display */
+ char at; /* normal attributes */
+ char so_at; /* standout attributes */
+} vs;
+
+struct pc_softc {
+ struct device sc_dev;
+ void *sc_ih;
+ struct tty *sc_tty;
+};
+
+static struct callout async_update_ch = CALLOUT_INITIALIZER;
+
+int pcprobe __P((struct device *, struct cfdata *, void *));
+void pcattach __P((struct device *, struct device *, void *));
+int pcintr __P((void *));
+void pcinit __P((void));
+
+struct cfattach pc_ca = {
+ sizeof(struct pc_softc), pcprobe, pcattach
+};
+
+extern struct cfdriver pc_cd;
+
+#if (NPCCONSKBD > 0)
+struct pcconskbd_softc {
+ struct device sc_dev;
+};
+
+int pcconskbdprobe __P((struct device *, struct cfdata *, void *));
+void pcconskbdattach __P((struct device *, struct device *, void *));
+void pcinput __P((void *, int));
+
+struct cfattach pcconskbd_ca = {
+ sizeof(struct pcconskbd_softc), pcconskbdprobe, pcconskbdattach
+};
+
+extern struct cfdriver pcconskbd_cd;
+#endif
+
+#define COL 80
+#define ROW 25
+#define CHR 2
+
+/*
+ * DANGER WIL ROBINSON -- the values of SCROLL, NUM, CAPS, and ALT are
+ * important.
+ */
+#define SCROLL 0x0001 /* stop output */
+#define NUM 0x0002 /* numeric shift cursors vs. numeric */
+#define CAPS 0x0004 /* caps shift -- swaps case of letter */
+#define SHIFT 0x0008 /* keyboard shift */
+#define CTL 0x0010 /* control shift -- allows ctl function */
+#define ASCII 0x0020 /* ascii code for this key */
+#define ALT 0x0080 /* alternate shift -- alternate chars */
+#define FUNC 0x0100 /* function key */
+#define KP 0x0200 /* Keypad keys */
+#define NONE 0x0400 /* no function */
+#ifdef NONUS_KBD
+#define ALTGR 0x0040 /* Alt graphic */
+#endif
+
+static unsigned int addr_6845 = MONO_BASE;
+
+#if (NPCCONSKBD == 0)
+char *sget __P((void));
+#endif
+char *strans __P((u_char));
+void sput __P((u_char *, int));
+#ifdef XSERVER
+void pc_xmode_on __P((void));
+void pc_xmode_off __P((void));
+#endif
+
+void pcstart __P((struct tty *));
+int pcparam __P((struct tty *, struct termios *));
+
+#if (NPCCONSKBD == 0)
+int kbd_cmd __P((u_char, u_char));
+#endif
+void set_cursor_shape __P((void));
+#ifdef XSERVER
+#ifdef XFREE86_BUG_COMPAT
+void get_cursor_shape __P((void));
+#endif
+#endif
+void do_async_update __P((void *));
+void async_update __P((void));
+#if (NPCCONSKBD > 0)
+void update_leds __P((void));
+#else
+#define update_leds async_update
+#endif
+
+#if (NPCCONSKBD == 0)
+static __inline int kbd_wait_output __P((void));
+static __inline int kbd_wait_input __P((void));
+static __inline void kbd_flush_input __P((void));
+static u_char kbc_get8042cmd __P((void));
+static int kbc_put8042cmd __P((u_char));
+#endif
+
Home |
Main Index |
Thread Index |
Old Index