summaryrefslogtreecommitdiff
path: root/include/asm-sh64
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-12 14:36:46 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-09-12 14:36:46 +0900
commit21264136ce7c3c7032c42e7c2440f5d89039ca5a (patch)
tree99f0552df91c45c41fba68caad7cff270b54beda /include/asm-sh64
parentccdfc526a92c5ebb549a7de06adca3fd54f03c7e (diff)
downloadlwn-21264136ce7c3c7032c42e7c2440f5d89039ca5a.tar.gz
lwn-21264136ce7c3c7032c42e7c2440f5d89039ca5a.zip
sh64: Trivial build fixes.
While we've been sorting out the toolchain fiasco, some of the code has suffered a bit of bitrot. Building with GCC4 also brings up some more build warnings. Trivial fixes for both issues. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh64')
-rw-r--r--include/asm-sh64/byteorder.h4
-rw-r--r--include/asm-sh64/dma-mapping.h16
-rw-r--r--include/asm-sh64/io.h7
-rw-r--r--include/asm-sh64/ptrace.h2
-rw-r--r--include/asm-sh64/system.h2
-rw-r--r--include/asm-sh64/uaccess.h19
6 files changed, 30 insertions, 20 deletions
diff --git a/include/asm-sh64/byteorder.h b/include/asm-sh64/byteorder.h
index f602ebe334eb..7419d78820ee 100644
--- a/include/asm-sh64/byteorder.h
+++ b/include/asm-sh64/byteorder.h
@@ -14,7 +14,7 @@
#include <asm/types.h>
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
{
__asm__("byterev %0, %0\n\t"
"shari %0, 32, %0"
@@ -23,7 +23,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
return x;
}
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static inline __attribute_const__ __u16 ___arch__swab16(__u16 x)
{
__asm__("byterev %0, %0\n\t"
"shari %0, 48, %0"
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h
index a74a49e47922..68e27a8fca31 100644
--- a/include/asm-sh64/dma-mapping.h
+++ b/include/asm-sh64/dma-mapping.h
@@ -126,22 +126,30 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
static inline void dma_sync_single_for_cpu(struct device *dev,
dma_addr_t dma_handle, size_t size,
enum dma_data_direction dir)
- __attribute__ ((alias("dma_sync_single")));
+{
+ dma_sync_single(dev, dma_handle, size, dir);
+}
static inline void dma_sync_single_for_device(struct device *dev,
dma_addr_t dma_handle, size_t size,
enum dma_data_direction dir)
- __attribute__ ((alias("dma_sync_single")));
+{
+ dma_sync_single(dev, dma_handle, size, dir);
+}
static inline void dma_sync_sg_for_cpu(struct device *dev,
struct scatterlist *sg, int nelems,
enum dma_data_direction dir)
- __attribute__ ((alias("dma_sync_sg")));
+{
+ dma_sync_sg(dev, sg, nelems, dir);
+}
static inline void dma_sync_sg_for_device(struct device *dev,
struct scatterlist *sg, int nelems,
enum dma_data_direction dir)
- __attribute__ ((alias("dma_sync_sg")));
+{
+ dma_sync_sg(dev, sg, nelems, dir);
+}
static inline int dma_get_cache_alignment(void)
{
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h
index dee4f77929a4..252fedbb6621 100644
--- a/include/asm-sh64/io.h
+++ b/include/asm-sh64/io.h
@@ -123,6 +123,13 @@ void insw(unsigned long port, void *addr, unsigned long count);
void outsl(unsigned long port, const void *addr, unsigned long count);
void insl(unsigned long port, void *addr, unsigned long count);
+#define __raw_readb readb
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
void memcpy_toio(void __iomem *to, const void *from, long count);
void memcpy_fromio(void *to, void __iomem *from, long count);
diff --git a/include/asm-sh64/ptrace.h b/include/asm-sh64/ptrace.h
index 56190f521587..a6d4da519db6 100644
--- a/include/asm-sh64/ptrace.h
+++ b/include/asm-sh64/ptrace.h
@@ -28,7 +28,7 @@ struct pt_regs {
#ifdef __KERNEL__
#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
#define instruction_pointer(regs) ((regs)->pc)
-#define profile_pc(regs) instruction_pointer(regs)
+#define profile_pc(regs) ((unsigned long)instruction_pointer(regs))
extern void show_regs(struct pt_regs *);
#endif
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h
index 87ef6f1ad5a4..b1598c26fcb0 100644
--- a/include/asm-sh64/system.h
+++ b/include/asm-sh64/system.h
@@ -64,7 +64,7 @@ extern void __xchg_called_with_bad_pointer(void);
#define smp_read_barrier_depends() do { } while (0)
#endif /* CONFIG_SMP */
-#define set_rmb(var, value) do { xchg(&var, value); } while (0)
+#define set_rmb(var, value) do { (void)xchg(&var, value); } while (0)
#define set_mb(var, value) set_rmb(var, value)
/* Interrupt Control */
diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h
index f4936d8fa617..644c67b65f94 100644
--- a/include/asm-sh64/uaccess.h
+++ b/include/asm-sh64/uaccess.h
@@ -128,25 +128,20 @@ do { \
#define __get_user_nocheck(x,ptr,size) \
({ \
- long __gu_addr = (long)(ptr); \
- long __gu_err; \
- __typeof(*(ptr)) __gu_val; \
- __asm__ ("":"=r" (__gu_val)); \
- __asm__ ("":"=r" (__gu_err)); \
- __get_user_size((void *)&__gu_val, __gu_addr, (size), __gu_err); \
- (x) = (__typeof__(*(ptr))) __gu_val; \
+ long __gu_err, __gu_val; \
+ __get_user_size((void *)&__gu_val, (long)(ptr), \
+ (size), __gu_err); \
+ (x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
})
#define __get_user_check(x,ptr,size) \
({ \
long __gu_addr = (long)(ptr); \
- long __gu_err = -EFAULT; \
- __typeof(*(ptr)) __gu_val; \
- __asm__ ("":"=r" (__gu_val)); \
- __asm__ ("":"=r" (__gu_err)); \
+ long __gu_err = -EFAULT, __gu_val; \
if (__access_ok(__gu_addr, (size))) \
- __get_user_size((void *)&__gu_val, __gu_addr, (size), __gu_err); \
+ __get_user_size((void *)&__gu_val, __gu_addr, \
+ (size), __gu_err); \
(x) = (__typeof__(*(ptr))) __gu_val; \
__gu_err; \
})