summaryrefslogtreecommitdiffstats
path: root/include/video/fbcon.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/video/fbcon.h')
-rw-r--r--include/video/fbcon.h38
1 files changed, 24 insertions, 14 deletions
diff --git a/include/video/fbcon.h b/include/video/fbcon.h
index e5f26faa4..332cabf7e 100644
--- a/include/video/fbcon.h
+++ b/include/video/fbcon.h
@@ -681,32 +681,37 @@ static __inline__ void *fb_memmove(void *d, const void *s, size_t count)
while (count--)
fb_writeb(fb_readb(src++), dst++);
} else {
- dst = (unsigned long) d + count - 1;
- src = (unsigned long) s + count - 1;
+ dst = (unsigned long) d + count;
+ src = (unsigned long) s + count;
if ((count < 8) || ((dst ^ src) & 3))
goto restdown;
if (dst & 1) {
- fb_writeb(fb_readb(src--), dst--);
+ src--;
+ dst--;
count--;
+ fb_writeb(fb_readb(src), dst);
}
if (dst & 2) {
- fb_writew(fb_readw(src), dst);
src -= 2;
dst -= 2;
count -= 2;
+ fb_writew(fb_readw(src), dst);
}
while (count > 3) {
- fb_writel(fb_readl(src), dst);
src -= 4;
dst -= 4;
count -= 4;
+ fb_writel(fb_readl(src), dst);
}
restdown:
- while (count--)
- fb_writeb(fb_readb(src--), dst--);
+ while (count--) {
+ src--;
+ dst--;
+ fb_writeb(fb_readb(src), dst);
+ }
}
return d;
@@ -744,32 +749,37 @@ static __inline__ void fast_memmove(char *d, const char *s, size_t count)
while (count--)
fb_writeb(fb_readb(src++), dst++);
} else {
- dst = (unsigned long) d + count - 1;
- src = (unsigned long) s + count - 1;
+ dst = (unsigned long) d + count;
+ src = (unsigned long) s + count;
if ((count < 8) || ((dst ^ src) & 3))
goto restdown;
if (dst & 1) {
- fb_writeb(fb_readb(src--), dst--);
+ src--;
+ dst--;
count--;
+ fb_writeb(fb_readb(src), dst);
}
if (dst & 2) {
- fb_writew(fb_readw(src), dst);
src -= 2;
dst -= 2;
count -= 2;
+ fb_writew(fb_readw(src), dst);
}
while (count > 3) {
- fb_writel(fb_readl(src), dst);
src -= 4;
dst -= 4;
count -= 4;
+ fb_writel(fb_readl(src), dst);
}
restdown:
- while (count--)
- fb_writeb(fb_readb(src--), dst--);
+ while (count--) {
+ src--;
+ dst--;
+ fb_writeb(fb_readb(src), dst);
+ }
}
}