Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/dev rev. 27 SX needs memory referencing instr...
details: https://anonhg.NetBSD.org/src/rev/2e791b0283eb
branches: trunk
changeset: 328903:2e791b0283eb
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Apr 23 16:54:21 2014 +0000
description:
rev. 27 SX needs memory referencing instructions written to 64bit aligned
addresses ( my rev. 25 just ignores the lower 3 bits )
so, we zero these bits now
diffstat:
sys/arch/sparc/dev/cgfourteen.c | 45 ++++++++++++++++++++--------------------
1 files changed, 23 insertions(+), 22 deletions(-)
diffs (158 lines):
diff -r aa45f3ffb33c -r 2e791b0283eb sys/arch/sparc/dev/cgfourteen.c
--- a/sys/arch/sparc/dev/cgfourteen.c Wed Apr 23 16:17:55 2014 +0000
+++ b/sys/arch/sparc/dev/cgfourteen.c Wed Apr 23 16:54:21 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgfourteen.c,v 1.77 2014/03/16 05:20:25 dholland Exp $ */
+/* $NetBSD: cgfourteen.c,v 1.78 2014/04/23 16:54:21 macallan Exp $ */
/*
* Copyright (c) 1996
@@ -782,6 +782,7 @@
WSSCREEN_WSCOLORS | WSSCREEN_HILIT,
NULL
};
+ cg14_set_depth(sc, 8);
sc->sc_screens[0] = &sc->sc_defaultscreen_descr;
sc->sc_screenlist = (struct wsscreen_list){1, sc->sc_screens};
sc->sc_mode = WSDISPLAYIO_MODE_EMUL;
@@ -1229,20 +1230,20 @@
pptr = addr;
cnt = wi;
if (pre) {
- sta(pptr, ASI_SX, SX_STBS(8, pre - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_STBS(8, pre - 1, pptr & 7));
pptr += pre;
cnt -= pre;
}
/* now do the aligned pixels in 32bit chunks */
while(cnt > 31) {
words = min(32, cnt >> 2);
- sta(pptr, ASI_SX, SX_STS(8, words - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_STS(8, words - 1, pptr & 7));
pptr += words << 2;
cnt -= words << 2;
}
/* do any remaining pixels byte-wise again */
if (cnt > 0)
- sta(pptr, ASI_SX, SX_STBS(8, cnt - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_STBS(8, cnt - 1, pptr & 7));
addr += stride;
}
}
@@ -1268,29 +1269,29 @@
pptr = addr;
cnt = wi;
if (pre) {
- sta(pptr, ASI_SX, SX_LDB(8, pre - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_LDB(8, pre - 1, pptr & 7));
sx_write(sc->sc_sx, SX_INSTRUCTIONS,
SX_ROP(8, 8, 32, pre - 1));
- sta(pptr, ASI_SX, SX_STB(32, pre - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_STB(32, pre - 1, pptr & 7));
pptr += pre;
cnt -= pre;
}
/* now do the aligned pixels in 32bit chunks */
while(cnt > 15) {
words = min(16, cnt >> 2);
- sta(pptr, ASI_SX, SX_LD(8, words - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_LD(8, words - 1, pptr & 7));
sx_write(sc->sc_sx, SX_INSTRUCTIONS,
SX_ROP(8, 8, 32, words - 1));
- sta(pptr, ASI_SX, SX_ST(32, words - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_ST(32, words - 1, pptr & 7));
pptr += words << 2;
cnt -= words << 2;
}
/* do any remaining pixels byte-wise again */
if (cnt > 0)
- sta(pptr, ASI_SX, SX_LDB(8, cnt - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_LDB(8, cnt - 1, pptr & 7));
sx_write(sc->sc_sx, SX_INSTRUCTIONS,
SX_ROP(8, 8, 32, cnt - 1));
- sta(pptr, ASI_SX, SX_STB(32, cnt - 1, pptr & 7));
+ sta(pptr & ~7, ASI_SX, SX_STB(32, cnt - 1, pptr & 7));
addr += stride;
}
}
@@ -1301,7 +1302,7 @@
int num;
while (cnt > 0) {
num = min(32, cnt);
- sta(addr, ASI_SX, SX_LD(reg, num - 1, addr & 7));
+ sta(addr & ~7, ASI_SX, SX_LD(reg, num - 1, addr & 7));
cnt -= num;
reg += num;
addr += (num << 2);
@@ -1314,7 +1315,7 @@
int num;
while (cnt > 0) {
num = min(32, cnt);
- sta(addr, ASI_SX, SX_ST(reg, num - 1, addr & 7));
+ sta(addr & ~7, ASI_SX, SX_ST(reg, num - 1, addr & 7));
cnt -= num;
reg += num;
addr += (num << 2);
@@ -1349,9 +1350,9 @@
dptr = daddr;
cnt = wi;
if (pre > 0) {
- sta(sptr, ASI_SX,
+ sta(sptr & ~7, ASI_SX,
SX_LDB(32, pre - 1, sptr & 7));
- sta(dptr, ASI_SX,
+ sta(dptr & ~7, ASI_SX,
SX_STB(32, pre - 1, dptr & 7));
cnt -= pre;
sptr += pre;
@@ -1367,9 +1368,9 @@
cnt -= num << 2;
}
if (cnt > 0) {
- sta(sptr, ASI_SX,
+ sta(sptr & ~7, ASI_SX,
SX_LDB(32, cnt - 1, sptr & 7));
- sta(dptr, ASI_SX,
+ sta(dptr & ~7, ASI_SX,
SX_STB(32, cnt - 1, dptr & 7));
}
saddr += skip;
@@ -1383,16 +1384,16 @@
dptr = daddr;
cnt = wi;
while(cnt > 31) {
- sta(sptr, ASI_SX, SX_LDB(32, 31, sptr & 7));
- sta(dptr, ASI_SX, SX_STB(32, 31, dptr & 7));
+ sta(sptr & ~7, ASI_SX, SX_LDB(32, 31, sptr & 7));
+ sta(dptr & ~7, ASI_SX, SX_STB(32, 31, dptr & 7));
sptr += 32;
dptr += 32;
cnt -= 32;
}
if (cnt > 0) {
- sta(sptr, ASI_SX,
+ sta(sptr & ~7, ASI_SX,
SX_LDB(32, cnt - 1, sptr & 7));
- sta(dptr, ASI_SX,
+ sta(dptr & ~7, ASI_SX,
SX_STB(32, cnt - 1, dptr & 7));
}
saddr += skip;
@@ -1448,7 +1449,7 @@
reg = *data8;
sx_write(sc->sc_sx, SX_QUEUED(R_MASK),
reg << 24);
- sta(addr, ASI_SX, SX_STBS(8, wi - 1, addr & 7));
+ sta(addr & ~7, ASI_SX, SX_STBS(8, wi - 1, addr & 7));
data8++;
addr += stride;
}
@@ -1461,7 +1462,7 @@
reg = *data16;
sx_write(sc->sc_sx, SX_QUEUED(R_MASK),
reg << 16);
- sta(addr, ASI_SX, SX_STBS(8, wi - 1, addr & 7));
+ sta(addr & ~7, ASI_SX, SX_STBS(8, wi - 1, addr & 7));
data16++;
addr += stride;
}
Home |
Main Index |
Thread Index |
Old Index