aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2020-02-03 17:35:11 +0000
committerWarner Losh <imp@FreeBSD.org>2020-02-03 17:35:11 +0000
commit58aa35d42975c298ca0adba705c042596303c9f5 (patch)
tree2558d2b720cda9c2799970cabc266e2ce4e3a8d3 /sys/dev/syscons
parenteb24e1491f9900e922c78e53af588f22a3e9535f (diff)
Notes
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/scgfbrndr.c34
-rw-r--r--sys/dev/syscons/schistory.c3
-rw-r--r--sys/dev/syscons/scterm-dumb.c3
-rw-r--r--sys/dev/syscons/scterm-sc.c3
-rw-r--r--sys/dev/syscons/scterm-teken.c3
-rw-r--r--sys/dev/syscons/scvtb.c28
-rw-r--r--sys/dev/syscons/syscons.c19
-rw-r--r--sys/dev/syscons/syscons.h10
8 files changed, 6 insertions, 97 deletions
diff --git a/sys/dev/syscons/scgfbrndr.c b/sys/dev/syscons/scgfbrndr.c
index 190da5254546c..2dc4f503854e6 100644
--- a/sys/dev/syscons/scgfbrndr.c
+++ b/sys/dev/syscons/scgfbrndr.c
@@ -107,38 +107,11 @@ sc_rndr_sw_t grrndrsw = {
#endif /* SC_NO_MODE_CHANGE */
#ifndef SC_NO_CUTPASTE
-#ifdef __sparc64__
-static u_char mouse_pointer[22 * 2] = {
- 0x00, 0x00, /* ............ */
- 0x80, 0x00, /* *........... */
- 0xc0, 0x00, /* **.......... */
- 0xe0, 0x00, /* ***......... */
- 0xf0, 0x00, /* ****........ */
- 0xf8, 0x00, /* *****....... */
- 0xfc, 0x00, /* ******...... */
- 0xfe, 0x00, /* *******..... */
- 0xff, 0x00, /* ********.... */
- 0xff, 0x80, /* *********... */
- 0xfc, 0xc0, /* ******..**.. */
- 0xdc, 0x00, /* **.***...... */
- 0x8e, 0x00, /* *...***..... */
- 0x0e, 0x00, /* ....***..... */
- 0x07, 0x00, /* .....***.... */
- 0x04, 0x00, /* .....*...... */
- 0x00, 0x00, /* ............ */
- 0x00, 0x00, /* ............ */
- 0x00, 0x00, /* ............ */
- 0x00, 0x00, /* ............ */
- 0x00, 0x00, /* ............ */
- 0x00, 0x00 /* ............ */
-};
-#else
static u_char mouse_pointer[16] = {
0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68,
0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00
};
#endif
-#endif
static void
gfb_nop(scr_stat *scp)
@@ -241,7 +214,7 @@ gfb_cursor_shape(scr_stat *scp, int base, int height, int blink)
static int pxlblinkrate = 0;
-#if defined(__sparc64__) || defined(SC_OFWFB)
+#if defined(SC_OFWFB)
static void
gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip)
{
@@ -336,17 +309,12 @@ gfb_blink(scr_stat *scp, int at, int flip)
static void
gfb_mouse(scr_stat *scp, int x, int y, int on)
{
-#ifdef __sparc64__
- vidd_putm(scp->sc->adp, x, y, mouse_pointer,
- on ? 0xffffffff : 0x0, 22, 12);
-#else
if (on) {
vidd_putm(scp->sc->adp, x, y, mouse_pointer,
0xffffffff, 16, 8);
} else {
/* XXX: removal is incomplete for h/w cursors and borders. */
}
-#endif
}
#endif /* SC_NO_CUTPASTE */
diff --git a/sys/dev/syscons/schistory.c b/sys/dev/syscons/schistory.c
index 8da242c8a9f88..64f662b5a7f4f 100644
--- a/sys/dev/syscons/schistory.c
+++ b/sys/dev/syscons/schistory.c
@@ -44,8 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/malloc.h>
-#if defined(__arm__) || defined(__mips__) || \
- defined(__powerpc__) || defined(__sparc64__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
#include <machine/sc_machdep.h>
#else
#include <machine/pc/display.h>
diff --git a/sys/dev/syscons/scterm-dumb.c b/sys/dev/syscons/scterm-dumb.c
index b888897d5437e..3011b0de8f529 100644
--- a/sys/dev/syscons/scterm-dumb.c
+++ b/sys/dev/syscons/scterm-dumb.c
@@ -35,8 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/consio.h>
-#if defined(__arm__) || defined(__mips__) || \
- defined(__powerpc__) || defined(__sparc64__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
#include <machine/sc_machdep.h>
#else
#include <machine/pc/display.h>
diff --git a/sys/dev/syscons/scterm-sc.c b/sys/dev/syscons/scterm-sc.c
index 52ba50714f9d5..de46827b58379 100644
--- a/sys/dev/syscons/scterm-sc.c
+++ b/sys/dev/syscons/scterm-sc.c
@@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/consio.h>
-#if defined(__arm__) || defined(__mips__) || \
- defined(__powerpc__) || defined(__sparc64__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
#include <machine/sc_machdep.h>
#else
#include <machine/pc/display.h>
diff --git a/sys/dev/syscons/scterm-teken.c b/sys/dev/syscons/scterm-teken.c
index ae231f01d2945..b575b4ec3119e 100644
--- a/sys/dev/syscons/scterm-teken.c
+++ b/sys/dev/syscons/scterm-teken.c
@@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/consio.h>
#include <sys/kbio.h>
-#if defined(__arm__) || defined(__mips__) || \
- defined(__powerpc__) || defined(__sparc64__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
#include <machine/sc_machdep.h>
#else
#include <machine/pc/display.h>
diff --git a/sys/dev/syscons/scvtb.c b/sys/dev/syscons/scvtb.c
index 44b667b8ab82e..28ea4b41666c7 100644
--- a/sys/dev/syscons/scvtb.c
+++ b/sys/dev/syscons/scvtb.c
@@ -76,12 +76,10 @@ sc_vtb_init(sc_vtb_t *vtb, int type, int cols, int rows, void *buf, int wait)
}
vtb->vtb_flags |= VTB_VALID;
break;
-#ifndef __sparc64__
case VTB_FRAMEBUFFER:
vtb->vtb_buffer = (vm_offset_t)buf;
vtb->vtb_flags |= VTB_VALID;
break;
-#endif
default:
break;
}
@@ -121,44 +119,36 @@ sc_vtb_size(int cols, int rows)
int
sc_vtb_getc(sc_vtb_t *vtb, int at)
{
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
return (readw(sc_vtb_pointer(vtb, at)) & 0x00ff);
else
-#endif
return (*(u_int16_t *)sc_vtb_pointer(vtb, at) & 0x00ff);
}
int
sc_vtb_geta(sc_vtb_t *vtb, int at)
{
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
return (readw(sc_vtb_pointer(vtb, at)) & 0xff00);
else
-#endif
return (*(u_int16_t *)sc_vtb_pointer(vtb, at) & 0xff00);
}
void
sc_vtb_putc(sc_vtb_t *vtb, int at, int c, int a)
{
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
writew(sc_vtb_pointer(vtb, at), a | c);
else
-#endif
*(u_int16_t *)sc_vtb_pointer(vtb, at) = a | c;
}
vm_offset_t
sc_vtb_putchar(sc_vtb_t *vtb, vm_offset_t p, int c, int a)
{
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
writew(p, a | c);
else
-#endif
*(u_int16_t *)p = a | c;
return (p + sizeof(u_int16_t));
}
@@ -178,18 +168,15 @@ sc_vtb_pos(sc_vtb_t *vtb, int pos, int offset)
void
sc_vtb_clear(sc_vtb_t *vtb, int c, int attr)
{
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
fillw_io(attr | c, sc_vtb_pointer(vtb, 0), vtb->vtb_size);
else
-#endif
fillw(attr | c, (void *)sc_vtb_pointer(vtb, 0), vtb->vtb_size);
}
void
sc_vtb_copy(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int to, int count)
{
-#ifndef __sparc64__
/* XXX if both are VTB_VRAMEBUFFER... */
if (vtb2->vtb_type == VTB_FRAMEBUFFER)
bcopy_toio(sc_vtb_pointer(vtb1, from),
@@ -200,7 +187,6 @@ sc_vtb_copy(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int to, int count)
sc_vtb_pointer(vtb2, to),
count*sizeof(u_int16_t));
else
-#endif
bcopy((void *)sc_vtb_pointer(vtb1, from),
(void *)sc_vtb_pointer(vtb2, to),
count*sizeof(u_int16_t));
@@ -216,13 +202,11 @@ sc_vtb_append(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int count)
while (count > 0) {
len = imin(count, vtb2->vtb_size - vtb2->vtb_tail);
-#ifndef __sparc64__
if (vtb1->vtb_type == VTB_FRAMEBUFFER)
bcopy_fromio(sc_vtb_pointer(vtb1, from),
sc_vtb_pointer(vtb2, vtb2->vtb_tail),
len*sizeof(u_int16_t));
else
-#endif
bcopy((void *)sc_vtb_pointer(vtb1, from),
(void *)sc_vtb_pointer(vtb2, vtb2->vtb_tail),
len*sizeof(u_int16_t));
@@ -243,11 +227,9 @@ sc_vtb_erase(sc_vtb_t *vtb, int at, int count, int c, int attr)
{
if (at + count > vtb->vtb_size)
count = vtb->vtb_size - at;
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
fillw_io(attr | c, sc_vtb_pointer(vtb, at), count);
else
-#endif
fillw(attr | c, (void *)sc_vtb_pointer(vtb, at), count);
}
@@ -260,12 +242,10 @@ sc_vtb_move(sc_vtb_t *vtb, int from, int to, int count)
count = vtb->vtb_size - to;
if (count <= 0)
return;
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
bcopy_io(sc_vtb_pointer(vtb, from),
sc_vtb_pointer(vtb, to), count*sizeof(u_int16_t));
else
-#endif
bcopy((void *)sc_vtb_pointer(vtb, from),
(void *)sc_vtb_pointer(vtb, to), count*sizeof(u_int16_t));
}
@@ -279,23 +259,19 @@ sc_vtb_delete(sc_vtb_t *vtb, int at, int count, int c, int attr)
count = vtb->vtb_size - at;
len = vtb->vtb_size - at - count;
if (len > 0) {
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
bcopy_io(sc_vtb_pointer(vtb, at + count),
sc_vtb_pointer(vtb, at),
len*sizeof(u_int16_t));
else
-#endif
bcopy((void *)sc_vtb_pointer(vtb, at + count),
(void *)sc_vtb_pointer(vtb, at),
len*sizeof(u_int16_t));
}
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
fillw_io(attr | c, sc_vtb_pointer(vtb, at + len),
vtb->vtb_size - at - len);
else
-#endif
fillw(attr | c, (void *)sc_vtb_pointer(vtb, at + len),
vtb->vtb_size - at - len);
}
@@ -306,21 +282,17 @@ sc_vtb_ins(sc_vtb_t *vtb, int at, int count, int c, int attr)
if (at + count > vtb->vtb_size)
count = vtb->vtb_size - at;
else {
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
bcopy_io(sc_vtb_pointer(vtb, at),
sc_vtb_pointer(vtb, at + count),
(vtb->vtb_size - at - count)*sizeof(u_int16_t));
else
-#endif
bcopy((void *)sc_vtb_pointer(vtb, at),
(void *)sc_vtb_pointer(vtb, at + count),
(vtb->vtb_size - at - count)*sizeof(u_int16_t));
}
-#ifndef __sparc64__
if (vtb->vtb_type == VTB_FRAMEBUFFER)
fillw_io(attr | c, sc_vtb_pointer(vtb, at), count);
else
-#endif
fillw(attr | c, (void *)sc_vtb_pointer(vtb, at), count);
}
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 06d4e525e834f..d822820e13a01 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -65,8 +65,7 @@ __FBSDID("$FreeBSD$");
#include <sys/power.h>
#include <machine/clock.h>
-#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) || \
- defined(__sparc64__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
#include <machine/sc_machdep.h>
#else
#include <machine/pc/display.h>
@@ -536,10 +535,8 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc_t *sc, int unit)
scp->end = 0;
scp->cursor_pos = scp->cursor_oldpos = scp->xsize * scp->xsize;
scp->mode = sc->initial_mode = vmode;
-#ifndef __sparc64__
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
(void *)sc->adp->va_window, FALSE);
-#endif
sc_alloc_scr_buffer(scp, FALSE, FALSE);
sc_init_emulator(scp, NULL);
#ifndef SC_NO_CUTPASTE
@@ -725,9 +722,7 @@ sctty_open(struct tty *tp)
int unit = scdevtounit(tp);
sc_softc_t *sc;
scr_stat *scp;
-#ifndef __sparc64__
keyarg_t key;
-#endif
DPRINTF(5,
("scopen: dev:%s, unit:%d, vty:%d\n", devtoname(tp->t_dev), unit,
@@ -741,13 +736,11 @@ sctty_open(struct tty *tp)
if (!tty_opened(tp)) {
/* Use the current setting of the <-- key as default VERASE. */
/* If the Delete key is preferable, an stty is necessary */
-#ifndef __sparc64__
if (sc->kbd != NULL) {
key.keynum = KEYCODE_BS;
(void)kbdd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key);
tp->t_termios.c_cc[VERASE] = key.key.map[0];
}
-#endif
}
scp = sc_get_stat(tp);
@@ -789,9 +782,7 @@ sctty_close(struct tty *tp)
scp->smode.mode = VT_AUTO;
} else {
sc_vtb_destroy(&scp->vtb);
-#ifndef __sparc64__
sc_vtb_destroy(&scp->scr);
-#endif
sc_free_history_buffer(scp, scp->ysize);
SC_STAT(tp) = NULL;
free(scp, M_DEVBUF);
@@ -3003,11 +2994,9 @@ exchange_scr(sc_softc_t *sc)
scp = sc->cur_scp = sc->new_scp;
if (sc->old_scp->mode != scp->mode || ISUNKNOWNSC(sc->old_scp))
set_mode(scp);
-#ifndef __sparc64__
else
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
(void *)sc->adp->va_window, FALSE);
-#endif
scp->status |= MOUSE_HIDDEN;
sc_move_cursor(scp, scp->xpos, scp->ypos);
if (!ISGRAPHSC(scp))
@@ -3334,14 +3323,12 @@ scinit(int unit, int flags)
}
sc->cur_scp = scp;
-#ifndef __sparc64__
/* copy screen to temporary buffer */
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
(void *)scp->sc->adp->va_window, FALSE);
if (ISTEXTSC(scp))
sc_vtb_copy(&scp->scr, 0, &scp->vtb, 0,
scp->xsize * scp->ysize);
-#endif
/* Sync h/w cursor position to s/w (sc and teken). */
if (col >= scp->xsize)
@@ -3666,9 +3653,7 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp)
#endif
sc_vtb_init(&scp->vtb, VTB_MEMORY, 0, 0, NULL, FALSE);
-#ifndef __sparc64__
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, 0, 0, NULL, FALSE);
-#endif
scp->xoff = scp->yoff = 0;
scp->xpos = scp->ypos = 0;
scp->start = scp->xsize * scp->ysize - 1;
@@ -4192,10 +4177,8 @@ set_mode(scr_stat *scp)
/* setup video hardware for the given mode */
vidd_set_mode(scp->sc->adp, scp->mode);
scp->rndr->init(scp);
-#ifndef __sparc64__
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
(void *)scp->sc->adp->va_window, FALSE);
-#endif
update_font(scp);
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h
index 405e5ba429322..21060352f7676 100644
--- a/sys/dev/syscons/syscons.h
+++ b/sys/dev/syscons/syscons.h
@@ -88,15 +88,7 @@
#define DPRINTF(l, p) if (SC_DEBUG_LEVEL >= (l)) printf p
-#ifndef __sparc64__
#define SC_DRIVER_NAME "sc"
-#else
-/*
- * Use a different driver name on sparc64 so it does not get confused
- * with the system controller devices which are also termed 'sc' in OFW.
- */
-#define SC_DRIVER_NAME "syscons"
-#endif
#define SC_VTY(dev) (((sc_ttysoftc *)tty_softc(tp))->st_index)
#define SC_DEV(sc, vty) ((sc)->dev[(vty) - (sc)->first_vty])
#define SC_STAT(tp) (*((scr_stat **)&((sc_ttysoftc *)tty_softc(tp))->st_stat))
@@ -287,9 +279,7 @@ typedef struct scr_stat {
int index; /* index of this vty */
struct sc_softc *sc; /* pointer to softc */
struct sc_rndr_sw *rndr; /* renderer */
-#ifndef __sparc64__
sc_vtb_t scr;
-#endif
sc_vtb_t vtb;
int xpos; /* current X position */