Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 May 2004 18:13:54 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 53366 for review
Message-ID:  <200405240113.i4O1DsOe043506@repoman.freebsd.org>

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

Change 53366 by marcel@marcel_nfs on 2004/05/23 18:13:48

	Remove all alpha specific console code. A serial console
	based on sio(4) does not need it on my Alpha. This may
	not hold for all the various models, but in that case it
	should be handled in a way less gross.

Affected files ...

.. //depot/projects/gdb/sys/dev/sio/sio.c#10 edit

Differences ...

==== //depot/projects/gdb/sys/dev/sio/sio.c#10 (text+ko) ====

@@ -2746,28 +2746,20 @@
 	sprintf(cd->cn_name, "ttyd%d", unit);
 }
 
-#ifndef __alpha__
 static speed_t siocngetspeed(Port_t, u_long rclk);
-#endif
 static void siocnclose(struct siocnstate *sp, Port_t iobase);
 static void siocnopen(struct siocnstate *sp, Port_t iobase, int speed);
 static void siocntxwait(Port_t iobase);
 
-#ifdef __alpha__
-int siocnattach(int port, int speed);
-#else
 static cn_probe_t siocnprobe;
 static cn_init_t siocninit;
 static cn_term_t siocnterm;
-#endif
 static cn_checkc_t siocncheckc;
 static cn_getc_t siocngetc;
 static cn_putc_t siocnputc;
 
-#ifndef __alpha__
 CONS_DRIVER(sio, siocnprobe, siocninit, siocnterm, siocngetc, siocncheckc,
 	    siocnputc, NULL);
-#endif
 
 static void
 siocntxwait(iobase)
@@ -2786,8 +2778,6 @@
 		;
 }
 
-#ifndef __alpha__
-
 /*
  * Read the serial port specified and try to figure out what speed
  * it's currently running at.  We're assuming the serial port has
@@ -2823,8 +2813,6 @@
 	return (rclk / (16UL * divisor));
 }
 
-#endif
-
 static void
 siocnopen(sp, iobase, speed)
 	struct siocnstate	*sp;
@@ -2892,8 +2880,6 @@
 	outb(iobase + com_ier, sp->ier);
 }
 
-#ifndef __alpha__
-
 static void
 siocnprobe(cp)
 	struct consdev	*cp;
@@ -2991,56 +2977,6 @@
 	comconsole = -1;
 }
 
-#endif
-
-#ifdef __alpha__
-
-CONS_DRIVER(sio, NULL, NULL, NULL, siocngetc, siocncheckc, siocnputc, NULL);
-
-int
-siocnattach(port, speed)
-	int port;
-	int speed;
-{
-	int			s;
-	u_char			cfcr;
-	u_int			divisor;
-	struct siocnstate	sp;
-	int			unit = 0;	/* XXX random value! */
-
-	siocniobase = port;
-	siocnunit = unit;
-	comdefaultrate = speed;
-	sio_consdev.cn_pri = CN_NORMAL;
-	siocnset(&sio_consdev, unit);
-
-	s = spltty();
-
-	/*
-	 * Initialize the divisor latch.  We can't rely on
-	 * siocnopen() to do this the first time, since it 
-	 * avoids writing to the latch if the latch appears
-	 * to have the correct value.  Also, if we didn't
-	 * just read the speed from the hardware, then we
-	 * need to set the speed in hardware so that
-	 * switching it later is null.
-	 */
-	cfcr = inb(siocniobase + com_cfcr);
-	outb(siocniobase + com_cfcr, CFCR_DLAB | cfcr);
-	divisor = siodivisor(comdefaultrclk, comdefaultrate);
-	outb(siocniobase + com_dlbl, divisor & 0xff);
-	outb(siocniobase + com_dlbh, divisor >> 8);
-	outb(siocniobase + com_cfcr, cfcr);
-
-	siocnopen(&sp, siocniobase, comdefaultrate);
-	splx(s);
-
-	cnadd(&sio_consdev);
-	return (0);
-}
-
-#endif
-
 static int
 siocncheckc(struct consdev *cd)
 {



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