diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-21 14:27:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-21 14:27:34 -0500 |
commit | 278e5acae1321978686e85ca92906054a36aa19b (patch) | |
tree | 1f7d0ae01db0039e446bd6e4ae2de207899f549f | |
parent | 30f05309bde49295e02e45c7e615f73aa4e0ccc2 (diff) | |
parent | 2f1b0077a9604eda130ffb0313c2f1e9db424269 (diff) |
Merge tag 'for-4.5' of git://git.osdn.jp/gitroot/uclinux-h8/linux
Pull h8300 updates from Yoshinori Sato:
- Add KGDB support
- zImage fix
- various cleanup
* tag 'for-4.5' of git://git.osdn.jp/gitroot/uclinux-h8/linux:
h8300: System call entry enable interrupt.
h8300: show_stack cleanup
h8300: Restraint of warning.
h8300: Add KGDB support.
irqchip: renesas-h8s: Replace ctrl_outw/ctrl_inw with writew/readw
h8300: signal stack fix
h8300: Add LZO compression
h8300: zImage alignment fix
clk: h8300: Remove "sh73a0-" part from compatible value
h8300: zImage alignment fix
-rw-r--r-- | Documentation/devicetree/bindings/clock/renesas,h8300-div-clock.txt | 2 | ||||
-rw-r--r-- | arch/h8300/Kconfig | 3 | ||||
-rw-r--r-- | arch/h8300/boot/compressed/Makefile | 11 | ||||
-rw-r--r-- | arch/h8300/boot/compressed/misc.c | 6 | ||||
-rw-r--r-- | arch/h8300/boot/compressed/vmlinux.lds | 4 | ||||
-rw-r--r-- | arch/h8300/include/asm/io.h | 8 | ||||
-rw-r--r-- | arch/h8300/include/asm/kgdb.h | 45 | ||||
-rw-r--r-- | arch/h8300/include/asm/traps.h | 2 | ||||
-rw-r--r-- | arch/h8300/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/h8300/kernel/entry.S | 19 | ||||
-rw-r--r-- | arch/h8300/kernel/kgdb.c | 135 | ||||
-rw-r--r-- | arch/h8300/kernel/signal.c | 8 | ||||
-rw-r--r-- | arch/h8300/kernel/traps.c | 20 | ||||
-rw-r--r-- | drivers/irqchip/irq-renesas-h8s.c | 10 |
14 files changed, 244 insertions, 31 deletions
diff --git a/Documentation/devicetree/bindings/clock/renesas,h8300-div-clock.txt b/Documentation/devicetree/bindings/clock/renesas,h8300-div-clock.txt index 36c2b528245c..399e0da22348 100644 --- a/Documentation/devicetree/bindings/clock/renesas,h8300-div-clock.txt +++ b/Documentation/devicetree/bindings/clock/renesas,h8300-div-clock.txt | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | Required Properties: | 3 | Required Properties: |
4 | 4 | ||
5 | - compatible: Must be "renesas,sh73a0-h8300-div-clock" | 5 | - compatible: Must be "renesas,h8300-div-clock" |
6 | 6 | ||
7 | - clocks: Reference to the parent clocks ("extal1" and "extal2") | 7 | - clocks: Reference to the parent clocks ("extal1" and "extal2") |
8 | 8 | ||
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 2e20333cbce9..cd1f754c1336 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig | |||
@@ -18,6 +18,9 @@ config H8300 | |||
18 | select HAVE_DMA_ATTRS | 18 | select HAVE_DMA_ATTRS |
19 | select CLKSRC_OF | 19 | select CLKSRC_OF |
20 | select H8300_TMR8 | 20 | select H8300_TMR8 |
21 | select HAVE_KERNEL_GZIP | ||
22 | select HAVE_KERNEL_LZO | ||
23 | select HAVE_ARCH_KGDB | ||
21 | 24 | ||
22 | config RWSEM_GENERIC_SPINLOCK | 25 | config RWSEM_GENERIC_SPINLOCK |
23 | def_bool y | 26 | def_bool y |
diff --git a/arch/h8300/boot/compressed/Makefile b/arch/h8300/boot/compressed/Makefile index d7bc3fa7f2c6..7643633f1330 100644 --- a/arch/h8300/boot/compressed/Makefile +++ b/arch/h8300/boot/compressed/Makefile | |||
@@ -28,11 +28,16 @@ $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE | |||
28 | $(obj)/vmlinux.bin: vmlinux FORCE | 28 | $(obj)/vmlinux.bin: vmlinux FORCE |
29 | $(call if_changed,objcopy) | 29 | $(call if_changed,objcopy) |
30 | 30 | ||
31 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | 31 | suffix-$(CONFIG_KERNEL_GZIP) := gzip |
32 | $(call if_changed,gzip) | 32 | suffix-$(CONFIG_KERNEL_LZO) := lzo |
33 | |||
34 | $(obj)/vmlinux.bin.$(suffix-y): $(obj)/vmlinux.bin FORCE | ||
35 | $(call if_changed,$(suffix-y)) | ||
33 | 36 | ||
34 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300-linux -T | 37 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300-linux -T |
35 | OBJCOPYFLAGS := -O binary | 38 | OBJCOPYFLAGS := -O binary |
36 | 39 | ||
37 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE | 40 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE |
38 | $(call if_changed,ld) | 41 | $(call if_changed,ld) |
42 | |||
43 | CFLAGS_misc.o = -O0 | ||
diff --git a/arch/h8300/boot/compressed/misc.c b/arch/h8300/boot/compressed/misc.c index 6029c5351895..9f64fe8f29ff 100644 --- a/arch/h8300/boot/compressed/misc.c +++ b/arch/h8300/boot/compressed/misc.c | |||
@@ -32,7 +32,13 @@ extern char output[]; | |||
32 | 32 | ||
33 | #define HEAP_SIZE 0x10000 | 33 | #define HEAP_SIZE 0x10000 |
34 | 34 | ||
35 | #ifdef CONFIG_KERNEL_GZIP | ||
35 | #include "../../../../lib/decompress_inflate.c" | 36 | #include "../../../../lib/decompress_inflate.c" |
37 | #endif | ||
38 | |||
39 | #ifdef CONFIG_KERNEL_LZO | ||
40 | #include "../../../../lib/decompress_unlzo.c" | ||
41 | #endif | ||
36 | 42 | ||
37 | void *memset(void *s, int c, size_t n) | 43 | void *memset(void *s, int c, size_t n) |
38 | { | 44 | { |
diff --git a/arch/h8300/boot/compressed/vmlinux.lds b/arch/h8300/boot/compressed/vmlinux.lds index 44fd209db88a..ad848a72fd3f 100644 --- a/arch/h8300/boot/compressed/vmlinux.lds +++ b/arch/h8300/boot/compressed/vmlinux.lds | |||
@@ -13,16 +13,18 @@ SECTIONS | |||
13 | { | 13 | { |
14 | *(.rodata) | 14 | *(.rodata) |
15 | } | 15 | } |
16 | . = ALIGN(0x4) ; | ||
16 | .data : | 17 | .data : |
17 | 18 | ||
18 | { | 19 | { |
20 | . = ALIGN(0x4) ; | ||
19 | __sdata = . ; | 21 | __sdata = . ; |
20 | ___data_start = . ; | 22 | ___data_start = . ; |
21 | *(.data.*) | 23 | *(.data.*) |
22 | } | 24 | } |
25 | . = ALIGN(0x4) ; | ||
23 | .bss : | 26 | .bss : |
24 | { | 27 | { |
25 | . = ALIGN(0x4) ; | ||
26 | __sbss = . ; | 28 | __sbss = . ; |
27 | *(.bss*) | 29 | *(.bss*) |
28 | . = ALIGN(0x4) ; | 30 | . = ALIGN(0x4) ; |
diff --git a/arch/h8300/include/asm/io.h b/arch/h8300/include/asm/io.h index f0e14f3a800d..2e221c5f0203 100644 --- a/arch/h8300/include/asm/io.h +++ b/arch/h8300/include/asm/io.h | |||
@@ -44,17 +44,17 @@ static inline void __raw_writel(u32 b, const volatile void __iomem *addr) | |||
44 | static inline void ctrl_bclr(int b, void __iomem *addr) | 44 | static inline void ctrl_bclr(int b, void __iomem *addr) |
45 | { | 45 | { |
46 | if (__builtin_constant_p(b)) | 46 | if (__builtin_constant_p(b)) |
47 | __asm__("bclr %1,%0" : "+WU"(*addr): "i"(b)); | 47 | __asm__("bclr %1,%0" : "+WU"(*(u8 *)addr): "i"(b)); |
48 | else | 48 | else |
49 | __asm__("bclr %w1,%0" : "+WU"(*addr): "r"(b)); | 49 | __asm__("bclr %w1,%0" : "+WU"(*(u8 *)addr): "r"(b)); |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline void ctrl_bset(int b, void __iomem *addr) | 52 | static inline void ctrl_bset(int b, void __iomem *addr) |
53 | { | 53 | { |
54 | if (__builtin_constant_p(b)) | 54 | if (__builtin_constant_p(b)) |
55 | __asm__("bset %1,%0" : "+WU"(*addr): "i"(b)); | 55 | __asm__("bset %1,%0" : "+WU"(*(u8 *)addr): "i"(b)); |
56 | else | 56 | else |
57 | __asm__("bset %w1,%0" : "+WU"(*addr): "r"(b)); | 57 | __asm__("bset %w1,%0" : "+WU"(*(u8 *)addr): "r"(b)); |
58 | } | 58 | } |
59 | 59 | ||
60 | #include <asm-generic/io.h> | 60 | #include <asm-generic/io.h> |
diff --git a/arch/h8300/include/asm/kgdb.h b/arch/h8300/include/asm/kgdb.h new file mode 100644 index 000000000000..726ff8fdfc18 --- /dev/null +++ b/arch/h8300/include/asm/kgdb.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015 Yoshinori Sato <ysato@users.sourceforge.jp> | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ASM_H8300_KGDB_H | ||
10 | #define _ASM_H8300_KGDB_H | ||
11 | |||
12 | #define CACHE_FLUSH_IS_SAFE 1 | ||
13 | #define BUFMAX 2048 | ||
14 | |||
15 | enum regnames { | ||
16 | GDB_ER0, GDB_ER1, GDB_ER2, GDB_ER3, | ||
17 | GDB_ER4, GDB_ER5, GDB_ER6, GDB_SP, | ||
18 | GDB_CCR, GDB_PC, | ||
19 | GDB_CYCLLE, | ||
20 | #if defined(CONFIG_CPU_H8S) | ||
21 | GDB_EXR, | ||
22 | #endif | ||
23 | GDB_TICK, GDB_INST, | ||
24 | #if defined(CONFIG_CPU_H8S) | ||
25 | GDB_MACH, GDB_MACL, | ||
26 | #endif | ||
27 | /* do not change the last entry or anything below! */ | ||
28 | GDB_NUMREGBYTES, /* number of registers */ | ||
29 | }; | ||
30 | |||
31 | #define GDB_SIZEOF_REG sizeof(u32) | ||
32 | #if defined(CONFIG_CPU_H8300H) | ||
33 | #define DBG_MAX_REG_NUM (13) | ||
34 | #elif defined(CONFIG_CPU_H8S) | ||
35 | #define DBG_MAX_REG_NUM (14) | ||
36 | #endif | ||
37 | #define NUMREGBYTES (DBG_MAX_REG_NUM * GDB_SIZEOF_REG) | ||
38 | |||
39 | #define BREAK_INSTR_SIZE 2 | ||
40 | static inline void arch_kgdb_breakpoint(void) | ||
41 | { | ||
42 | __asm__ __volatile__("trapa #2"); | ||
43 | } | ||
44 | |||
45 | #endif /* _ASM_H8300_KGDB_H */ | ||
diff --git a/arch/h8300/include/asm/traps.h b/arch/h8300/include/asm/traps.h index aa34e75fd767..15e701130b27 100644 --- a/arch/h8300/include/asm/traps.h +++ b/arch/h8300/include/asm/traps.h | |||
@@ -36,6 +36,6 @@ extern unsigned long *_interrupt_redirect_table; | |||
36 | extern char _start, _etext; | 36 | extern char _start, _etext; |
37 | #define check_kernel_text(addr) \ | 37 | #define check_kernel_text(addr) \ |
38 | ((addr >= (unsigned long)(&_start)) && \ | 38 | ((addr >= (unsigned long)(&_start)) && \ |
39 | (addr < (unsigned long)(&_etext))) | 39 | (addr < (unsigned long)(&_etext)) && !(addr & 1)) |
40 | 40 | ||
41 | #endif /* _H8300_TRAPS_H */ | 41 | #endif /* _H8300_TRAPS_H */ |
diff --git a/arch/h8300/kernel/Makefile b/arch/h8300/kernel/Makefile index 5bc33f2fcc08..253f8e322ecc 100644 --- a/arch/h8300/kernel/Makefile +++ b/arch/h8300/kernel/Makefile | |||
@@ -17,3 +17,5 @@ obj-$(CONFIG_H8S_SIM) += sim-console.o | |||
17 | 17 | ||
18 | obj-$(CONFIG_CPU_H8300H) += ptrace_h.o | 18 | obj-$(CONFIG_CPU_H8300H) += ptrace_h.o |
19 | obj-$(CONFIG_CPU_H8S) += ptrace_s.o | 19 | obj-$(CONFIG_CPU_H8S) += ptrace_s.o |
20 | |||
21 | obj-$(CONFIG_KGDB) += kgdb.o | ||
diff --git a/arch/h8300/kernel/entry.S b/arch/h8300/kernel/entry.S index 797dfa8ddeb2..4f67d4b350d5 100644 --- a/arch/h8300/kernel/entry.S +++ b/arch/h8300/kernel/entry.S | |||
@@ -188,7 +188,11 @@ _interrupt_redirect_table: | |||
188 | jsr @_interrupt_entry /* NMI */ | 188 | jsr @_interrupt_entry /* NMI */ |
189 | jmp @_system_call /* TRAPA #0 (System call) */ | 189 | jmp @_system_call /* TRAPA #0 (System call) */ |
190 | .long 0 | 190 | .long 0 |
191 | #if defined(CONFIG_KGDB) | ||
192 | jmp @_kgdb_trap | ||
193 | #else | ||
191 | .long 0 | 194 | .long 0 |
195 | #endif | ||
192 | jmp @_trace_break /* TRAPA #3 (breakpoint) */ | 196 | jmp @_trace_break /* TRAPA #3 (breakpoint) */ |
193 | .rept INTERRUPTS-12 | 197 | .rept INTERRUPTS-12 |
194 | jsr @_interrupt_entry | 198 | jsr @_interrupt_entry |
@@ -242,6 +246,7 @@ _system_call: | |||
242 | /* save top of frame */ | 246 | /* save top of frame */ |
243 | mov.l sp,er0 | 247 | mov.l sp,er0 |
244 | jsr @set_esp0 | 248 | jsr @set_esp0 |
249 | andc #0x3f,ccr | ||
245 | mov.l sp,er2 | 250 | mov.l sp,er2 |
246 | and.w #0xe000,r2 | 251 | and.w #0xe000,r2 |
247 | mov.l @(TI_FLAGS:16,er2),er2 | 252 | mov.l @(TI_FLAGS:16,er2),er2 |
@@ -405,6 +410,20 @@ _nmi: | |||
405 | mov.l @sp+, er0 | 410 | mov.l @sp+, er0 |
406 | jmp @_interrupt_entry | 411 | jmp @_interrupt_entry |
407 | 412 | ||
413 | #if defined(CONFIG_KGDB) | ||
414 | _kgdb_trap: | ||
415 | subs #4,sp | ||
416 | SAVE_ALL | ||
417 | mov.l sp,er0 | ||
418 | add.l #LRET,er0 | ||
419 | mov.l er0,@(LSP,sp) | ||
420 | jsr @set_esp0 | ||
421 | mov.l sp,er0 | ||
422 | subs #4,er0 | ||
423 | jsr @h8300_kgdb_trap | ||
424 | jmp @ret_from_exception | ||
425 | #endif | ||
426 | |||
408 | .section .bss | 427 | .section .bss |
409 | _sw_ksp: | 428 | _sw_ksp: |
410 | .space 4 | 429 | .space 4 |
diff --git a/arch/h8300/kernel/kgdb.c b/arch/h8300/kernel/kgdb.c new file mode 100644 index 000000000000..602e478afbd5 --- /dev/null +++ b/arch/h8300/kernel/kgdb.c | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * H8/300 KGDB support | ||
3 | * | ||
4 | * Copyright (C) 2015 Yoshinori Sato <ysato@users.sourceforge.jp> | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/ptrace.h> | ||
12 | #include <linux/kgdb.h> | ||
13 | #include <linux/kdebug.h> | ||
14 | #include <linux/io.h> | ||
15 | |||
16 | struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = { | ||
17 | { "er0", GDB_SIZEOF_REG, offsetof(struct pt_regs, er0) }, | ||
18 | { "er1", GDB_SIZEOF_REG, offsetof(struct pt_regs, er1) }, | ||
19 | { "er2", GDB_SIZEOF_REG, offsetof(struct pt_regs, er2) }, | ||
20 | { "er3", GDB_SIZEOF_REG, offsetof(struct pt_regs, er3) }, | ||
21 | { "er4", GDB_SIZEOF_REG, offsetof(struct pt_regs, er4) }, | ||
22 | { "er5", GDB_SIZEOF_REG, offsetof(struct pt_regs, er5) }, | ||
23 | { "er6", GDB_SIZEOF_REG, offsetof(struct pt_regs, er6) }, | ||
24 | { "sp", GDB_SIZEOF_REG, offsetof(struct pt_regs, sp) }, | ||
25 | { "ccr", GDB_SIZEOF_REG, offsetof(struct pt_regs, ccr) }, | ||
26 | { "pc", GDB_SIZEOF_REG, offsetof(struct pt_regs, pc) }, | ||
27 | { "cycles", GDB_SIZEOF_REG, -1 }, | ||
28 | #if defined(CONFIG_CPU_H8S) | ||
29 | { "exr", GDB_SIZEOF_REG, offsetof(struct pt_regs, exr) }, | ||
30 | #endif | ||
31 | { "tick", GDB_SIZEOF_REG, -1 }, | ||
32 | { "inst", GDB_SIZEOF_REG, -1 }, | ||
33 | }; | ||
34 | |||
35 | char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) | ||
36 | { | ||
37 | if (regno >= DBG_MAX_REG_NUM || regno < 0) | ||
38 | return NULL; | ||
39 | |||
40 | switch (regno) { | ||
41 | case GDB_CCR: | ||
42 | #if defined(CONFIG_CPU_H8S) | ||
43 | case GDB_EXR: | ||
44 | #endif | ||
45 | *(u32 *)mem = *(u16 *)((void *)regs + | ||
46 | dbg_reg_def[regno].offset); | ||
47 | break; | ||
48 | default: | ||
49 | if (dbg_reg_def[regno].offset >= 0) | ||
50 | memcpy(mem, (void *)regs + dbg_reg_def[regno].offset, | ||
51 | dbg_reg_def[regno].size); | ||
52 | else | ||
53 | memset(mem, 0, dbg_reg_def[regno].size); | ||
54 | break; | ||
55 | } | ||
56 | return dbg_reg_def[regno].name; | ||
57 | } | ||
58 | |||
59 | int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) | ||
60 | { | ||
61 | if (regno >= DBG_MAX_REG_NUM || regno < 0) | ||
62 | return -EINVAL; | ||
63 | |||
64 | switch (regno) { | ||
65 | case GDB_CCR: | ||
66 | #if defined(CONFIG_CPU_H8S) | ||
67 | case GDB_EXR: | ||
68 | #endif | ||
69 | *(u16 *)((void *)regs + | ||
70 | dbg_reg_def[regno].offset) = *(u32 *)mem; | ||
71 | break; | ||
72 | default: | ||
73 | memcpy((void *)regs + dbg_reg_def[regno].offset, mem, | ||
74 | dbg_reg_def[regno].size); | ||
75 | } | ||
76 | return 0; | ||
77 | } | ||
78 | |||
79 | asmlinkage void h8300_kgdb_trap(struct pt_regs *regs) | ||
80 | { | ||
81 | regs->pc &= 0x00ffffff; | ||
82 | if (kgdb_handle_exception(10, SIGTRAP, 0, regs)) | ||
83 | return; | ||
84 | if (*(u16 *)(regs->pc) == *(u16 *)&arch_kgdb_ops.gdb_bpt_instr) | ||
85 | regs->pc += BREAK_INSTR_SIZE; | ||
86 | regs->pc |= regs->ccr << 24; | ||
87 | } | ||
88 | |||
89 | void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) | ||
90 | { | ||
91 | memset((char *)gdb_regs, 0, NUMREGBYTES); | ||
92 | gdb_regs[GDB_SP] = p->thread.ksp; | ||
93 | gdb_regs[GDB_PC] = KSTK_EIP(p); | ||
94 | } | ||
95 | |||
96 | void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc) | ||
97 | { | ||
98 | regs->pc = pc; | ||
99 | } | ||
100 | |||
101 | int kgdb_arch_handle_exception(int vector, int signo, int err_code, | ||
102 | char *remcom_in_buffer, char *remcom_out_buffer, | ||
103 | struct pt_regs *regs) | ||
104 | { | ||
105 | char *ptr; | ||
106 | unsigned long addr; | ||
107 | |||
108 | switch (remcom_in_buffer[0]) { | ||
109 | case 's': | ||
110 | case 'c': | ||
111 | /* handle the optional parameters */ | ||
112 | ptr = &remcom_in_buffer[1]; | ||
113 | if (kgdb_hex2long(&ptr, &addr)) | ||
114 | regs->pc = addr; | ||
115 | |||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | return -1; /* this means that we do not want to exit from the handler */ | ||
120 | } | ||
121 | |||
122 | int kgdb_arch_init(void) | ||
123 | { | ||
124 | return 0; | ||
125 | } | ||
126 | |||
127 | void kgdb_arch_exit(void) | ||
128 | { | ||
129 | /* Nothing to do */ | ||
130 | } | ||
131 | |||
132 | const struct kgdb_arch arch_kgdb_ops = { | ||
133 | /* Breakpoint instruction: trapa #2 */ | ||
134 | .gdb_bpt_instr = { 0x57, 0x20 }, | ||
135 | }; | ||
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c index 380fffd081b2..ad1f81f574e5 100644 --- a/arch/h8300/kernel/signal.c +++ b/arch/h8300/kernel/signal.c | |||
@@ -95,7 +95,7 @@ restore_sigcontext(struct sigcontext *usc, int *pd0) | |||
95 | regs->ccr |= ccr; | 95 | regs->ccr |= ccr; |
96 | regs->orig_er0 = -1; /* disable syscall checks */ | 96 | regs->orig_er0 = -1; /* disable syscall checks */ |
97 | err |= __get_user(usp, &usc->sc_usp); | 97 | err |= __get_user(usp, &usc->sc_usp); |
98 | wrusp(usp); | 98 | regs->sp = usp; |
99 | 99 | ||
100 | err |= __get_user(er0, &usc->sc_er0); | 100 | err |= __get_user(er0, &usc->sc_er0); |
101 | *pd0 = er0; | 101 | *pd0 = er0; |
@@ -180,7 +180,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, | |||
180 | return -EFAULT; | 180 | return -EFAULT; |
181 | 181 | ||
182 | /* Set up to return from userspace. */ | 182 | /* Set up to return from userspace. */ |
183 | ret = frame->retcode; | 183 | ret = (unsigned char *)&frame->retcode; |
184 | if (ksig->ka.sa.sa_flags & SA_RESTORER) | 184 | if (ksig->ka.sa.sa_flags & SA_RESTORER) |
185 | ret = (unsigned char *)(ksig->ka.sa.sa_restorer); | 185 | ret = (unsigned char *)(ksig->ka.sa.sa_restorer); |
186 | else { | 186 | else { |
@@ -196,8 +196,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, | |||
196 | return -EFAULT; | 196 | return -EFAULT; |
197 | 197 | ||
198 | /* Set up registers for signal handler */ | 198 | /* Set up registers for signal handler */ |
199 | wrusp((unsigned long) frame); | 199 | regs->sp = (unsigned long)frame; |
200 | regs->pc = (unsigned long) ksig->ka.sa.sa_handler; | 200 | regs->pc = (unsigned long)ksig->ka.sa.sa_handler; |
201 | regs->er0 = ksig->sig; | 201 | regs->er0 = ksig->sig; |
202 | regs->er1 = (unsigned long)&(frame->info); | 202 | regs->er1 = (unsigned long)&(frame->info); |
203 | regs->er2 = (unsigned long)&frame->uc; | 203 | regs->er2 = (unsigned long)&frame->uc; |
diff --git a/arch/h8300/kernel/traps.c b/arch/h8300/kernel/traps.c index 1b2d7cdd6591..044a36125846 100644 --- a/arch/h8300/kernel/traps.c +++ b/arch/h8300/kernel/traps.c | |||
@@ -125,17 +125,18 @@ void show_stack(struct task_struct *task, unsigned long *esp) | |||
125 | 125 | ||
126 | pr_info("Stack from %08lx:", (unsigned long)stack); | 126 | pr_info("Stack from %08lx:", (unsigned long)stack); |
127 | for (i = 0; i < kstack_depth_to_print; i++) { | 127 | for (i = 0; i < kstack_depth_to_print; i++) { |
128 | if (((unsigned long)stack & (THREAD_SIZE - 1)) == 0) | 128 | if (((unsigned long)stack & (THREAD_SIZE - 1)) >= |
129 | THREAD_SIZE-4) | ||
129 | break; | 130 | break; |
130 | if (i % 8 == 0) | 131 | if (i % 8 == 0) |
131 | pr_info("\n "); | 132 | pr_info(" "); |
132 | pr_info(" %08lx", *stack++); | 133 | pr_cont(" %08lx", *stack++); |
133 | } | 134 | } |
134 | 135 | ||
135 | pr_info("\nCall Trace:"); | 136 | pr_info("\nCall Trace:\n"); |
136 | i = 0; | 137 | i = 0; |
137 | stack = esp; | 138 | stack = esp; |
138 | while (((unsigned long)stack & (THREAD_SIZE - 1)) != 0) { | 139 | while (((unsigned long)stack & (THREAD_SIZE - 1)) < THREAD_SIZE-4) { |
139 | addr = *stack++; | 140 | addr = *stack++; |
140 | /* | 141 | /* |
141 | * If the address is either in the text segment of the | 142 | * If the address is either in the text segment of the |
@@ -147,15 +148,10 @@ void show_stack(struct task_struct *task, unsigned long *esp) | |||
147 | */ | 148 | */ |
148 | if (check_kernel_text(addr)) { | 149 | if (check_kernel_text(addr)) { |
149 | if (i % 4 == 0) | 150 | if (i % 4 == 0) |
150 | pr_info("\n "); | 151 | pr_info(" "); |
151 | pr_info(" [<%08lx>]", addr); | 152 | pr_cont(" [<%08lx>]", addr); |
152 | i++; | 153 | i++; |
153 | } | 154 | } |
154 | } | 155 | } |
155 | pr_info("\n"); | 156 | pr_info("\n"); |
156 | } | 157 | } |
157 | |||
158 | void show_trace_task(struct task_struct *tsk) | ||
159 | { | ||
160 | show_stack(tsk, (unsigned long *)tsk->thread.esp0); | ||
161 | } | ||
diff --git a/drivers/irqchip/irq-renesas-h8s.c b/drivers/irqchip/irq-renesas-h8s.c index 8098ead1eb22..af8c6c61c824 100644 --- a/drivers/irqchip/irq-renesas-h8s.c +++ b/drivers/irqchip/irq-renesas-h8s.c | |||
@@ -40,8 +40,8 @@ static void h8s_disable_irq(struct irq_data *data) | |||
40 | addr = IPRA + ((ipr_table[irq - 16] & 0xf0) >> 3); | 40 | addr = IPRA + ((ipr_table[irq - 16] & 0xf0) >> 3); |
41 | pos = (ipr_table[irq - 16] & 0x0f) * 4; | 41 | pos = (ipr_table[irq - 16] & 0x0f) * 4; |
42 | pri = ~(0x000f << pos); | 42 | pri = ~(0x000f << pos); |
43 | pri &= ctrl_inw(addr); | 43 | pri &= readw(addr); |
44 | ctrl_outw(pri, addr); | 44 | writew(pri, addr); |
45 | } | 45 | } |
46 | 46 | ||
47 | static void h8s_enable_irq(struct irq_data *data) | 47 | static void h8s_enable_irq(struct irq_data *data) |
@@ -54,9 +54,9 @@ static void h8s_enable_irq(struct irq_data *data) | |||
54 | addr = IPRA + ((ipr_table[irq - 16] & 0xf0) >> 3); | 54 | addr = IPRA + ((ipr_table[irq - 16] & 0xf0) >> 3); |
55 | pos = (ipr_table[irq - 16] & 0x0f) * 4; | 55 | pos = (ipr_table[irq - 16] & 0x0f) * 4; |
56 | pri = ~(0x000f << pos); | 56 | pri = ~(0x000f << pos); |
57 | pri &= ctrl_inw(addr); | 57 | pri &= readw(addr); |
58 | pri |= 1 << pos; | 58 | pri |= 1 << pos; |
59 | ctrl_outw(pri, addr); | 59 | writew(pri, addr); |
60 | } | 60 | } |
61 | 61 | ||
62 | struct irq_chip h8s_irq_chip = { | 62 | struct irq_chip h8s_irq_chip = { |
@@ -90,7 +90,7 @@ static int __init h8s_intc_of_init(struct device_node *intc, | |||
90 | /* All interrupt priority is 0 (disable) */ | 90 | /* All interrupt priority is 0 (disable) */ |
91 | /* IPRA to IPRK */ | 91 | /* IPRA to IPRK */ |
92 | for (n = 0; n <= 'k' - 'a'; n++) | 92 | for (n = 0; n <= 'k' - 'a'; n++) |
93 | ctrl_outw(0x0000, IPRA + (n * 2)); | 93 | writew(0x0000, IPRA + (n * 2)); |
94 | 94 | ||
95 | domain = irq_domain_add_linear(intc, NR_IRQS, &irq_ops, NULL); | 95 | domain = irq_domain_add_linear(intc, NR_IRQS, &irq_ops, NULL); |
96 | BUG_ON(!domain); | 96 | BUG_ON(!domain); |