Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2002 20:05:04 -0800 (PST)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 21689 for review
Message-ID:  <200211300405.gAU454Uo013466@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=21689

Change 21689 by marcel@marcel_nfs on 2002/11/29 20:04:29

	Strip this file from anything that smells like isa or i386.
	Hook the sc device to the nexus instead.

Affected files ...

.. //depot/projects/ia64/sys/isa/syscons_isa.c#4 edit

Differences ...

==== //depot/projects/ia64/sys/isa/syscons_isa.c#4 (text+ko) ====

@@ -37,25 +37,6 @@
 #include <sys/kbio.h>
 #include <sys/consio.h>
 
-
-#ifdef __i386__
-
-#include <machine/clock.h>
-#include <machine/md_var.h>
-#include <machine/pc/bios.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <i386/isa/timerreg.h>
-
-#define BIOS_CLKED	(1 << 6)
-#define BIOS_NLKED	(1 << 5)
-#define BIOS_SLKED	(1 << 4)
-#define BIOS_ALKED	0
-
-#endif /* __i386__ */
-
 #include <dev/syscons/syscons.h>
 
 #include <isa/isareg.h>
@@ -66,17 +47,15 @@
 static sc_softc_t main_softc;
 
 static void
-scidentify (driver_t *driver, device_t parent)
+scidentify(driver_t *driver, device_t parent)
 {
-	BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "sc", 0);
+
+	BUS_ADD_CHILD(parent, 65536, "sc", 0);
 }
 
 static int
 scprobe(device_t dev)
 {
-	/* No pnp support */
-	if (isa_get_vendorid(dev))
-		return (ENXIO);
 
 	device_set_desc(dev, "System console");
 	return sc_probe_unit(device_get_unit(dev), device_get_flags(dev));
@@ -85,48 +64,10 @@
 static int
 scattach(device_t dev)
 {
+
 	return sc_attach_unit(device_get_unit(dev), device_get_flags(dev));
 }
 
-#ifndef SC_NO_SUSPEND_VTYSWITCH
-static int	sc_cur_scr;
-#endif
-
-static int
-scsuspend(device_t dev)
-{
-#ifndef SC_NO_SUSPEND_VTYSWITCH
-	int		retry = 10;
-	static int	dummy;
-	sc_softc_t	*sc;
-
-	sc = &main_softc;
-	sc_cur_scr = sc->cur_scp->index;
-	do {
-		sc_switch_scr(sc, 0);
-		if (!sc->switch_in_progress) {
-			break;
-		}
-		tsleep(&dummy, 0, "scsuspend", 100);
-	} while (retry--);
-
-#endif
-	return (0);
-}
-
-static int
-scresume(device_t dev)
-{
-#ifndef SC_NO_SUSPEND_VTYSWITCH
-	sc_softc_t	*sc;
-
-	sc = &main_softc;
-	sc_switch_scr(sc, sc_cur_scr);
-
-#endif
-	return (0);
-}
-
 int
 sc_max_unit(void)
 {
@@ -184,93 +125,32 @@
 int
 sc_get_cons_priority(int *unit, int *flags)
 {
-	int disabled;
-	const char *at;
-	int u, f;
-
-	*unit = -1;
-	for (u = 0; u < 16; u++) {
-		if ((resource_int_value(SC_DRIVER_NAME, u, "disabled",
-					&disabled) == 0) && disabled)
-			continue;
-		if (resource_string_value(SC_DRIVER_NAME, u, "at", &at) != 0)
-			continue;
-		if (resource_int_value(SC_DRIVER_NAME, u, "flags", &f) != 0)
-			f = 0;
-		if (f & SC_KERNEL_CONSOLE) {
-			/* the user designates this unit to be the console */
-			*unit = u;
-			*flags = f;
-			break;
-		}
-		if (*unit < 0) {
-			/* ...otherwise remember the first found unit */
-			*unit = u;
-			*flags = f;
-		}
-	}
-	if (*unit < 0)
-		return CN_DEAD;
-#if 0
-	return ((*flags & SC_KERNEL_CONSOLE) ? CN_INTERNAL : CN_NORMAL);
-#endif
+	*unit = 0;
+	*flags = 0;
 	return CN_INTERNAL;
 }
 
 void
 sc_get_bios_values(bios_values_t *values)
 {
-#ifdef __i386__
-	u_int8_t shift;
-
-	values->cursor_start = *(u_int8_t *)BIOS_PADDRTOVADDR(0x461);
-	values->cursor_end = *(u_int8_t *)BIOS_PADDRTOVADDR(0x460);
-	shift = *(u_int8_t *)BIOS_PADDRTOVADDR(0x417);
-	values->shift_state = ((shift & BIOS_CLKED) ? CLKED : 0)
-			       | ((shift & BIOS_NLKED) ? NLKED : 0)
-			       | ((shift & BIOS_SLKED) ? SLKED : 0)
-			       | ((shift & BIOS_ALKED) ? ALKED : 0);
-	values->bell_pitch = BELL_PITCH;
-#else /* !__i386__ */
+	/* XXX - MD */
 	values->cursor_start = 0;
 	values->cursor_end = 32;
 	values->shift_state = 0;
 	values->bell_pitch = BELL_PITCH;
-#endif /* __i386__ */
 }
 
 int
 sc_tone(int herz)
 {
-#ifdef __i386__
-	int pitch;
-
-	if (herz) {
-		/* set command for counter 2, 2 byte write */
-		if (acquire_timer2(TIMER_16BIT | TIMER_SQWAVE))
-			return EBUSY;
-		/* set pitch */
-		pitch = timer_freq/herz;
-		outb(TIMER_CNTR2, pitch);
-		outb(TIMER_CNTR2, pitch >> 8);
-		/* enable counter 2 output to speaker */
-		outb(IO_PPI, inb(IO_PPI) | 3);
-	} else {
-		/* disable counter 2 output to speaker */
-		outb(IO_PPI, inb(IO_PPI) & 0xFC);
-		release_timer2();
-	}
-#endif /* __i386__ */
-
+	/* XXX - MD */
 	return 0;
 }
 
 static device_method_t sc_methods[] = {
 	DEVMETHOD(device_identify,	scidentify),
-	DEVMETHOD(device_probe,         scprobe),
-	DEVMETHOD(device_attach,        scattach),
-	DEVMETHOD(device_suspend,       scsuspend),
-	DEVMETHOD(device_resume,        scresume),
+	DEVMETHOD(device_probe,		scprobe),
+	DEVMETHOD(device_attach,	scattach),
 	{ 0, 0 }
 };
 
@@ -280,4 +160,4 @@
 	sizeof(sc_softc_t),
 };
 
-DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0);
+DRIVER_MODULE(sc, nexus, sc_driver, sc_devclass, 0, 0);

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211300405.gAU454Uo013466>