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/i386 - pull in opt_kgdb.h where ...
details: https://anonhg.NetBSD.org/src/rev/290b0dd34976
branches: sommerfeld_i386mp_1
changeset: 482447:290b0dd34976
user: lukem <lukem%NetBSD.org@localhost>
date: Tue Nov 20 08:43:28 2001 +0000
description:
- pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for options KGDB_DEVNAME="\"com\""
- use correct quotes for options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
diffstat:
sys/arch/i386/i386/consinit.c | 230 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 230 insertions(+), 0 deletions(-)
diffs (234 lines):
diff -r ded58c6e886d -r 290b0dd34976 sys/arch/i386/i386/consinit.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/i386/consinit.c Tue Nov 20 08:43:28 2001 +0000
@@ -0,0 +1,230 @@
+/* $NetBSD: consinit.c,v 1.9.2.2 2001/11/20 08:43:28 lukem Exp $ */
+
+/*
+ * Copyright (c) 1998
+ * Matthias Drochner. All rights reserved.
+ *
+ * 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.
+ *
+ * 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 <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.9.2.2 2001/11/20 08:43:28 lukem Exp $");
+
+#include "opt_kgdb.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <machine/bus.h>
+#include <machine/bootinfo.h>
+
+#include "vga.h"
+#include "ega.h"
+#include "pcdisplay.h"
+#if (NVGA > 0) || (NEGA > 0) || (NPCDISPLAY > 0)
+#include <dev/ic/mc6845reg.h>
+#include <dev/ic/pcdisplayvar.h>
+#if (NVGA > 0)
+#include <dev/ic/vgareg.h>
+#include <dev/ic/vgavar.h>
+#endif
+#if (NEGA > 0)
+#include <dev/isa/egavar.h>
+#endif
+#if (NPCDISPLAY > 0)
+#include <dev/isa/pcdisplayvar.h>
+#endif
+#endif
+
+#include "pckbc.h"
+#if (NPCKBC > 0)
+#include <dev/isa/isareg.h>
+#include <dev/ic/i8042reg.h>
+#include <dev/ic/pckbcvar.h>
+#endif
+#include "pckbd.h" /* for pckbc_machdep_cnattach */
+
+#include "pc.h"
+#if (NPC > 0)
+#include <machine/pccons.h>
+#endif
+
+#include "com.h"
+#if (NCOM > 0)
+#include <sys/termios.h>
+#include <dev/ic/comreg.h>
+#include <dev/ic/comvar.h>
+#endif
+
+#include "ukbd.h"
+#if (NUKBD > 0)
+#include <dev/usb/ukbdvar.h>
+#endif
+
+#ifndef CONSDEVNAME
+#define CONSDEVNAME "pc"
+#endif
+
+#if (NCOM > 0)
+#ifndef CONADDR
+#define CONADDR 0x3f8
+#endif
+#ifndef CONSPEED
+#define CONSPEED TTYDEF_SPEED
+#endif
+#ifndef CONMODE
+#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
+#endif
+int comcnmode = CONMODE;
+#endif /* NCOM */
+
+const struct btinfo_console default_consinfo = {
+ {0, 0},
+ CONSDEVNAME,
+#if (NCOM > 0)
+ CONADDR, CONSPEED
+#else
+ 0, 0
+#endif
+};
+
+#ifdef KGDB
+#ifndef KGDB_DEVNAME
+#define KGDB_DEVNAME "com"
+#endif
+const char kgdb_devname[] = KGDB_DEVNAME;
+
+#if (NCOM > 0)
+#ifndef KGDB_DEVADDR
+#define KGDB_DEVADDR 0x3f8
+#endif
+int comkgdbaddr = KGDB_DEVADDR;
+#ifndef KGDB_DEVRATE
+#define KGDB_DEVRATE TTYDEF_SPEED
+#endif
+int comkgdbrate = KGDB_DEVRATE;
+#ifndef KGDB_DEVMODE
+#define KGDB_DEVMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
+#endif
+int comkgdbmode = KGDB_DEVMODE;
+#endif /* NCOM */
+
+#endif /* KGDB */
+
+/*
+ * consinit:
+ * initialize the system console.
+ * XXX - shouldn't deal with this initted thing, but then,
+ * it shouldn't be called from init386 either.
+ */
+void
+consinit()
+{
+ const struct btinfo_console *consinfo;
+ static int initted;
+
+ if (initted)
+ return;
+ initted = 1;
+
+#ifndef CONS_OVERRIDE
+ consinfo = lookup_bootinfo(BTINFO_CONSOLE);
+ if (!consinfo)
+#endif
+ consinfo = &default_consinfo;
+
+#if (NPC > 0) || (NVGA > 0) || (NEGA > 0) || (NPCDISPLAY > 0)
+ if (!strcmp(consinfo->devname, "pc")) {
+#if (NVGA > 0)
+ if (!vga_cnattach(I386_BUS_SPACE_IO, I386_BUS_SPACE_MEM,
+ -1, 1))
+ goto dokbd;
+#endif
+#if (NEGA > 0)
+ if (!ega_cnattach(I386_BUS_SPACE_IO, I386_BUS_SPACE_MEM))
+ goto dokbd;
+#endif
+#if (NPCDISPLAY > 0)
+ if (!pcdisplay_cnattach(I386_BUS_SPACE_IO, I386_BUS_SPACE_MEM))
+ goto dokbd;
+#endif
+#if (NPC > 0)
+ pccnattach();
+#endif
+ if (0) goto dokbd; /* XXX stupid gcc */
+dokbd:
+#if (NPCKBC > 0)
+ pckbc_cnattach(I386_BUS_SPACE_IO, IO_KBD, KBCMDP,
+ PCKBC_KBD_SLOT);
+#endif
+#if NPCKBC == 0 && NUKBD > 0
+ ukbd_cnattach();
+#endif
+ return;
+ }
+#endif /* PC | VT | VGA | PCDISPLAY */
+#if (NCOM > 0)
+ if (!strcmp(consinfo->devname, "com")) {
+ bus_space_tag_t tag = I386_BUS_SPACE_IO;
+
+ if (comcnattach(tag, consinfo->addr, consinfo->speed,
+ COM_FREQ, comcnmode))
+ panic("can't init serial console @%x", consinfo->addr);
+
+ return;
+ }
+#endif
+ panic("invalid console device %s", consinfo->devname);
+}
+
+#if (NPCKBC > 0) && (NPCKBD == 0)
+/*
+ * glue code to support old console code with the
+ * mi keyboard controller driver
+ */
+int
+pckbc_machdep_cnattach(kbctag, kbcslot)
+ pckbc_tag_t kbctag;
+ pckbc_slot_t kbcslot;
+{
+#if (NPC > 0) && (NPCCONSKBD > 0)
+ return (pcconskbd_cnattach(kbctag, kbcslot));
+#else
+ return (ENXIO);
+#endif
+}
+#endif
+
+#ifdef KGDB
+void
+kgdb_port_init()
+{
+#if (NCOM > 0)
+ if(!strcmp(kgdb_devname, "com")) {
+ bus_space_tag_t tag = I386_BUS_SPACE_IO;
+
+ com_kgdb_attach(tag, comkgdbaddr, comkgdbrate, COM_FREQ,
+ comkgdbmode);
+ }
+#endif
+}
+#endif
Home |
Main Index |
Thread Index |
Old Index