2.1.115 on alpha: fix for csi_X

Alexander V. Lukyanov (lav@alpha.netis.ru)
Fri, 7 Aug 1998 17:36:59 +0400


Here is a patch to fix the problem for ^[[11X, which I mentioned in
previous letter. It turned out to be a bug in memset_c_io, which caused
filling 2*x sized area with bytes, instead of words (or dwords or qwords).
This lead up to wrong color in last 1-3 characters of clear field.

This patch also adds comments.

--- arch/alpha/lib/io.c.1 Fri Aug 7 15:41:33 1998
+++ arch/alpha/lib/io.c Fri Aug 7 17:21:32 1998
@@ -474,6 +474,7 @@
*/
void _memset_c_io(unsigned long to, unsigned long c, long count)
{
+ /* set first few unaligned bytes and get to 8-byte align */
if (count > 0 && (to & 1)) {
writeb(c, to);
to++;
@@ -489,28 +490,25 @@
to += 4;
count -= 4;
}
- if ((to & 7) == 0) {
+ /* now set aligned words */
+ count -= 8;
+ while (count >= 0) {
+ writeq(c, to);
+ to += 8;
count -= 8;
- while (count >= 0) {
- writeq(c, to);
- to += 8;
- count -= 8;
- }
- count += 8;
}
- if (count >= 4 && (to & 4)) {
+ count += 8;
+ /* set remaining few bytes */
+ if (count >= 4) {
writel(c, to);
to += 4;
count -= 4;
}
- if (count >= 2 && (to & 2)) {
+ if (count >= 2) {
writew(c, to);
to += 2;
count -= 2;
}
- while (count > 0) {
+ if (count > 0)
writeb(c, to);
- count--;
- to++;
- }
}

Alexander.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html