PERFORCE change 53414 for review

Marcel Moolenaar marcel at FreeBSD.org
Mon May 24 13:23:40 PDT 2004


http://perforce.freebsd.org/chv.cgi?CH=53414

Change 53414 by marcel at marcel_nfs on 2004/05/24 13:23:02

	Remove alpha specific code. This appears to work, but since
	the TGA driver panics on my box as it does with CVS HEAD,
	testing was limited. Note that the panic is caused by not
	having a proper virtual address for the memory resource.
	This is a fundamental problem.

Affected files ...

.. //depot/projects/gdb/sys/dev/gfb/gfb_pci.c#3 edit
.. //depot/projects/gdb/sys/dev/syscons/syscons.c#7 edit

Differences ...

==== //depot/projects/gdb/sys/dev/gfb/gfb_pci.c#3 (text+ko) ====

@@ -32,9 +32,6 @@
 
 #include "opt_fb.h"
 
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/gfb/gfb_pci.c,v 1.11 2004/03/17 17:50:33 njl Exp $");
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -66,23 +63,10 @@
 #include <dev/fb/gfb.h>
 #include <dev/gfb/gfb_pci.h>
 
-#ifdef __alpha__
-
-#include <machine/rpb.h>
-#include <machine/cpu.h>
-
-#endif /* __alpha__ */
-
 #if 0
 static devclass_t gfb_devclass;
 #endif
 
-#ifdef __alpha__
-
-extern void sccnattach(void);
-
-#endif /* __alpha__ */
-
 extern struct gfb_font bold8x16;
 extern struct gfb_softc *gfb_device_softcs[2][16];
 
@@ -93,9 +77,6 @@
 	gfb_softc_t sc;
 	video_adapter_t *adp;
 	int unit, flags, error, rid, va_index;
-#ifdef __alpha__
-	struct ctb *ctb;
-#endif /* __alpha__ */
 
 	s = splimp();
 	error = 0;
@@ -136,7 +117,7 @@
 		adp->va_mem_base = (vm_offset_t)rman_get_virtual(sc->res);
 		adp->va_mem_size = rman_get_end(sc->res) -
 		    rman_get_start(sc->res);
-		adp->va_io_base = 0;
+		adp->va_io_base = (vm_offset_t)sc->res;	/* XXX */
 		adp->va_io_size = 0;
 		adp->va_crtc_addr = 0;
 		gfb_device_softcs[sc->model][unit] = sc;
@@ -191,19 +172,6 @@
 		gfb_device_softcs[sc->model][unit] = sc;
 	}
 
-	/*
-	   This is a back-door for PCI devices--since FreeBSD no longer supports
-	   PCI configuration-space accesses during the *configure() phase for
-	   video adapters, we cannot identify a PCI device as the console during
-	   the first call to sccnattach(). There must be a second chance for PCI
-	   adapters to be recognized as the console, and this is it...
-	*/
-#ifdef __alpha__
-	ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
-	if (ctb->ctb_term_type == 3) /* Display adapter */
-		sccnattach();
-#endif /* __alpha__ */
-
 	device_printf(dev, "Board type %s\n", sc->gfbc->name);
 	device_printf(dev, "%d x %d, %dbpp, %s RAMDAC\n",
 	       sc->adp->va_info.vi_width, sc->adp->va_info.vi_height,

==== //depot/projects/gdb/sys/dev/syscons/syscons.c#7 (text+ko) ====

@@ -155,9 +155,7 @@
 static void scstart(struct tty *tp);
 static void scinit(int unit, int flags);
 static scr_stat *sc_get_stat(dev_t devptr);
-#if !__alpha__
 static void scterm(int unit, int flags);
-#endif
 static void scshutdown(void *arg, int howto);
 static u_int scgetc(sc_softc_t *sc, u_int flags);
 #define SCGETC_CN	1
@@ -206,10 +204,6 @@
 static cn_dbctl_t	sccndbctl;
 static cn_term_t	sccnterm;
 
-#if __alpha__
-void sccnattach(void);
-#endif
-
 CONS_DRIVER(sc, sccnprobe, sccninit, sccnterm, sccngetc, sccncheckc, sccnputc,
 	    sccndbctl);
 
@@ -1384,7 +1378,6 @@
 static void
 sccnprobe(struct consdev *cp)
 {
-#if !__alpha__
     int unit;
     int flags;
 
@@ -1402,22 +1395,11 @@
 
     /* initialize required fields */
     sprintf(cp->cn_name, "consolectl");
-#endif /* !__alpha__ */
-
-#if __alpha__
-    /*
-     * alpha use sccnattach() rather than cnprobe()/cninit()/cnterm()
-     * interface to install the console.  Always return CN_DEAD from
-     * here.
-     */
-    cp->cn_pri = CN_DEAD;
-#endif /* __alpha__ */
 }
 
 static void
 sccninit(struct consdev *cp)
 {
-#if !__alpha__
     int unit;
     int flags;
 
@@ -1426,11 +1408,6 @@
     sc_console_unit = unit;
     sc_console = sc_get_stat(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]);
     sc_consptr = cp;
-#endif /* !__alpha__ */
-
-#if __alpha__
-    /* SHOULDN'T REACH HERE */
-#endif /* __alpha__ */
 }
 
 static void
@@ -1441,54 +1418,16 @@
     if (sc_console_unit < 0)
 	return;			/* shouldn't happen */
 
-#if !__alpha__
 #if 0 /* XXX */
     sc_clear_screen(sc_console);
     sccnupdate(sc_console);
 #endif
+
     scterm(sc_console_unit, SC_KERNEL_CONSOLE);
     sc_console_unit = -1;
     sc_console = NULL;
-#endif /* !__alpha__ */
-
-#if __alpha__
-    /* do nothing XXX */
-#endif /* __alpha__ */
 }
 
-#ifdef __alpha__
-
-void
-sccnattach(void)
-{
-    static struct consdev consdev;
-    int unit;
-    int flags;
-
-    bcopy(&sc_consdev, &consdev, sizeof(sc_consdev));
-    consdev.cn_pri = sc_get_cons_priority(&unit, &flags);
-
-    /* a video card is always required */
-    if (!scvidprobe(unit, flags, TRUE))
-	consdev.cn_pri = CN_DEAD;
-
-    /* alpha doesn't allow the console being without a keyboard... Why? */
-    if (!sckbdprobe(unit, flags, TRUE))
-	consdev.cn_pri = CN_DEAD;
-
-    if (consdev.cn_pri == CN_DEAD)
-	return;
-
-    scinit(unit, flags | SC_KERNEL_CONSOLE);
-    sc_console_unit = unit;
-    sc_consptr = &consdev;
-    sc_console = sc_get_stat(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]);
-    sprintf(consdev.cn_name, "ttyv%r", 0);
-    cnadd(&consdev);
-}
-
-#endif /* __alpha__ */
-
 static void
 sccnputc(struct consdev *cd, int c)
 {
@@ -2853,7 +2792,6 @@
     sc->flags |= SC_INIT_DONE;
 }
 
-#if !__alpha__
 static void
 scterm(int unit, int flags)
 {
@@ -2909,7 +2847,6 @@
     sc->keyboard = -1;
     sc->adapter = -1;
 }
-#endif /* !__alpha__ */
 
 static void
 scshutdown(void *arg, int howto)


More information about the p4-projects mailing list