summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/fb/fbreg.h18
-rw-r--r--sys/dev/syscons/scgfbrndr.c5
-rw-r--r--sys/dev/syscons/schistory.c2
-rw-r--r--sys/dev/syscons/scterm-dumb.c2
-rw-r--r--sys/dev/syscons/scterm-sc.c2
-rw-r--r--sys/dev/syscons/syscons.c20
6 files changed, 34 insertions, 15 deletions
diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h
index e7c91b6..7db6315 100644
--- a/sys/dev/fb/fbreg.h
+++ b/sys/dev/fb/fbreg.h
@@ -75,7 +75,23 @@ fillw(int val, uint16_t *buf, size_t size)
while (size--)
*buf++ = val;
}
-#else /* !__i386__ && !__ia64__ && !__amd64__ */
+#elif __powerpc__
+
+#define bcopy_io(s, d, c) ofwfb_bcopy((void *)(s), (void *)(d), (c))
+#define bcopy_toio(s, d, c) ofwfb_bcopy((void *)(s), (void *)(d), (c))
+#define bcopy_fromio(s, d, c) ofwfb_bcopy((void *)(s), (void *)(d), (c))
+#define bzero_io(d, c) ofwfb_bzero((void *)(d), (c))
+#define fillw(p, d, c) ofwfb_fillw((p), (void *)(d), (c))
+#define fillw_io(p, d, c) ofwfb_fillw((p), (void *)(d), (c))
+#define readw(a) ofwfb_readw((u_int16_t *)(a))
+#define writew(a, v) ofwfb_writew((u_int16_t *)(a), (v))
+void ofwfb_bcopy(const void *s, void *d, size_t c);
+void ofwfb_bzero(void *d, size_t c);
+void ofwfb_fillw(int pat, void *base, size_t cnt);
+u_int16_t ofwfb_readw(u_int16_t *addr);
+void ofwfb_writew(u_int16_t *addr, u_int16_t val);
+
+#else /* !__i386__ && !__ia64__ && !__amd64__ && !__powerpc__ */
#define bcopy_io(s, d, c) memcpy_io((d), (s), (c))
#define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c))
#define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c))
diff --git a/sys/dev/syscons/scgfbrndr.c b/sys/dev/syscons/scgfbrndr.c
index b031214..cba157e 100644
--- a/sys/dev/syscons/scgfbrndr.c
+++ b/sys/dev/syscons/scgfbrndr.c
@@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$");
#ifdef __sparc64__
#include "opt_creator.h"
#endif
+#ifdef __powerpc__
+#include "opt_ofwfb.h"
+#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -210,7 +213,7 @@ gfb_cursor_shape(scr_stat *scp, int base, int height, int blink)
static int pxlblinkrate = 0;
-#ifdef DEV_CREATOR
+#if defined(DEV_CREATOR) || defined(SC_OFWFB)
static void
gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip)
{
diff --git a/sys/dev/syscons/schistory.c b/sys/dev/syscons/schistory.c
index 1986d12..c83048e 100644
--- a/sys/dev/syscons/schistory.c
+++ b/sys/dev/syscons/schistory.c
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/malloc.h>
-#ifdef __sparc64__
+#if __sparc64__ || __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 d4831b7..4e93a6a 100644
--- a/sys/dev/syscons/scterm-dumb.c
+++ b/sys/dev/syscons/scterm-dumb.c
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/consio.h>
-#ifdef __sparc64__
+#if __sparc64__ || __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 ad7d655..0f27935 100644
--- a/sys/dev/syscons/scterm-sc.c
+++ b/sys/dev/syscons/scterm-sc.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/consio.h>
-#ifdef __sparc64__
+#if __sparc64__ || __powerpc__
#include <machine/sc_machdep.h>
#else
#include <machine/pc/display.h>
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index da76ed3..b054b41 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
#include <sys/power.h>
#include <machine/clock.h>
-#ifdef __sparc64__
+#if __sparc64__ || __powerpc__
#include <machine/sc_machdep.h>
#else
#include <machine/pc/display.h>
@@ -150,7 +150,7 @@ static kbd_callback_func_t sckbdevent;
static int scparam(struct tty *tp, struct termios *t);
static void scstart(struct tty *tp);
static void scinit(int unit, int flags);
-#if __i386__ || __ia64__ || __amd64__ || __sparc64__
+#if !__alpha__
static void scterm(int unit, int flags);
#endif
static void scshutdown(void *arg, int howto);
@@ -1378,7 +1378,7 @@ scstart(struct tty *tp)
static void
sccnprobe(struct consdev *cp)
{
-#if __i386__ || __ia64__ || __amd64__ || __sparc64__
+#if !__alpha__
int unit;
int flags;
@@ -1396,7 +1396,7 @@ sccnprobe(struct consdev *cp)
/* initialize required fields */
sprintf(cp->cn_name, "consolectl");
-#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ */
+#endif /* !__alpha__ */
#if __alpha__
/*
@@ -1411,7 +1411,7 @@ sccnprobe(struct consdev *cp)
static void
sccninit(struct consdev *cp)
{
-#if __i386__ || __ia64__ || __amd64__ || __sparc64__
+#if !__alpha__
int unit;
int flags;
@@ -1419,7 +1419,7 @@ sccninit(struct consdev *cp)
scinit(unit, flags | SC_KERNEL_CONSOLE);
sc_console_unit = unit;
sc_console = SC_STAT(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]);
-#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ */
+#endif /* !__alpha__ */
#if __alpha__
/* SHOULDN'T REACH HERE */
@@ -1434,7 +1434,7 @@ sccnterm(struct consdev *cp)
if (sc_console_unit < 0)
return; /* shouldn't happen */
-#if __i386__ || __ia64__ || __amd64__ || __sparc64__
+#if !__alpha__
#if 0 /* XXX */
sc_clear_screen(sc_console);
sccnupdate(sc_console);
@@ -1442,7 +1442,7 @@ sccnterm(struct consdev *cp)
scterm(sc_console_unit, SC_KERNEL_CONSOLE);
sc_console_unit = -1;
sc_console = NULL;
-#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ */
+#endif /* !__alpha__ */
#if __alpha__
/* do nothing XXX */
@@ -2845,7 +2845,7 @@ scinit(int unit, int flags)
sc->flags |= SC_INIT_DONE;
}
-#if __i386__ || __ia64__ || __amd64__ || __sparc64__
+#if !__alpha__
static void
scterm(int unit, int flags)
{
@@ -2901,7 +2901,7 @@ scterm(int unit, int flags)
sc->keyboard = -1;
sc->adapter = -1;
}
-#endif /* __i386__ || __ia64__ || __amd64__ || __sparc64__ */
+#endif /* !__alpha__ */
static void
scshutdown(void *arg, int howto)
OpenPOWER on IntegriCloud