Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Aug 2017 19:33:16 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322705 - in head/sys: arm/arm dev/syscons isa mips/mips powerpc/powerpc
Message-ID:  <201708191933.v7JJXGju087677@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bde
Date: Sat Aug 19 19:33:16 2017
New Revision: 322705
URL: https://svnweb.freebsd.org/changeset/base/322705

Log:
  Use better hard-coded defaults for the cursor shape, and remove nearby
  redundant initializations.
  
  Hard-code base = 0, height = (approx. 1/8 of the boot-time font height)
  in all cases, and remove the BIOS/MD support for setting these values.
  This asks for an underline cursor sized for the boot-time font instead
  of various less hard-coded but worse values.  I used that think that
  the x86 BIOS always gave the same values as the above hard-coding, but
  on 1 of my systems it gives the wrong value of base = 1.
  
  The remaining BIOS fields are shift_state and bell_pitch.  These are now
  consistently not explicitly reinitialized to 0.  All sc_get_bios_value()
  functions except x86's are now empty, and the only useful thing that x86
  returns is shift_state.  This really belongs in atkbdc, but heavier
  use of the BIOS to read the more useful typematic rate has been removed
  there.  fb still makes much heavier use of the BIOS.

Modified:
  head/sys/arm/arm/sc_machdep.c
  head/sys/dev/syscons/syscons.c
  head/sys/dev/syscons/syscons.h
  head/sys/isa/syscons_isa.c
  head/sys/mips/mips/sc_machdep.c
  head/sys/powerpc/powerpc/sc_machdep.c

Modified: head/sys/arm/arm/sc_machdep.c
==============================================================================
--- head/sys/arm/arm/sc_machdep.c	Sat Aug 19 19:06:40 2017	(r322704)
+++ head/sys/arm/arm/sc_machdep.c	Sat Aug 19 19:33:16 2017	(r322705)
@@ -78,9 +78,6 @@ sc_get_softc(int unit, int flags)
 void
 sc_get_bios_values(bios_values_t *values)
 {
-	values->cursor_start = 0;
-	values->cursor_end = 32;
-	values->shift_state = 0;
 }
 
 int

Modified: head/sys/dev/syscons/syscons.c
==============================================================================
--- head/sys/dev/syscons/syscons.c	Sat Aug 19 19:06:40 2017	(r322704)
+++ head/sys/dev/syscons/syscons.c	Sat Aug 19 19:33:16 2017	(r322705)
@@ -3208,14 +3208,8 @@ scinit(int unit, int flags)
 	scp->cursor_pos = scp->cursor_oldpos = row*scp->xsize + col;
 	(*scp->tsw->te_sync)(scp);
 
-	/* Sync BIOS cursor shape to s/w (sc only). */
-	if (bios_value.cursor_end < scp->font_size)
-	    sc->dflt_curs_attr.base = scp->font_size - 
-					  bios_value.cursor_end - 1;
-	else
-	    sc->dflt_curs_attr.base = 0;
-	i = bios_value.cursor_end - bios_value.cursor_start + 1;
-	sc->dflt_curs_attr.height = imin(i, scp->font_size);
+	sc->dflt_curs_attr.base = 0;
+	sc->dflt_curs_attr.height = howmany(scp->font_size, 8);
 	sc->dflt_curs_attr.flags = 0;
 	sc->curs_attr = sc->dflt_curs_attr;
 	scp->curr_curs_attr = scp->dflt_curs_attr = sc->curs_attr;

Modified: head/sys/dev/syscons/syscons.h
==============================================================================
--- head/sys/dev/syscons/syscons.h	Sat Aug 19 19:06:40 2017	(r322704)
+++ head/sys/dev/syscons/syscons.h	Sat Aug 19 19:33:16 2017	(r322705)
@@ -516,8 +516,6 @@ typedef struct sc_renderer {
 		       SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
 
 typedef struct {
-	int		cursor_start;
-	int		cursor_end;
 	int		shift_state;
 	int		bell_pitch;
 } bios_values_t;

Modified: head/sys/isa/syscons_isa.c
==============================================================================
--- head/sys/isa/syscons_isa.c	Sat Aug 19 19:06:40 2017	(r322704)
+++ head/sys/isa/syscons_isa.c	Sat Aug 19 19:33:16 2017	(r322705)
@@ -207,17 +207,11 @@ sc_get_bios_values(bios_values_t *values)
 #if defined(__i386__) || defined(__amd64__)
 	uint8_t shift;
 
-	values->cursor_start = *(uint8_t *)BIOS_PADDRTOVADDR(0x461);
-	values->cursor_end = *(uint8_t *)BIOS_PADDRTOVADDR(0x460);
 	shift = *(uint8_t *)BIOS_PADDRTOVADDR(0x417);
 	values->shift_state = ((shift & BIOS_CLKED) != 0 ? CLKED : 0) |
 	    ((shift & BIOS_NLKED) != 0 ? NLKED : 0) |
 	    ((shift & BIOS_SLKED) != 0 ? SLKED : 0) |
 	    ((shift & BIOS_ALKED) != 0 ? ALKED : 0);
-#else
-	values->cursor_start = 0;
-	values->cursor_end = 32;
-	values->shift_state = 0;
 #endif
 	values->bell_pitch = BELL_PITCH;
 }

Modified: head/sys/mips/mips/sc_machdep.c
==============================================================================
--- head/sys/mips/mips/sc_machdep.c	Sat Aug 19 19:06:40 2017	(r322704)
+++ head/sys/mips/mips/sc_machdep.c	Sat Aug 19 19:33:16 2017	(r322705)
@@ -78,9 +78,6 @@ sc_get_softc(int unit, int flags)
 void
 sc_get_bios_values(bios_values_t *values)
 {
-	values->cursor_start = 0;
-	values->cursor_end = 32;
-	values->shift_state = 0;
 }
 
 int

Modified: head/sys/powerpc/powerpc/sc_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/sc_machdep.c	Sat Aug 19 19:06:40 2017	(r322704)
+++ head/sys/powerpc/powerpc/sc_machdep.c	Sat Aug 19 19:33:16 2017	(r322705)
@@ -78,9 +78,6 @@ sc_get_softc(int unit, int flags)
 void
 sc_get_bios_values(bios_values_t *values)
 {
-	values->cursor_start = 0;
-	values->cursor_end = 32;
-	values->shift_state = 0;
 }
 
 int



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