mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 13:21:45 +00:00
[ARM] 3009/1: S3C2410 - io.h offsets too large for LDRH/STRH
Patch from Ben Dooks The __inwc/__outwc calls are capable of creating LDRH and STRH instructions with offsets over 8bits as GCC does not have a constraint for an 8bit offset. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
13b1f64c16
commit
6205d158d1
1 changed files with 42 additions and 16 deletions
|
@ -9,7 +9,7 @@
|
||||||
* 06-Dec-1997 RMK Created.
|
* 06-Dec-1997 RMK Created.
|
||||||
* 02-Sep-2003 BJD Modified for S3C2410
|
* 02-Sep-2003 BJD Modified for S3C2410
|
||||||
* 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
|
* 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
|
||||||
*
|
* 13-Oct-2005 BJD Fixed problems with LDRH/STRH offset range
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __ASM_ARM_ARCH_IO_H
|
#ifndef __ASM_ARM_ARCH_IO_H
|
||||||
|
@ -97,7 +97,7 @@ DECLARE_IO(int,l,"")
|
||||||
else \
|
else \
|
||||||
__asm__ __volatile__( \
|
__asm__ __volatile__( \
|
||||||
"strb %0, [%1, #0] @ outbc" \
|
"strb %0, [%1, #0] @ outbc" \
|
||||||
: : "r" (value), "r" ((port))); \
|
: : "r" (value), "r" ((port))); \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define __inbc(port) \
|
#define __inbc(port) \
|
||||||
|
@ -110,35 +110,61 @@ DECLARE_IO(int,l,"")
|
||||||
else \
|
else \
|
||||||
__asm__ __volatile__( \
|
__asm__ __volatile__( \
|
||||||
"ldrb %0, [%1, #0] @ inbc" \
|
"ldrb %0, [%1, #0] @ inbc" \
|
||||||
: "=r" (result) : "r" ((port))); \
|
: "=r" (result) : "r" ((port))); \
|
||||||
result; \
|
result; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define __outwc(value,port) \
|
#define __outwc(value,port) \
|
||||||
({ \
|
({ \
|
||||||
unsigned long v = value; \
|
unsigned long v = value; \
|
||||||
if (__PORT_PCIO((port))) \
|
if (__PORT_PCIO((port))) { \
|
||||||
__asm__ __volatile__( \
|
if ((port) < 256 && (port) > -256) \
|
||||||
"strh %0, [%1, %2] @ outwc" \
|
__asm__ __volatile__( \
|
||||||
: : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \
|
"strh %0, [%1, %2] @ outwc" \
|
||||||
else \
|
: : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \
|
||||||
|
else if ((port) > 0) \
|
||||||
|
__asm__ __volatile__( \
|
||||||
|
"strh %0, [%1, %2] @ outwc" \
|
||||||
|
: : "r" (v), \
|
||||||
|
"r" (PCIO_BASE + ((port) & ~0xff)), \
|
||||||
|
"Jr" (((port) & 0xff))); \
|
||||||
|
else \
|
||||||
|
__asm__ __volatile__( \
|
||||||
|
"strh %0, [%1, #0] @ outwc" \
|
||||||
|
: : "r" (v), \
|
||||||
|
"r" (PCIO_BASE + (port))); \
|
||||||
|
} else \
|
||||||
__asm__ __volatile__( \
|
__asm__ __volatile__( \
|
||||||
"strh %0, [%1, #0] @ outwc" \
|
"strh %0, [%1, #0] @ outwc" \
|
||||||
: : "r" (v), "r" ((port))); \
|
: : "r" (v), "r" ((port))); \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define __inwc(port) \
|
#define __inwc(port) \
|
||||||
({ \
|
({ \
|
||||||
unsigned short result; \
|
unsigned short result; \
|
||||||
if (__PORT_PCIO((port))) \
|
if (__PORT_PCIO((port))) { \
|
||||||
__asm__ __volatile__( \
|
if ((port) < 256 && (port) > -256 ) \
|
||||||
"ldrh %0, [%1, %2] @ inwc" \
|
__asm__ __volatile__( \
|
||||||
: "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \
|
"ldrh %0, [%1, %2] @ inwc" \
|
||||||
else \
|
: "=r" (result) \
|
||||||
|
: "r" (PCIO_BASE), \
|
||||||
|
"Jr" ((port))); \
|
||||||
|
else if ((port) > 0) \
|
||||||
|
__asm__ __volatile__( \
|
||||||
|
"ldrh %0, [%1, %2] @ inwc" \
|
||||||
|
: "=r" (result) \
|
||||||
|
: "r" (PCIO_BASE + ((port) & ~0xff)), \
|
||||||
|
"Jr" (((port) & 0xff))); \
|
||||||
|
else \
|
||||||
|
__asm__ __volatile__( \
|
||||||
|
"ldrh %0, [%1, #0] @ inwc" \
|
||||||
|
: "=r" (result) \
|
||||||
|
: "r" (PCIO_BASE + ((port)))); \
|
||||||
|
} else \
|
||||||
__asm__ __volatile__( \
|
__asm__ __volatile__( \
|
||||||
"ldrh %0, [%1, #0] @ inwc" \
|
"ldrh %0, [%1, #0] @ inwc" \
|
||||||
: "=r" (result) : "r" ((port))); \
|
: "=r" (result) : "r" ((port))); \
|
||||||
result; \
|
result; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define __outlc(value,port) \
|
#define __outlc(value,port) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue