aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/processor.h
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2008-08-12 17:10:59 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-08-16 04:30:05 -0400
commit16f719de62809e224e37c320760c3ce59098d862 (patch)
tree6fceacd79c697b8f7ba0db0e275832dedc1e614a /arch/arm/include/asm/processor.h
parentda1562af624cbf17935c7fded51466bb1a1b63a8 (diff)
[ARM] 5196/1: fix inline asm constraints for preload
With gcc 4.3 and later, a pointer that has already been dereferenced is assumed not to be null since it should have caused a segmentation fault otherwise, hence any subsequent test against NULL is optimized away. Current inline asm constraint used in the implementation of prefetch() makes gcc believe that the pointer is dereferenced even though the PLD instruction does not load any data and does not cause a segmentation fault on null pointers, which causes all sorts of interesting results when reaching the end of a linked lists for example. Let's use a better constraint to properly represent the actual usage of the pointer value. Problem reported by Chris Steel. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include/asm/processor.h')
-rw-r--r--arch/arm/include/asm/processor.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index b01d5e7e3d5a..517a4d6ffc74 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -112,9 +112,9 @@ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
112static inline void prefetch(const void *ptr) 112static inline void prefetch(const void *ptr)
113{ 113{
114 __asm__ __volatile__( 114 __asm__ __volatile__(
115 "pld\t%0" 115 "pld\t%a0"
116 : 116 :
117 : "o" (*(char *)ptr) 117 : "p" (ptr)
118 : "cc"); 118 : "cc");
119} 119}
120 120