aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Hogan <james@albanarts.com>2010-10-27 18:33:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-27 21:03:08 -0400
commitf11b478d461b7113eb4603b3914aaf15b7788e87 (patch)
tree84e673927a071c64658d8b24ae423de86948b573 /include
parentc9c62dce35e7fc54beebafb071393a0008989e49 (diff)
fbmem: fix fb_read, fb_write unaligned accesses
fb_{read,write} access the framebuffer using lots of fb_{read,write}l's but don't check that the file position is aligned which can cause problems on some architectures which do not support unaligned accesses. Since the operations are essentially memcpy_{from,to}io, new fb_memcpy_{from,to}fb macros have been defined and these are used instead. For Sparc, fb_{read,write} macros use sbus_{read,write}, so this defines new sbus_memcpy_{from,to}io functions the same as memcpy_{from,to}io but using sbus_{read,write}b instead of {read,write}b. Signed-off-by: James Hogan <james@albanarts.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fb.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h
index f0268deca658..7fca3dc4e475 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -931,6 +931,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
931#define fb_writel sbus_writel 931#define fb_writel sbus_writel
932#define fb_writeq sbus_writeq 932#define fb_writeq sbus_writeq
933#define fb_memset sbus_memset_io 933#define fb_memset sbus_memset_io
934#define fb_memcpy_fromfb sbus_memcpy_fromio
935#define fb_memcpy_tofb sbus_memcpy_toio
934 936
935#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__) 937#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__)
936 938
@@ -943,6 +945,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
943#define fb_writel __raw_writel 945#define fb_writel __raw_writel
944#define fb_writeq __raw_writeq 946#define fb_writeq __raw_writeq
945#define fb_memset memset_io 947#define fb_memset memset_io
948#define fb_memcpy_fromfb memcpy_fromio
949#define fb_memcpy_tofb memcpy_toio
946 950
947#else 951#else
948 952
@@ -955,6 +959,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
955#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b)) 959#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
956#define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b)) 960#define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b))
957#define fb_memset memset 961#define fb_memset memset
962#define fb_memcpy_fromfb memcpy
963#define fb_memcpy_tofb memcpy
958 964
959#endif 965#endif
960 966