diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-12 20:31:36 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-12 20:31:36 -0400 |
| commit | 7258ea8acd2252d5a68e7dfa2eac8dc8f364b91e (patch) | |
| tree | a13594ddbd91b27c8afa49c1a2c6b4dc8141ae11 | |
| parent | af84b99f22df115e7aec41d5dbe936e163ef4e2e (diff) | |
| parent | 1bb99a649af92e53ed7391afaf6c2d45a6f57b42 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6:
sh64: Add a sane pm_power_off implementation.
sh64: Use generic BUG_ON()/WARN_ON().
sh64: Trivial build fixes.
sh64: Drop deprecated ISA tuning for legacy toolchains.
| -rw-r--r-- | arch/sh64/Makefile | 1 | ||||
| -rw-r--r-- | arch/sh64/kernel/process.c | 3 | ||||
| -rw-r--r-- | arch/sh64/mach-cayman/setup.c | 6 | ||||
| -rw-r--r-- | arch/sh64/mm/ioremap.c | 4 | ||||
| -rw-r--r-- | drivers/serial/sh-sci.c | 4 | ||||
| -rw-r--r-- | include/asm-sh64/bug.h | 16 | ||||
| -rw-r--r-- | include/asm-sh64/byteorder.h | 4 | ||||
| -rw-r--r-- | include/asm-sh64/dma-mapping.h | 16 | ||||
| -rw-r--r-- | include/asm-sh64/io.h | 7 | ||||
| -rw-r--r-- | include/asm-sh64/ptrace.h | 2 | ||||
| -rw-r--r-- | include/asm-sh64/system.h | 2 | ||||
| -rw-r--r-- | include/asm-sh64/uaccess.h | 19 |
12 files changed, 46 insertions, 38 deletions
diff --git a/arch/sh64/Makefile b/arch/sh64/Makefile index 8ca57ffa2b70..ebf20043991c 100644 --- a/arch/sh64/Makefile +++ b/arch/sh64/Makefile | |||
| @@ -26,7 +26,6 @@ LDFLAGS += -EB -mshelf32_linux | |||
| 26 | endif | 26 | endif |
| 27 | 27 | ||
| 28 | # No requirements for endianess support from AFLAGS, 'as' always run through gcc | 28 | # No requirements for endianess support from AFLAGS, 'as' always run through gcc |
| 29 | AFLAGS += -m5 -isa=sh64 -traditional | ||
| 30 | CFLAGS += $(cpu-y) | 29 | CFLAGS += $(cpu-y) |
| 31 | 30 | ||
| 32 | LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \ | 31 | LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \ |
diff --git a/arch/sh64/kernel/process.c b/arch/sh64/kernel/process.c index dba8e14013b6..db475b7833fb 100644 --- a/arch/sh64/kernel/process.c +++ b/arch/sh64/kernel/process.c | |||
| @@ -355,6 +355,9 @@ void machine_power_off(void) | |||
| 355 | enter_deep_standby(); | 355 | enter_deep_standby(); |
| 356 | } | 356 | } |
| 357 | 357 | ||
| 358 | void (*pm_power_off)(void) = machine_power_off; | ||
| 359 | EXPORT_SYMBOL(pm_power_off); | ||
| 360 | |||
| 358 | void show_regs(struct pt_regs * regs) | 361 | void show_regs(struct pt_regs * regs) |
| 359 | { | 362 | { |
| 360 | unsigned long long ah, al, bh, bl, ch, cl; | 363 | unsigned long long ah, al, bh, bl, ch, cl; |
diff --git a/arch/sh64/mach-cayman/setup.c b/arch/sh64/mach-cayman/setup.c index d84895dda3cd..3ed87cd059d0 100644 --- a/arch/sh64/mach-cayman/setup.c +++ b/arch/sh64/mach-cayman/setup.c | |||
| @@ -112,8 +112,10 @@ struct resource io_resources[] = { | |||
| 112 | }; | 112 | }; |
| 113 | 113 | ||
| 114 | struct resource kram_resources[] = { | 114 | struct resource kram_resources[] = { |
| 115 | { "Kernel code", 0, 0 }, /* These must be last in the array */ | 115 | /* These must be last in the array */ |
| 116 | { "Kernel data", 0, 0 } /* These must be last in the array */ | 116 | { .name = "Kernel code", .start = 0, .end = 0 }, |
| 117 | /* These must be last in the array */ | ||
| 118 | { .name = "Kernel data", .start = 0, .end = 0 } | ||
| 117 | }; | 119 | }; |
| 118 | 120 | ||
| 119 | struct resource xram_resources[] = { | 121 | struct resource xram_resources[] = { |
diff --git a/arch/sh64/mm/ioremap.c b/arch/sh64/mm/ioremap.c index fb1866fa2c9d..80c56754f513 100644 --- a/arch/sh64/mm/ioremap.c +++ b/arch/sh64/mm/ioremap.c | |||
| @@ -449,7 +449,9 @@ ioremap_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, | |||
| 449 | if (p + 32 >= e) /* Better than nothing */ | 449 | if (p + 32 >= e) /* Better than nothing */ |
| 450 | break; | 450 | break; |
| 451 | if ((nm = r->name) == 0) nm = "???"; | 451 | if ((nm = r->name) == 0) nm = "???"; |
| 452 | p += sprintf(p, "%08lx-%08lx: %s\n", r->start, r->end, nm); | 452 | p += sprintf(p, "%08lx-%08lx: %s\n", |
| 453 | (unsigned long)r->start, | ||
| 454 | (unsigned long)r->end, nm); | ||
| 453 | } | 455 | } |
| 454 | 456 | ||
| 455 | return p-buf; | 457 | return p-buf; |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 301573373c30..cbede06cac27 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
| @@ -1579,7 +1579,7 @@ static int __init serial_console_setup(struct console *co, char *options) | |||
| 1579 | h8300_sci_enable(port, sci_enable); | 1579 | h8300_sci_enable(port, sci_enable); |
| 1580 | #endif | 1580 | #endif |
| 1581 | #elif defined(CONFIG_SUPERH64) | 1581 | #elif defined(CONFIG_SUPERH64) |
| 1582 | port->uartclk = current_cpu_info.module_clock * 16; | 1582 | port->uartclk = current_cpu_data.module_clock * 16; |
| 1583 | #else | 1583 | #else |
| 1584 | { | 1584 | { |
| 1585 | struct clk *clk = clk_get("module_clk"); | 1585 | struct clk *clk = clk_get("module_clk"); |
| @@ -1720,7 +1720,7 @@ static int __init sci_init(void) | |||
| 1720 | #if defined(__H8300H__) || defined(__H8300S__) | 1720 | #if defined(__H8300H__) || defined(__H8300S__) |
| 1721 | sciport->port.uartclk = CONFIG_CPU_CLOCK; | 1721 | sciport->port.uartclk = CONFIG_CPU_CLOCK; |
| 1722 | #elif defined(CONFIG_SUPERH64) | 1722 | #elif defined(CONFIG_SUPERH64) |
| 1723 | sciport->port.uartclk = current_cpu_info.module_clock * 16; | 1723 | sciport->port.uartclk = current_cpu_data.module_clock * 16; |
| 1724 | #else | 1724 | #else |
| 1725 | struct clk *clk = clk_get("module_clk"); | 1725 | struct clk *clk = clk_get("module_clk"); |
| 1726 | sciport->port.uartclk = clk_get_rate(clk) * 16; | 1726 | sciport->port.uartclk = clk_get_rate(clk) * 16; |
diff --git a/include/asm-sh64/bug.h b/include/asm-sh64/bug.h index 81f722efeb63..f3a9c9248ef4 100644 --- a/include/asm-sh64/bug.h +++ b/include/asm-sh64/bug.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef __ASM_SH64_BUG_H | 1 | #ifndef __ASM_SH64_BUG_H |
| 2 | #define __ASM_SH64_BUG_H | 2 | #define __ASM_SH64_BUG_H |
| 3 | 3 | ||
| 4 | 4 | #ifdef CONFIG_BUG | |
| 5 | /* | 5 | /* |
| 6 | * Tell the user there is some problem, then force a segfault (in process | 6 | * Tell the user there is some problem, then force a segfault (in process |
| 7 | * context) or a panic (interrupt context). | 7 | * context) or a panic (interrupt context). |
| @@ -11,17 +11,9 @@ | |||
| 11 | *(volatile int *)0 = 0; \ | 11 | *(volatile int *)0 = 0; \ |
| 12 | } while (0) | 12 | } while (0) |
| 13 | 13 | ||
| 14 | #define BUG_ON(condition) do { \ | 14 | #define HAVE_ARCH_BUG |
| 15 | if (unlikely((condition)!=0)) \ | 15 | #endif |
| 16 | BUG(); \ | ||
| 17 | } while(0) | ||
| 18 | 16 | ||
| 19 | #define WARN_ON(condition) do { \ | 17 | #include <asm-generic/bug.h> |
| 20 | if (unlikely((condition)!=0)) { \ | ||
| 21 | printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ | ||
| 22 | dump_stack(); \ | ||
| 23 | } \ | ||
| 24 | } while (0) | ||
| 25 | 18 | ||
| 26 | #endif /* __ASM_SH64_BUG_H */ | 19 | #endif /* __ASM_SH64_BUG_H */ |
| 27 | |||
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 @@ | |||
| 14 | 14 | ||
| 15 | #include <asm/types.h> | 15 | #include <asm/types.h> |
| 16 | 16 | ||
| 17 | static __inline__ __const__ __u32 ___arch__swab32(__u32 x) | 17 | static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) |
| 18 | { | 18 | { |
| 19 | __asm__("byterev %0, %0\n\t" | 19 | __asm__("byterev %0, %0\n\t" |
| 20 | "shari %0, 32, %0" | 20 | "shari %0, 32, %0" |
| @@ -23,7 +23,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x) | |||
| 23 | return x; | 23 | return x; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | static __inline__ __const__ __u16 ___arch__swab16(__u16 x) | 26 | static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) |
| 27 | { | 27 | { |
| 28 | __asm__("byterev %0, %0\n\t" | 28 | __asm__("byterev %0, %0\n\t" |
| 29 | "shari %0, 48, %0" | 29 | "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, | |||
| 126 | static inline void dma_sync_single_for_cpu(struct device *dev, | 126 | static inline void dma_sync_single_for_cpu(struct device *dev, |
| 127 | dma_addr_t dma_handle, size_t size, | 127 | dma_addr_t dma_handle, size_t size, |
| 128 | enum dma_data_direction dir) | 128 | enum dma_data_direction dir) |
| 129 | __attribute__ ((alias("dma_sync_single"))); | 129 | { |
| 130 | dma_sync_single(dev, dma_handle, size, dir); | ||
| 131 | } | ||
| 130 | 132 | ||
| 131 | static inline void dma_sync_single_for_device(struct device *dev, | 133 | static inline void dma_sync_single_for_device(struct device *dev, |
| 132 | dma_addr_t dma_handle, size_t size, | 134 | dma_addr_t dma_handle, size_t size, |
| 133 | enum dma_data_direction dir) | 135 | enum dma_data_direction dir) |
| 134 | __attribute__ ((alias("dma_sync_single"))); | 136 | { |
| 137 | dma_sync_single(dev, dma_handle, size, dir); | ||
| 138 | } | ||
| 135 | 139 | ||
| 136 | static inline void dma_sync_sg_for_cpu(struct device *dev, | 140 | static inline void dma_sync_sg_for_cpu(struct device *dev, |
| 137 | struct scatterlist *sg, int nelems, | 141 | struct scatterlist *sg, int nelems, |
| 138 | enum dma_data_direction dir) | 142 | enum dma_data_direction dir) |
| 139 | __attribute__ ((alias("dma_sync_sg"))); | 143 | { |
| 144 | dma_sync_sg(dev, sg, nelems, dir); | ||
| 145 | } | ||
| 140 | 146 | ||
| 141 | static inline void dma_sync_sg_for_device(struct device *dev, | 147 | static inline void dma_sync_sg_for_device(struct device *dev, |
| 142 | struct scatterlist *sg, int nelems, | 148 | struct scatterlist *sg, int nelems, |
| 143 | enum dma_data_direction dir) | 149 | enum dma_data_direction dir) |
| 144 | __attribute__ ((alias("dma_sync_sg"))); | 150 | { |
| 151 | dma_sync_sg(dev, sg, nelems, dir); | ||
| 152 | } | ||
| 145 | 153 | ||
| 146 | static inline int dma_get_cache_alignment(void) | 154 | static inline int dma_get_cache_alignment(void) |
| 147 | { | 155 | { |
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); | |||
| 123 | void outsl(unsigned long port, const void *addr, unsigned long count); | 123 | void outsl(unsigned long port, const void *addr, unsigned long count); |
| 124 | void insl(unsigned long port, void *addr, unsigned long count); | 124 | void insl(unsigned long port, void *addr, unsigned long count); |
| 125 | 125 | ||
| 126 | #define __raw_readb readb | ||
| 127 | #define __raw_readw readw | ||
| 128 | #define __raw_readl readl | ||
| 129 | #define __raw_writeb writeb | ||
| 130 | #define __raw_writew writew | ||
| 131 | #define __raw_writel writel | ||
| 132 | |||
| 126 | void memcpy_toio(void __iomem *to, const void *from, long count); | 133 | void memcpy_toio(void __iomem *to, const void *from, long count); |
| 127 | void memcpy_fromio(void *to, void __iomem *from, long count); | 134 | void memcpy_fromio(void *to, void __iomem *from, long count); |
| 128 | 135 | ||
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 { | |||
| 28 | #ifdef __KERNEL__ | 28 | #ifdef __KERNEL__ |
| 29 | #define user_mode(regs) (((regs)->sr & 0x40000000)==0) | 29 | #define user_mode(regs) (((regs)->sr & 0x40000000)==0) |
| 30 | #define instruction_pointer(regs) ((regs)->pc) | 30 | #define instruction_pointer(regs) ((regs)->pc) |
| 31 | #define profile_pc(regs) instruction_pointer(regs) | 31 | #define profile_pc(regs) ((unsigned long)instruction_pointer(regs)) |
| 32 | extern void show_regs(struct pt_regs *); | 32 | extern void show_regs(struct pt_regs *); |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
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); | |||
| 64 | #define smp_read_barrier_depends() do { } while (0) | 64 | #define smp_read_barrier_depends() do { } while (0) |
| 65 | #endif /* CONFIG_SMP */ | 65 | #endif /* CONFIG_SMP */ |
| 66 | 66 | ||
| 67 | #define set_rmb(var, value) do { xchg(&var, value); } while (0) | 67 | #define set_rmb(var, value) do { (void)xchg(&var, value); } while (0) |
| 68 | #define set_mb(var, value) set_rmb(var, value) | 68 | #define set_mb(var, value) set_rmb(var, value) |
| 69 | 69 | ||
| 70 | /* Interrupt Control */ | 70 | /* 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 { \ | |||
| 128 | 128 | ||
| 129 | #define __get_user_nocheck(x,ptr,size) \ | 129 | #define __get_user_nocheck(x,ptr,size) \ |
| 130 | ({ \ | 130 | ({ \ |
| 131 | long __gu_addr = (long)(ptr); \ | 131 | long __gu_err, __gu_val; \ |
| 132 | long __gu_err; \ | 132 | __get_user_size((void *)&__gu_val, (long)(ptr), \ |
| 133 | __typeof(*(ptr)) __gu_val; \ | 133 | (size), __gu_err); \ |
| 134 | __asm__ ("":"=r" (__gu_val)); \ | 134 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
| 135 | __asm__ ("":"=r" (__gu_err)); \ | ||
| 136 | __get_user_size((void *)&__gu_val, __gu_addr, (size), __gu_err); \ | ||
| 137 | (x) = (__typeof__(*(ptr))) __gu_val; \ | ||
| 138 | __gu_err; \ | 135 | __gu_err; \ |
| 139 | }) | 136 | }) |
| 140 | 137 | ||
| 141 | #define __get_user_check(x,ptr,size) \ | 138 | #define __get_user_check(x,ptr,size) \ |
| 142 | ({ \ | 139 | ({ \ |
| 143 | long __gu_addr = (long)(ptr); \ | 140 | long __gu_addr = (long)(ptr); \ |
| 144 | long __gu_err = -EFAULT; \ | 141 | long __gu_err = -EFAULT, __gu_val; \ |
| 145 | __typeof(*(ptr)) __gu_val; \ | ||
| 146 | __asm__ ("":"=r" (__gu_val)); \ | ||
| 147 | __asm__ ("":"=r" (__gu_err)); \ | ||
| 148 | if (__access_ok(__gu_addr, (size))) \ | 142 | if (__access_ok(__gu_addr, (size))) \ |
| 149 | __get_user_size((void *)&__gu_val, __gu_addr, (size), __gu_err); \ | 143 | __get_user_size((void *)&__gu_val, __gu_addr, \ |
| 144 | (size), __gu_err); \ | ||
| 150 | (x) = (__typeof__(*(ptr))) __gu_val; \ | 145 | (x) = (__typeof__(*(ptr))) __gu_val; \ |
| 151 | __gu_err; \ | 146 | __gu_err; \ |
| 152 | }) | 147 | }) |
