diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-04 20:26:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-04 20:26:15 -0400 |
commit | 2e1e9212ed8c532c6b324de77d3cafef5d2bc846 (patch) | |
tree | 15097a99d03679f2c95ea2fdc0eb3c3ebcc474b8 /arch | |
parent | 2acb802b0c5485aedb46e23b2b45e49573454c09 (diff) | |
parent | f5663f5bded3364158e2d31904173cb1debc2ecd (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (29 commits)
sh: enable maple_keyb in dreamcast_defconfig.
SH2(A) cache update
nommu: Provide vmalloc_exec().
add addrespace definition for sh2a.
sh: Kill off ARCH_SUPPORTS_AOUT and remnants of a.out support.
sh: define GENERIC_HARDIRQS_NO__DO_IRQ.
sh: define GENERIC_LOCKBREAK.
sh: Save NUMA node data in vmcore for crash dumps.
sh: module_alloc() should be using vmalloc_exec().
sh: Fix up __bug_table handling in module loader.
sh: Add documentation and integrate into docbook build.
sh: Fix up broken kerneldoc comments.
maple: Kill useless private_data pointer.
maple: Clean up maple_driver_register/unregister routines.
input: Clean up maple keyboard driver
maple: allow removal and reinsertion of keyboard driver module
sh: /proc/asids depends on MMU.
arch/sh/boards/mach-se/7343/irq.c: removed duplicated #include
arch/sh/boards/board-ap325rxa.c: removed duplicated #include
sh/boards/Makefile typo fix
...
Diffstat (limited to 'arch')
32 files changed, 592 insertions, 397 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index cb992c3d6b71..5131d50f851a 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -48,6 +48,9 @@ config GENERIC_HWEIGHT | |||
48 | config GENERIC_HARDIRQS | 48 | config GENERIC_HARDIRQS |
49 | def_bool y | 49 | def_bool y |
50 | 50 | ||
51 | config GENERIC_HARDIRQS_NO__DO_IRQ | ||
52 | def_bool y | ||
53 | |||
51 | config GENERIC_IRQ_PROBE | 54 | config GENERIC_IRQ_PROBE |
52 | def_bool y | 55 | def_bool y |
53 | 56 | ||
@@ -63,6 +66,10 @@ config GENERIC_TIME | |||
63 | config GENERIC_CLOCKEVENTS | 66 | config GENERIC_CLOCKEVENTS |
64 | def_bool n | 67 | def_bool n |
65 | 68 | ||
69 | config GENERIC_LOCKBREAK | ||
70 | def_bool y | ||
71 | depends on SMP && PREEMPT | ||
72 | |||
66 | config SYS_SUPPORTS_PM | 73 | config SYS_SUPPORTS_PM |
67 | bool | 74 | bool |
68 | 75 | ||
@@ -94,9 +101,6 @@ config ARCH_HAS_ILOG2_U64 | |||
94 | config ARCH_NO_VIRT_TO_BUS | 101 | config ARCH_NO_VIRT_TO_BUS |
95 | def_bool y | 102 | def_bool y |
96 | 103 | ||
97 | config ARCH_SUPPORTS_AOUT | ||
98 | def_bool y | ||
99 | |||
100 | config IO_TRAPPED | 104 | config IO_TRAPPED |
101 | bool | 105 | bool |
102 | 106 | ||
@@ -483,6 +487,23 @@ config CRASH_DUMP | |||
483 | 487 | ||
484 | For more details see Documentation/kdump/kdump.txt | 488 | For more details see Documentation/kdump/kdump.txt |
485 | 489 | ||
490 | config SECCOMP | ||
491 | bool "Enable seccomp to safely compute untrusted bytecode" | ||
492 | depends on PROC_FS | ||
493 | default y | ||
494 | help | ||
495 | This kernel feature is useful for number crunching applications | ||
496 | that may need to compute untrusted bytecode during their | ||
497 | execution. By using pipes or other transports made available to | ||
498 | the process as file descriptors supporting the read/write | ||
499 | syscalls, it's possible to isolate those applications in | ||
500 | their own address space using seccomp. Once seccomp is | ||
501 | enabled via prctl, it cannot be disabled and the task is only | ||
502 | allowed to execute a few safe syscalls defined by each seccomp | ||
503 | mode. | ||
504 | |||
505 | If unsure, say N. | ||
506 | |||
486 | config SMP | 507 | config SMP |
487 | bool "Symmetric multi-processing support" | 508 | bool "Symmetric multi-processing support" |
488 | depends on SYS_SUPPORTS_SMP | 509 | depends on SYS_SUPPORTS_SMP |
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug index 36f4b1f7066d..4d2d102e00d5 100644 --- a/arch/sh/Kconfig.debug +++ b/arch/sh/Kconfig.debug | |||
@@ -182,7 +182,7 @@ if SUPERH64 | |||
182 | 182 | ||
183 | config SH64_PROC_ASIDS | 183 | config SH64_PROC_ASIDS |
184 | bool "Debug: report ASIDs through /proc/asids" | 184 | bool "Debug: report ASIDs through /proc/asids" |
185 | depends on PROC_FS | 185 | depends on PROC_FS && MMU |
186 | 186 | ||
187 | config SH64_SR_WATCH | 187 | config SH64_SR_WATCH |
188 | bool "Debug: set SR.WATCH to enable hardware watchpoints and trace" | 188 | bool "Debug: set SR.WATCH to enable hardware watchpoints and trace" |
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 25659ce74baa..01d85c74481d 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -95,8 +95,6 @@ head-y := arch/sh/kernel/init_task.o | |||
95 | head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o | 95 | head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o |
96 | head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o | 96 | head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o |
97 | 97 | ||
98 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | ||
99 | |||
100 | core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ | 98 | core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ |
101 | core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ | 99 | core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ |
102 | 100 | ||
@@ -145,10 +143,6 @@ cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4 | |||
145 | cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5 | 143 | cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5 |
146 | cpuincdir-y += cpu-common # Must be last | 144 | cpuincdir-y += cpu-common # Must be last |
147 | 145 | ||
148 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) | ||
149 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) | ||
150 | libs-y += $(LIBGCC) | ||
151 | |||
152 | drivers-y += arch/sh/drivers/ | 146 | drivers-y += arch/sh/drivers/ |
153 | drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ | 147 | drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ |
154 | 148 | ||
@@ -161,10 +155,16 @@ KBUILD_CFLAGS += -pipe $(cflags-y) | |||
161 | KBUILD_CPPFLAGS += $(cflags-y) | 155 | KBUILD_CPPFLAGS += $(cflags-y) |
162 | KBUILD_AFLAGS += $(cflags-y) | 156 | KBUILD_AFLAGS += $(cflags-y) |
163 | 157 | ||
158 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | ||
159 | |||
160 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) | ||
161 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) | ||
162 | libs-y += $(LIBGCC) | ||
163 | |||
164 | PHONY += maketools FORCE | 164 | PHONY += maketools FORCE |
165 | 165 | ||
166 | maketools: include/linux/version.h FORCE | 166 | maketools: include/linux/version.h FORCE |
167 | $(Q)$(MAKE) $(build)=arch/sh/tools arch/sh/include/asm/machtypes.h | 167 | $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h |
168 | 168 | ||
169 | all: $(KBUILD_IMAGE) | 169 | all: $(KBUILD_IMAGE) |
170 | 170 | ||
@@ -215,4 +215,4 @@ arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S | |||
215 | $(call filechk,gen-syscalltab) | 215 | $(call filechk,gen-syscalltab) |
216 | 216 | ||
217 | CLEAN_FILES += arch/sh/lib64/syscalltab.h \ | 217 | CLEAN_FILES += arch/sh/lib64/syscalltab.h \ |
218 | arch/sh/include/asm/machtypes.h | 218 | include/asm-sh/machtypes.h |
diff --git a/arch/sh/boards/Makefile b/arch/sh/boards/Makefile index ff9b93c5a91b..463022c7df3c 100644 --- a/arch/sh/boards/Makefile +++ b/arch/sh/boards/Makefile | |||
@@ -5,4 +5,4 @@ obj-$(CONFIG_SH_AP325RXA) += board-ap325rxa.o | |||
5 | obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o | 5 | obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o |
6 | obj-$(CONFIG_SH_RSK7203) += board-rsk7203.o | 6 | obj-$(CONFIG_SH_RSK7203) += board-rsk7203.o |
7 | obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o | 7 | obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o |
8 | obj-$(CONFIG_SH_SHMIN) += board-shmin..o | 8 | obj-$(CONFIG_SH_SHMIN) += board-shmin.o |
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 9c71603d29a2..025d4fe55a58 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/mtd/physmap.h> | 17 | #include <linux/mtd/physmap.h> |
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/delay.h> | ||
21 | #include <linux/smc911x.h> | 20 | #include <linux/smc911x.h> |
22 | #include <media/soc_camera_platform.h> | 21 | #include <media/soc_camera_platform.h> |
23 | #include <media/sh_mobile_ceu.h> | 22 | #include <media/sh_mobile_ceu.h> |
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c index 5d96e2eef82a..051c29d4eae0 100644 --- a/arch/sh/boards/mach-se/7343/irq.c +++ b/arch/sh/boards/mach-se/7343/irq.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
16 | #include <linux/irq.h> | ||
17 | #include <linux/io.h> | 16 | #include <linux/io.h> |
18 | #include <mach-se/mach/se7343.h> | 17 | #include <mach-se/mach/se7343.h> |
19 | 18 | ||
diff --git a/arch/sh/configs/dreamcast_defconfig b/arch/sh/configs/dreamcast_defconfig index d4075283956d..3dc1cbd8a981 100644 --- a/arch/sh/configs/dreamcast_defconfig +++ b/arch/sh/configs/dreamcast_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.26 | 3 | # Linux kernel version: 2.6.27-rc1 |
4 | # Wed Jul 30 01:34:24 2008 | 4 | # Mon Aug 4 16:49:13 2008 |
5 | # | 5 | # |
6 | CONFIG_SUPERH=y | 6 | CONFIG_SUPERH=y |
7 | CONFIG_SUPERH32=y | 7 | CONFIG_SUPERH32=y |
@@ -11,6 +11,7 @@ CONFIG_GENERIC_BUG=y | |||
11 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 11 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
12 | CONFIG_GENERIC_HWEIGHT=y | 12 | CONFIG_GENERIC_HWEIGHT=y |
13 | CONFIG_GENERIC_HARDIRQS=y | 13 | CONFIG_GENERIC_HARDIRQS=y |
14 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
14 | CONFIG_GENERIC_IRQ_PROBE=y | 15 | CONFIG_GENERIC_IRQ_PROBE=y |
15 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 16 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
16 | CONFIG_GENERIC_TIME=y | 17 | CONFIG_GENERIC_TIME=y |
@@ -21,7 +22,6 @@ CONFIG_LOCKDEP_SUPPORT=y | |||
21 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | 22 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set |
22 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | 23 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set |
23 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | 24 | CONFIG_ARCH_NO_VIRT_TO_BUS=y |
24 | CONFIG_ARCH_SUPPORTS_AOUT=y | ||
25 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | 25 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
26 | 26 | ||
27 | # | 27 | # |
@@ -87,6 +87,7 @@ CONFIG_HAVE_OPROFILE=y | |||
87 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | 87 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set |
88 | CONFIG_HAVE_CLK=y | 88 | CONFIG_HAVE_CLK=y |
89 | CONFIG_PROC_PAGE_MONITOR=y | 89 | CONFIG_PROC_PAGE_MONITOR=y |
90 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
90 | CONFIG_SLABINFO=y | 91 | CONFIG_SLABINFO=y |
91 | CONFIG_RT_MUTEXES=y | 92 | CONFIG_RT_MUTEXES=y |
92 | # CONFIG_TINY_SHMEM is not set | 93 | # CONFIG_TINY_SHMEM is not set |
@@ -284,6 +285,7 @@ CONFIG_HZ=250 | |||
284 | # CONFIG_SCHED_HRTICK is not set | 285 | # CONFIG_SCHED_HRTICK is not set |
285 | # CONFIG_KEXEC is not set | 286 | # CONFIG_KEXEC is not set |
286 | # CONFIG_CRASH_DUMP is not set | 287 | # CONFIG_CRASH_DUMP is not set |
288 | CONFIG_SECCOMP=y | ||
287 | # CONFIG_PREEMPT_NONE is not set | 289 | # CONFIG_PREEMPT_NONE is not set |
288 | # CONFIG_PREEMPT_VOLUNTARY is not set | 290 | # CONFIG_PREEMPT_VOLUNTARY is not set |
289 | CONFIG_PREEMPT=y | 291 | CONFIG_PREEMPT=y |
@@ -317,10 +319,6 @@ CONFIG_PCI_LEGACY=y | |||
317 | # | 319 | # |
318 | CONFIG_BINFMT_ELF=y | 320 | CONFIG_BINFMT_ELF=y |
319 | # CONFIG_BINFMT_MISC is not set | 321 | # CONFIG_BINFMT_MISC is not set |
320 | |||
321 | # | ||
322 | # Networking | ||
323 | # | ||
324 | CONFIG_NET=y | 322 | CONFIG_NET=y |
325 | 323 | ||
326 | # | 324 | # |
@@ -555,7 +553,7 @@ CONFIG_INPUT_KEYBOARD=y | |||
555 | # CONFIG_KEYBOARD_XTKBD is not set | 553 | # CONFIG_KEYBOARD_XTKBD is not set |
556 | # CONFIG_KEYBOARD_NEWTON is not set | 554 | # CONFIG_KEYBOARD_NEWTON is not set |
557 | # CONFIG_KEYBOARD_STOWAWAY is not set | 555 | # CONFIG_KEYBOARD_STOWAWAY is not set |
558 | # CONFIG_KEYBOARD_MAPLE is not set | 556 | CONFIG_KEYBOARD_MAPLE=y |
559 | # CONFIG_KEYBOARD_SH_KEYSC is not set | 557 | # CONFIG_KEYBOARD_SH_KEYSC is not set |
560 | CONFIG_INPUT_MOUSE=y | 558 | CONFIG_INPUT_MOUSE=y |
561 | # CONFIG_MOUSE_PS2 is not set | 559 | # CONFIG_MOUSE_PS2 is not set |
diff --git a/arch/sh/include/asm/a.out.h b/arch/sh/include/asm/a.out.h deleted file mode 100644 index 1f93130e179c..000000000000 --- a/arch/sh/include/asm/a.out.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef __ASM_SH_A_OUT_H | ||
2 | #define __ASM_SH_A_OUT_H | ||
3 | |||
4 | struct exec | ||
5 | { | ||
6 | unsigned long a_info; /* Use macros N_MAGIC, etc for access */ | ||
7 | unsigned a_text; /* length of text, in bytes */ | ||
8 | unsigned a_data; /* length of data, in bytes */ | ||
9 | unsigned a_bss; /* length of uninitialized data area for file, in bytes */ | ||
10 | unsigned a_syms; /* length of symbol table data in file, in bytes */ | ||
11 | unsigned a_entry; /* start address */ | ||
12 | unsigned a_trsize; /* length of relocation info for text, in bytes */ | ||
13 | unsigned a_drsize; /* length of relocation info for data, in bytes */ | ||
14 | }; | ||
15 | |||
16 | #define N_TRSIZE(a) ((a).a_trsize) | ||
17 | #define N_DRSIZE(a) ((a).a_drsize) | ||
18 | #define N_SYMSIZE(a) ((a).a_syms) | ||
19 | |||
20 | #endif /* __ASM_SH_A_OUT_H */ | ||
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h index 643ab5a7cf3b..b86aeabba61a 100644 --- a/arch/sh/include/asm/ptrace.h +++ b/arch/sh/include/asm/ptrace.h | |||
@@ -104,6 +104,15 @@ struct pt_dspregs { | |||
104 | 104 | ||
105 | extern void show_regs(struct pt_regs *); | 105 | extern void show_regs(struct pt_regs *); |
106 | 106 | ||
107 | /* | ||
108 | * These are defined as per linux/ptrace.h. | ||
109 | */ | ||
110 | struct task_struct; | ||
111 | |||
112 | #define arch_has_single_step() (1) | ||
113 | extern void user_enable_single_step(struct task_struct *); | ||
114 | extern void user_disable_single_step(struct task_struct *); | ||
115 | |||
107 | #ifdef CONFIG_SH_DSP | 116 | #ifdef CONFIG_SH_DSP |
108 | #define task_pt_regs(task) \ | 117 | #define task_pt_regs(task) \ |
109 | ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ | 118 | ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ |
diff --git a/arch/sh/include/asm/seccomp.h b/arch/sh/include/asm/seccomp.h new file mode 100644 index 000000000000..3280ed3802ef --- /dev/null +++ b/arch/sh/include/asm/seccomp.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __ASM_SECCOMP_H | ||
2 | |||
3 | #include <linux/unistd.h> | ||
4 | |||
5 | #define __NR_seccomp_read __NR_read | ||
6 | #define __NR_seccomp_write __NR_write | ||
7 | #define __NR_seccomp_exit __NR_exit | ||
8 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
9 | |||
10 | #endif /* __ASM_SECCOMP_H */ | ||
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h index eeb4c747119e..0a894cafb1dd 100644 --- a/arch/sh/include/asm/thread_info.h +++ b/arch/sh/include/asm/thread_info.h | |||
@@ -117,24 +117,45 @@ static inline struct thread_info *current_thread_info(void) | |||
117 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | 117 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
118 | #define TIF_RESTORE_SIGMASK 3 /* restore signal mask in do_signal() */ | 118 | #define TIF_RESTORE_SIGMASK 3 /* restore signal mask in do_signal() */ |
119 | #define TIF_SINGLESTEP 4 /* singlestepping active */ | 119 | #define TIF_SINGLESTEP 4 /* singlestepping active */ |
120 | #define TIF_SYSCALL_AUDIT 5 | 120 | #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ |
121 | #define TIF_SECCOMP 6 /* secure computing */ | ||
122 | #define TIF_NOTIFY_RESUME 7 /* callback before returning to user */ | ||
121 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ | 123 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ |
122 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 124 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
123 | #define TIF_MEMDIE 18 | 125 | #define TIF_MEMDIE 18 |
124 | #define TIF_FREEZE 19 | 126 | #define TIF_FREEZE 19 /* Freezing for suspend */ |
125 | 127 | ||
126 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 128 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
127 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 129 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
128 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 130 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
129 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 131 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) |
130 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) | 132 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) |
131 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 133 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
132 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) | 134 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
133 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 135 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
134 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 136 | #define _TIF_USEDFPU (1 << TIF_USEDFPU) |
135 | 137 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | |
136 | #define _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */ | 138 | #define _TIF_FREEZE (1 << TIF_FREEZE) |
137 | #define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */ | 139 | |
140 | /* | ||
141 | * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within a byte, or we | ||
142 | * blow the tst immediate size constraints and need to fix up | ||
143 | * arch/sh/kernel/entry-common.S. | ||
144 | */ | ||
145 | |||
146 | /* work to do in syscall trace */ | ||
147 | #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ | ||
148 | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP) | ||
149 | |||
150 | /* work to do on any return to u-space */ | ||
151 | #define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \ | ||
152 | _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \ | ||
153 | _TIF_SINGLESTEP | _TIF_RESTORE_SIGMASK | \ | ||
154 | _TIF_NOTIFY_RESUME) | ||
155 | |||
156 | /* work to do on interrupt/exception return */ | ||
157 | #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \ | ||
158 | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP)) | ||
138 | 159 | ||
139 | #endif /* __KERNEL__ */ | 160 | #endif /* __KERNEL__ */ |
140 | 161 | ||
diff --git a/arch/sh/include/asm/tlb_64.h b/arch/sh/include/asm/tlb_64.h index 0a96f3af69e3..ef0ae2a28f23 100644 --- a/arch/sh/include/asm/tlb_64.h +++ b/arch/sh/include/asm/tlb_64.h | |||
@@ -21,11 +21,9 @@ | |||
21 | #ifndef __ASSEMBLY__ | 21 | #ifndef __ASSEMBLY__ |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * for_each_dtlb_entry | 24 | * for_each_dtlb_entry - Iterate over free (non-wired) DTLB entries |
25 | * | 25 | * |
26 | * @tlb: TLB entry | 26 | * @tlb: TLB entry |
27 | * | ||
28 | * Iterate over free (non-wired) DTLB entries | ||
29 | */ | 27 | */ |
30 | #define for_each_dtlb_entry(tlb) \ | 28 | #define for_each_dtlb_entry(tlb) \ |
31 | for (tlb = cpu_data->dtlb.first; \ | 29 | for (tlb = cpu_data->dtlb.first; \ |
@@ -33,11 +31,9 @@ | |||
33 | tlb += cpu_data->dtlb.step) | 31 | tlb += cpu_data->dtlb.step) |
34 | 32 | ||
35 | /** | 33 | /** |
36 | * for_each_itlb_entry | 34 | * for_each_itlb_entry - Iterate over free (non-wired) ITLB entries |
37 | * | 35 | * |
38 | * @tlb: TLB entry | 36 | * @tlb: TLB entry |
39 | * | ||
40 | * Iterate over free (non-wired) ITLB entries | ||
41 | */ | 37 | */ |
42 | #define for_each_itlb_entry(tlb) \ | 38 | #define for_each_itlb_entry(tlb) \ |
43 | for (tlb = cpu_data->itlb.first; \ | 39 | for (tlb = cpu_data->itlb.first; \ |
@@ -45,11 +41,9 @@ | |||
45 | tlb += cpu_data->itlb.step) | 41 | tlb += cpu_data->itlb.step) |
46 | 42 | ||
47 | /** | 43 | /** |
48 | * __flush_tlb_slot | 44 | * __flush_tlb_slot - Flushes TLB slot @slot. |
49 | * | 45 | * |
50 | * @slot: Address of TLB slot. | 46 | * @slot: Address of TLB slot. |
51 | * | ||
52 | * Flushes TLB slot @slot. | ||
53 | */ | 47 | */ |
54 | static inline void __flush_tlb_slot(unsigned long long slot) | 48 | static inline void __flush_tlb_slot(unsigned long long slot) |
55 | { | 49 | { |
diff --git a/arch/sh/include/cpu-sh2/cpu/cache.h b/arch/sh/include/cpu-sh2/cpu/cache.h index 4e0b16500686..673515bc4135 100644 --- a/arch/sh/include/cpu-sh2/cpu/cache.h +++ b/arch/sh/include/cpu-sh2/cpu/cache.h | |||
@@ -21,11 +21,11 @@ | |||
21 | #define CCR 0xffffffec | 21 | #define CCR 0xffffffec |
22 | 22 | ||
23 | #define CCR_CACHE_CE 0x01 /* Cache enable */ | 23 | #define CCR_CACHE_CE 0x01 /* Cache enable */ |
24 | #define CCR_CACHE_WT 0x06 /* CCR[bit1=1,bit2=1] */ | 24 | #define CCR_CACHE_WT 0x02 /* CCR[bit1=1,bit2=1] */ |
25 | /* 0x00000000-0x7fffffff: Write-through */ | 25 | /* 0x00000000-0x7fffffff: Write-through */ |
26 | /* 0x80000000-0x9fffffff: Write-back */ | 26 | /* 0x80000000-0x9fffffff: Write-back */ |
27 | /* 0xc0000000-0xdfffffff: Write-through */ | 27 | /* 0xc0000000-0xdfffffff: Write-through */ |
28 | #define CCR_CACHE_CB 0x00 /* CCR[bit1=0,bit2=0] */ | 28 | #define CCR_CACHE_CB 0x04 /* CCR[bit1=0,bit2=0] */ |
29 | /* 0x00000000-0x7fffffff: Write-back */ | 29 | /* 0x00000000-0x7fffffff: Write-back */ |
30 | /* 0x80000000-0x9fffffff: Write-through */ | 30 | /* 0x80000000-0x9fffffff: Write-through */ |
31 | /* 0xc0000000-0xdfffffff: Write-back */ | 31 | /* 0xc0000000-0xdfffffff: Write-back */ |
@@ -36,6 +36,8 @@ | |||
36 | 36 | ||
37 | #define CCR_CACHE_ENABLE CCR_CACHE_CE | 37 | #define CCR_CACHE_ENABLE CCR_CACHE_CE |
38 | #define CCR_CACHE_INVALIDATE CCR_CACHE_CF | 38 | #define CCR_CACHE_INVALIDATE CCR_CACHE_CF |
39 | #define CACHE_PHYSADDR_MASK 0x1ffffc00 | ||
40 | |||
39 | #endif | 41 | #endif |
40 | 42 | ||
41 | #endif /* __ASM_CPU_SH2_CACHE_H */ | 43 | #endif /* __ASM_CPU_SH2_CACHE_H */ |
diff --git a/arch/sh/include/cpu-sh2a/cpu/addrspace.h b/arch/sh/include/cpu-sh2a/cpu/addrspace.h new file mode 100644 index 000000000000..31eb4b58aa6d --- /dev/null +++ b/arch/sh/include/cpu-sh2a/cpu/addrspace.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __ASM_SH_CPU_SH2A_ADDRSPACE_H | ||
2 | #define __ASM_SH_CPU_SH2A_ADDRSPACE_H | ||
3 | |||
4 | #define P0SEG 0x00000000 | ||
5 | #define P1SEG 0x00000000 | ||
6 | #define P2SEG 0x20000000 | ||
7 | #define P3SEG 0x40000000 | ||
8 | #define P4SEG 0x60000000 | ||
9 | |||
10 | #endif /* __ASM_SH_CPU_SH2A_ADDRSPACE_H */ | ||
diff --git a/arch/sh/include/cpu-sh2a/cpu/cache.h b/arch/sh/include/cpu-sh2a/cpu/cache.h index afe228b3f493..defb0baa5a06 100644 --- a/arch/sh/include/cpu-sh2a/cpu/cache.h +++ b/arch/sh/include/cpu-sh2a/cpu/cache.h | |||
@@ -36,5 +36,8 @@ | |||
36 | 36 | ||
37 | #define CCR_CACHE_ENABLE (CCR_CACHE_OCE | CCR_CACHE_ICE) | 37 | #define CCR_CACHE_ENABLE (CCR_CACHE_OCE | CCR_CACHE_ICE) |
38 | #define CCR_CACHE_INVALIDATE (CCR_CACHE_OCI | CCR_CACHE_ICI) | 38 | #define CCR_CACHE_INVALIDATE (CCR_CACHE_OCI | CCR_CACHE_ICI) |
39 | #define CCR_ICACHE_INVALIDATE CCR_CACHE_ICI | ||
40 | #define CCR_OCACHE_INVALIDATE CCR_CACHE_OCI | ||
41 | #define CACHE_PHYSADDR_MASK 0x1ffffc00 | ||
39 | 42 | ||
40 | #endif /* __ASM_CPU_SH2A_CACHE_H */ | 43 | #endif /* __ASM_CPU_SH2A_CACHE_H */ |
diff --git a/arch/sh/include/cpu-sh2a/cpu/cacheflush.h b/arch/sh/include/cpu-sh2a/cpu/cacheflush.h new file mode 100644 index 000000000000..3d3b9205d2ac --- /dev/null +++ b/arch/sh/include/cpu-sh2a/cpu/cacheflush.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef __ASM_CPU_SH2A_CACHEFLUSH_H | ||
2 | #define __ASM_CPU_SH2A_CACHEFLUSH_H | ||
3 | |||
4 | /* | ||
5 | * Cache flushing: | ||
6 | * | ||
7 | * - flush_cache_all() flushes entire cache | ||
8 | * - flush_cache_mm(mm) flushes the specified mm context's cache lines | ||
9 | * - flush_cache_dup mm(mm) handles cache flushing when forking | ||
10 | * - flush_cache_page(mm, vmaddr, pfn) flushes a single page | ||
11 | * - flush_cache_range(vma, start, end) flushes a range of pages | ||
12 | * | ||
13 | * - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache | ||
14 | * - flush_icache_range(start, end) flushes(invalidates) a range for icache | ||
15 | * - flush_icache_page(vma, pg) flushes(invalidates) a page for icache | ||
16 | * | ||
17 | * Caches are indexed (effectively) by physical address on SH-2, so | ||
18 | * we don't need them. | ||
19 | */ | ||
20 | #define flush_cache_all() do { } while (0) | ||
21 | #define flush_cache_mm(mm) do { } while (0) | ||
22 | #define flush_cache_dup_mm(mm) do { } while (0) | ||
23 | #define flush_cache_range(vma, start, end) do { } while (0) | ||
24 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) | ||
25 | #define flush_dcache_page(page) do { } while (0) | ||
26 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | ||
27 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | ||
28 | void flush_icache_range(unsigned long start, unsigned long end); | ||
29 | #define flush_icache_page(vma,pg) do { } while (0) | ||
30 | #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) | ||
31 | #define flush_cache_sigtramp(vaddr) do { } while (0) | ||
32 | |||
33 | #define p3_cache_init() do { } while (0) | ||
34 | #endif /* __ASM_CPU_SH2A_CACHEFLUSH_H */ | ||
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index dcdf959a3d44..8a8a993f55ea 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c | |||
@@ -199,7 +199,7 @@ EXPORT_SYMBOL(sq_remap); | |||
199 | 199 | ||
200 | /** | 200 | /** |
201 | * sq_unmap - Unmap a Store Queue allocation | 201 | * sq_unmap - Unmap a Store Queue allocation |
202 | * @map: Pre-allocated Store Queue mapping. | 202 | * @vaddr: Pre-allocated Store Queue mapping. |
203 | * | 203 | * |
204 | * Unmaps the store queue allocation @map that was previously created by | 204 | * Unmaps the store queue allocation @map that was previously created by |
205 | * sq_remap(). Also frees up the pte that was previously inserted into | 205 | * sq_remap(). Also frees up the pte that was previously inserted into |
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S index ca08e7f26a3a..04c7da968146 100644 --- a/arch/sh/kernel/cpu/sh5/entry.S +++ b/arch/sh/kernel/cpu/sh5/entry.S | |||
@@ -987,11 +987,11 @@ work_resched: | |||
987 | work_notifysig: | 987 | work_notifysig: |
988 | gettr tr1, LINK | 988 | gettr tr1, LINK |
989 | 989 | ||
990 | movi do_signal, r6 | 990 | movi do_notify_resume, r6 |
991 | ptabs r6, tr0 | 991 | ptabs r6, tr0 |
992 | or SP, ZERO, r2 | 992 | or SP, ZERO, r2 |
993 | or ZERO, ZERO, r3 | 993 | or r7, ZERO, r3 |
994 | blink tr0, LINK /* Call do_signal(regs, 0), return here */ | 994 | blink tr0, LINK /* Call do_notify_resume(regs, current_thread_info->flags), return here */ |
995 | 995 | ||
996 | restore_all: | 996 | restore_all: |
997 | /* Do prefetches */ | 997 | /* Do prefetches */ |
@@ -1300,18 +1300,20 @@ syscall_allowed: | |||
1300 | 1300 | ||
1301 | getcon KCR0, r2 | 1301 | getcon KCR0, r2 |
1302 | ld.l r2, TI_FLAGS, r4 | 1302 | ld.l r2, TI_FLAGS, r4 |
1303 | movi (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT), r6 | 1303 | movi _TIF_WORK_SYSCALL_MASK, r6 |
1304 | and r6, r4, r6 | 1304 | and r6, r4, r6 |
1305 | beq/l r6, ZERO, tr0 | 1305 | beq/l r6, ZERO, tr0 |
1306 | 1306 | ||
1307 | /* Trace it by calling syscall_trace before and after */ | 1307 | /* Trace it by calling syscall_trace before and after */ |
1308 | movi syscall_trace, r4 | 1308 | movi do_syscall_trace_enter, r4 |
1309 | or SP, ZERO, r2 | 1309 | or SP, ZERO, r2 |
1310 | or ZERO, ZERO, r3 | ||
1311 | ptabs r4, tr0 | 1310 | ptabs r4, tr0 |
1312 | blink tr0, LINK | 1311 | blink tr0, LINK |
1313 | 1312 | ||
1314 | /* Reload syscall number as r5 is trashed by syscall_trace */ | 1313 | /* Save the retval */ |
1314 | st.q SP, FRAME_R(2), r2 | ||
1315 | |||
1316 | /* Reload syscall number as r5 is trashed by do_syscall_trace_enter */ | ||
1315 | ld.q SP, FRAME_S(FSYSCALL_ID), r5 | 1317 | ld.q SP, FRAME_S(FSYSCALL_ID), r5 |
1316 | andi r5, 0x1ff, r5 | 1318 | andi r5, 0x1ff, r5 |
1317 | 1319 | ||
@@ -1343,9 +1345,8 @@ syscall_ret_trace: | |||
1343 | /* We get back here only if under trace */ | 1345 | /* We get back here only if under trace */ |
1344 | st.q SP, FRAME_R(9), r2 /* Save return value */ | 1346 | st.q SP, FRAME_R(9), r2 /* Save return value */ |
1345 | 1347 | ||
1346 | movi syscall_trace, LINK | 1348 | movi do_syscall_trace_leave, LINK |
1347 | or SP, ZERO, r2 | 1349 | or SP, ZERO, r2 |
1348 | movi 1, r3 | ||
1349 | ptabs LINK, tr0 | 1350 | ptabs LINK, tr0 |
1350 | blink tr0, LINK | 1351 | blink tr0, LINK |
1351 | 1352 | ||
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 5e0dd1933847..0bc17def55a7 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -202,7 +202,7 @@ work_resched: | |||
202 | syscall_exit_work: | 202 | syscall_exit_work: |
203 | ! r0: current_thread_info->flags | 203 | ! r0: current_thread_info->flags |
204 | ! r8: current_thread_info | 204 | ! r8: current_thread_info |
205 | tst #_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT, r0 | 205 | tst #_TIF_WORK_SYSCALL_MASK, r0 |
206 | bt/s work_pending | 206 | bt/s work_pending |
207 | tst #_TIF_NEED_RESCHED, r0 | 207 | tst #_TIF_NEED_RESCHED, r0 |
208 | #ifdef CONFIG_TRACE_IRQFLAGS | 208 | #ifdef CONFIG_TRACE_IRQFLAGS |
@@ -211,10 +211,8 @@ syscall_exit_work: | |||
211 | nop | 211 | nop |
212 | #endif | 212 | #endif |
213 | sti | 213 | sti |
214 | ! XXX setup arguments... | ||
215 | mov r15, r4 | 214 | mov r15, r4 |
216 | mov #1, r5 | 215 | mov.l 8f, r0 ! do_syscall_trace_leave |
217 | mov.l 4f, r0 ! do_syscall_trace | ||
218 | jsr @r0 | 216 | jsr @r0 |
219 | nop | 217 | nop |
220 | bra resume_userspace | 218 | bra resume_userspace |
@@ -223,12 +221,11 @@ syscall_exit_work: | |||
223 | .align 2 | 221 | .align 2 |
224 | syscall_trace_entry: | 222 | syscall_trace_entry: |
225 | ! Yes it is traced. | 223 | ! Yes it is traced. |
226 | ! XXX setup arguments... | ||
227 | mov r15, r4 | 224 | mov r15, r4 |
228 | mov #0, r5 | 225 | mov.l 7f, r11 ! Call do_syscall_trace_enter which notifies |
229 | mov.l 4f, r11 ! Call do_syscall_trace which notifies | ||
230 | jsr @r11 ! superior (will chomp R[0-7]) | 226 | jsr @r11 ! superior (will chomp R[0-7]) |
231 | nop | 227 | nop |
228 | mov.l r0, @(OFF_R0,r15) ! Save return value | ||
232 | ! Reload R0-R4 from kernel stack, where the | 229 | ! Reload R0-R4 from kernel stack, where the |
233 | ! parent may have modified them using | 230 | ! parent may have modified them using |
234 | ! ptrace(POKEUSR). (Note that R0-R2 are | 231 | ! ptrace(POKEUSR). (Note that R0-R2 are |
@@ -351,7 +348,7 @@ ENTRY(system_call) | |||
351 | ! | 348 | ! |
352 | get_current_thread_info r8, r10 | 349 | get_current_thread_info r8, r10 |
353 | mov.l @(TI_FLAGS,r8), r8 | 350 | mov.l @(TI_FLAGS,r8), r8 |
354 | mov #(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT), r10 | 351 | mov #_TIF_WORK_SYSCALL_MASK, r10 |
355 | tst r10, r8 | 352 | tst r10, r8 |
356 | bf syscall_trace_entry | 353 | bf syscall_trace_entry |
357 | ! | 354 | ! |
@@ -389,8 +386,9 @@ syscall_exit: | |||
389 | #endif | 386 | #endif |
390 | 2: .long NR_syscalls | 387 | 2: .long NR_syscalls |
391 | 3: .long sys_call_table | 388 | 3: .long sys_call_table |
392 | 4: .long do_syscall_trace | ||
393 | #ifdef CONFIG_TRACE_IRQFLAGS | 389 | #ifdef CONFIG_TRACE_IRQFLAGS |
394 | 5: .long trace_hardirqs_on | 390 | 5: .long trace_hardirqs_on |
395 | 6: .long trace_hardirqs_off | 391 | 6: .long trace_hardirqs_off |
396 | #endif | 392 | #endif |
393 | 7: .long do_syscall_trace_enter | ||
394 | 8: .long do_syscall_trace_leave | ||
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index ec1eadce4aaa..4703dff174d5 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/kexec.h> | 13 | #include <linux/kexec.h> |
14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/reboot.h> | 15 | #include <linux/reboot.h> |
16 | #include <linux/numa.h> | ||
16 | #include <asm/pgtable.h> | 17 | #include <asm/pgtable.h> |
17 | #include <asm/pgalloc.h> | 18 | #include <asm/pgalloc.h> |
18 | #include <asm/mmu_context.h> | 19 | #include <asm/mmu_context.h> |
@@ -104,3 +105,10 @@ void machine_kexec(struct kimage *image) | |||
104 | (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); | 105 | (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); |
105 | } | 106 | } |
106 | 107 | ||
108 | void arch_crash_save_vmcoreinfo(void) | ||
109 | { | ||
110 | #ifdef CONFIG_NUMA | ||
111 | VMCOREINFO_SYMBOL(node_data); | ||
112 | VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); | ||
113 | #endif | ||
114 | } | ||
diff --git a/arch/sh/kernel/module.c b/arch/sh/kernel/module.c index 5482e65375a9..c43081039dd5 100644 --- a/arch/sh/kernel/module.c +++ b/arch/sh/kernel/module.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/moduleloader.h> | 27 | #include <linux/moduleloader.h> |
28 | #include <linux/elf.h> | 28 | #include <linux/elf.h> |
29 | #include <linux/vmalloc.h> | 29 | #include <linux/vmalloc.h> |
30 | #include <linux/bug.h> | ||
30 | #include <linux/fs.h> | 31 | #include <linux/fs.h> |
31 | #include <linux/string.h> | 32 | #include <linux/string.h> |
32 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
@@ -36,7 +37,8 @@ void *module_alloc(unsigned long size) | |||
36 | { | 37 | { |
37 | if (size == 0) | 38 | if (size == 0) |
38 | return NULL; | 39 | return NULL; |
39 | return vmalloc(size); | 40 | |
41 | return vmalloc_exec(size); | ||
40 | } | 42 | } |
41 | 43 | ||
42 | 44 | ||
@@ -145,9 +147,10 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
145 | const Elf_Shdr *sechdrs, | 147 | const Elf_Shdr *sechdrs, |
146 | struct module *me) | 148 | struct module *me) |
147 | { | 149 | { |
148 | return 0; | 150 | return module_bug_finalize(hdr, sechdrs, me); |
149 | } | 151 | } |
150 | 152 | ||
151 | void module_arch_cleanup(struct module *mod) | 153 | void module_arch_cleanup(struct module *mod) |
152 | { | 154 | { |
155 | module_bug_cleanup(mod); | ||
153 | } | 156 | } |
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c index 2bc72def5cf8..035cb300d3dc 100644 --- a/arch/sh/kernel/ptrace_32.c +++ b/arch/sh/kernel/ptrace_32.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/audit.h> | 22 | #include <linux/audit.h> |
23 | #include <linux/seccomp.h> | ||
24 | #include <linux/tracehook.h> | ||
23 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
24 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
25 | #include <asm/system.h> | 27 | #include <asm/system.h> |
@@ -57,7 +59,23 @@ static inline int put_stack_long(struct task_struct *task, int offset, | |||
57 | return 0; | 59 | return 0; |
58 | } | 60 | } |
59 | 61 | ||
60 | static void ptrace_disable_singlestep(struct task_struct *child) | 62 | void user_enable_single_step(struct task_struct *child) |
63 | { | ||
64 | struct pt_regs *regs = task_pt_regs(child); | ||
65 | long pc; | ||
66 | |||
67 | pc = get_stack_long(child, (long)®s->pc); | ||
68 | |||
69 | /* Next scheduling will set up UBC */ | ||
70 | if (child->thread.ubc_pc == 0) | ||
71 | ubc_usercnt += 1; | ||
72 | |||
73 | child->thread.ubc_pc = pc; | ||
74 | |||
75 | set_tsk_thread_flag(child, TIF_SINGLESTEP); | ||
76 | } | ||
77 | |||
78 | void user_disable_single_step(struct task_struct *child) | ||
61 | { | 79 | { |
62 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); | 80 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); |
63 | 81 | ||
@@ -81,7 +99,7 @@ static void ptrace_disable_singlestep(struct task_struct *child) | |||
81 | */ | 99 | */ |
82 | void ptrace_disable(struct task_struct *child) | 100 | void ptrace_disable(struct task_struct *child) |
83 | { | 101 | { |
84 | ptrace_disable_singlestep(child); | 102 | user_disable_single_step(child); |
85 | } | 103 | } |
86 | 104 | ||
87 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 105 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
@@ -90,12 +108,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
90 | int ret; | 108 | int ret; |
91 | 109 | ||
92 | switch (request) { | 110 | switch (request) { |
93 | /* when I and D space are separate, these will need to be fixed. */ | ||
94 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | ||
95 | case PTRACE_PEEKDATA: | ||
96 | ret = generic_ptrace_peekdata(child, addr, data); | ||
97 | break; | ||
98 | |||
99 | /* read the word at location addr in the USER area. */ | 111 | /* read the word at location addr in the USER area. */ |
100 | case PTRACE_PEEKUSR: { | 112 | case PTRACE_PEEKUSR: { |
101 | unsigned long tmp; | 113 | unsigned long tmp; |
@@ -125,12 +137,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
125 | break; | 137 | break; |
126 | } | 138 | } |
127 | 139 | ||
128 | /* when I and D space are separate, this will have to be fixed. */ | ||
129 | case PTRACE_POKETEXT: /* write the word at location addr. */ | ||
130 | case PTRACE_POKEDATA: | ||
131 | ret = generic_ptrace_pokedata(child, addr, data); | ||
132 | break; | ||
133 | |||
134 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ | 140 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ |
135 | ret = -EIO; | 141 | ret = -EIO; |
136 | if ((addr & 3) || addr < 0 || | 142 | if ((addr & 3) || addr < 0 || |
@@ -151,67 +157,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
151 | } | 157 | } |
152 | break; | 158 | break; |
153 | 159 | ||
154 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | ||
155 | case PTRACE_CONT: { /* restart after signal. */ | ||
156 | ret = -EIO; | ||
157 | if (!valid_signal(data)) | ||
158 | break; | ||
159 | if (request == PTRACE_SYSCALL) | ||
160 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
161 | else | ||
162 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
163 | |||
164 | ptrace_disable_singlestep(child); | ||
165 | |||
166 | child->exit_code = data; | ||
167 | wake_up_process(child); | ||
168 | ret = 0; | ||
169 | break; | ||
170 | } | ||
171 | |||
172 | /* | ||
173 | * make the child exit. Best I can do is send it a sigkill. | ||
174 | * perhaps it should be put in the status that it wants to | ||
175 | * exit. | ||
176 | */ | ||
177 | case PTRACE_KILL: { | ||
178 | ret = 0; | ||
179 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | ||
180 | break; | ||
181 | ptrace_disable_singlestep(child); | ||
182 | child->exit_code = SIGKILL; | ||
183 | wake_up_process(child); | ||
184 | break; | ||
185 | } | ||
186 | |||
187 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ | ||
188 | long pc; | ||
189 | struct pt_regs *regs = NULL; | ||
190 | |||
191 | ret = -EIO; | ||
192 | if (!valid_signal(data)) | ||
193 | break; | ||
194 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
195 | if ((child->ptrace & PT_DTRACE) == 0) { | ||
196 | /* Spurious delayed TF traps may occur */ | ||
197 | child->ptrace |= PT_DTRACE; | ||
198 | } | ||
199 | |||
200 | pc = get_stack_long(child, (long)®s->pc); | ||
201 | |||
202 | /* Next scheduling will set up UBC */ | ||
203 | if (child->thread.ubc_pc == 0) | ||
204 | ubc_usercnt += 1; | ||
205 | child->thread.ubc_pc = pc; | ||
206 | |||
207 | set_tsk_thread_flag(child, TIF_SINGLESTEP); | ||
208 | child->exit_code = data; | ||
209 | /* give it a chance to run. */ | ||
210 | wake_up_process(child); | ||
211 | ret = 0; | ||
212 | break; | ||
213 | } | ||
214 | |||
215 | #ifdef CONFIG_SH_DSP | 160 | #ifdef CONFIG_SH_DSP |
216 | case PTRACE_GETDSPREGS: { | 161 | case PTRACE_GETDSPREGS: { |
217 | unsigned long dp; | 162 | unsigned long dp; |
@@ -272,39 +217,49 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
272 | return ret; | 217 | return ret; |
273 | } | 218 | } |
274 | 219 | ||
275 | asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) | 220 | static inline int audit_arch(void) |
276 | { | 221 | { |
277 | struct task_struct *tsk = current; | 222 | int arch = EM_SH; |
278 | 223 | ||
279 | if (unlikely(current->audit_context) && entryexit) | 224 | #ifdef CONFIG_CPU_LITTLE_ENDIAN |
280 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]), | 225 | arch |= __AUDIT_ARCH_LE; |
281 | regs->regs[0]); | 226 | #endif |
282 | 227 | ||
283 | if (!test_thread_flag(TIF_SYSCALL_TRACE) && | 228 | return arch; |
284 | !test_thread_flag(TIF_SINGLESTEP)) | 229 | } |
285 | goto out; | ||
286 | if (!(tsk->ptrace & PT_PTRACED)) | ||
287 | goto out; | ||
288 | 230 | ||
289 | /* the 0x80 provides a way for the tracing parent to distinguish | 231 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) |
290 | between a syscall stop and SIGTRAP delivery */ | 232 | { |
291 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && | 233 | long ret = 0; |
292 | !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); | ||
293 | 234 | ||
294 | /* | 235 | secure_computing(regs->regs[0]); |
295 | * this isn't the same as continuing with a signal, but it will do | 236 | |
296 | * for normal use. strace only continues with a signal if the | 237 | if (test_thread_flag(TIF_SYSCALL_TRACE) && |
297 | * stopping signal is not SIGTRAP. -brl | 238 | tracehook_report_syscall_entry(regs)) |
298 | */ | 239 | /* |
299 | if (tsk->exit_code) { | 240 | * Tracing decided this syscall should not happen. |
300 | send_sig(tsk->exit_code, tsk, 1); | 241 | * We'll return a bogus call number to get an ENOSYS |
301 | tsk->exit_code = 0; | 242 | * error, but leave the original number in regs->regs[0]. |
302 | } | 243 | */ |
244 | ret = -1L; | ||
303 | 245 | ||
304 | out: | 246 | if (unlikely(current->audit_context)) |
305 | if (unlikely(current->audit_context) && !entryexit) | 247 | audit_syscall_entry(audit_arch(), regs->regs[3], |
306 | audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[3], | ||
307 | regs->regs[4], regs->regs[5], | 248 | regs->regs[4], regs->regs[5], |
308 | regs->regs[6], regs->regs[7]); | 249 | regs->regs[6], regs->regs[7]); |
309 | 250 | ||
251 | return ret ?: regs->regs[0]; | ||
252 | } | ||
253 | |||
254 | asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) | ||
255 | { | ||
256 | int step; | ||
257 | |||
258 | if (unlikely(current->audit_context)) | ||
259 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]), | ||
260 | regs->regs[0]); | ||
261 | |||
262 | step = test_thread_flag(TIF_SINGLESTEP); | ||
263 | if (step || test_thread_flag(TIF_SYSCALL_TRACE)) | ||
264 | tracehook_report_syscall_exit(regs, step); | ||
310 | } | 265 | } |
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index d453c47dc522..5922edd416db 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/signal.h> | 27 | #include <linux/signal.h> |
28 | #include <linux/syscalls.h> | 28 | #include <linux/syscalls.h> |
29 | #include <linux/audit.h> | 29 | #include <linux/audit.h> |
30 | #include <linux/seccomp.h> | ||
31 | #include <linux/tracehook.h> | ||
30 | #include <asm/io.h> | 32 | #include <asm/io.h> |
31 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
32 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
@@ -120,18 +122,23 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data) | |||
120 | return 0; | 122 | return 0; |
121 | } | 123 | } |
122 | 124 | ||
125 | void user_enable_single_step(struct task_struct *child) | ||
126 | { | ||
127 | struct pt_regs *regs = child->thread.uregs; | ||
128 | |||
129 | regs->sr |= SR_SSTEP; /* auto-resetting upon exception */ | ||
130 | } | ||
131 | |||
132 | void user_disable_single_step(struct task_struct *child) | ||
133 | { | ||
134 | regs->sr &= ~SR_SSTEP; | ||
135 | } | ||
123 | 136 | ||
124 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 137 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
125 | { | 138 | { |
126 | int ret; | 139 | int ret; |
127 | 140 | ||
128 | switch (request) { | 141 | switch (request) { |
129 | /* when I and D space are separate, these will need to be fixed. */ | ||
130 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | ||
131 | case PTRACE_PEEKDATA: | ||
132 | ret = generic_ptrace_peekdata(child, addr, data); | ||
133 | break; | ||
134 | |||
135 | /* read the word at location addr in the USER area. */ | 142 | /* read the word at location addr in the USER area. */ |
136 | case PTRACE_PEEKUSR: { | 143 | case PTRACE_PEEKUSR: { |
137 | unsigned long tmp; | 144 | unsigned long tmp; |
@@ -154,12 +161,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
154 | break; | 161 | break; |
155 | } | 162 | } |
156 | 163 | ||
157 | /* when I and D space are separate, this will have to be fixed. */ | ||
158 | case PTRACE_POKETEXT: /* write the word at location addr. */ | ||
159 | case PTRACE_POKEDATA: | ||
160 | ret = generic_ptrace_pokedata(child, addr, data); | ||
161 | break; | ||
162 | |||
163 | case PTRACE_POKEUSR: | 164 | case PTRACE_POKEUSR: |
164 | /* write the word at location addr in the USER area. We must | 165 | /* write the word at location addr in the USER area. We must |
165 | disallow any changes to certain SR bits or u_fpvalid, since | 166 | disallow any changes to certain SR bits or u_fpvalid, since |
@@ -191,58 +192,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
191 | } | 192 | } |
192 | break; | 193 | break; |
193 | 194 | ||
194 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | ||
195 | case PTRACE_CONT: { /* restart after signal. */ | ||
196 | ret = -EIO; | ||
197 | if (!valid_signal(data)) | ||
198 | break; | ||
199 | if (request == PTRACE_SYSCALL) | ||
200 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
201 | else | ||
202 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
203 | child->exit_code = data; | ||
204 | wake_up_process(child); | ||
205 | ret = 0; | ||
206 | break; | ||
207 | } | ||
208 | |||
209 | /* | ||
210 | * make the child exit. Best I can do is send it a sigkill. | ||
211 | * perhaps it should be put in the status that it wants to | ||
212 | * exit. | ||
213 | */ | ||
214 | case PTRACE_KILL: { | ||
215 | ret = 0; | ||
216 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | ||
217 | break; | ||
218 | child->exit_code = SIGKILL; | ||
219 | wake_up_process(child); | ||
220 | break; | ||
221 | } | ||
222 | |||
223 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ | ||
224 | struct pt_regs *regs; | ||
225 | |||
226 | ret = -EIO; | ||
227 | if (!valid_signal(data)) | ||
228 | break; | ||
229 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
230 | if ((child->ptrace & PT_DTRACE) == 0) { | ||
231 | /* Spurious delayed TF traps may occur */ | ||
232 | child->ptrace |= PT_DTRACE; | ||
233 | } | ||
234 | |||
235 | regs = child->thread.uregs; | ||
236 | |||
237 | regs->sr |= SR_SSTEP; /* auto-resetting upon exception */ | ||
238 | |||
239 | child->exit_code = data; | ||
240 | /* give it a chance to run. */ | ||
241 | wake_up_process(child); | ||
242 | ret = 0; | ||
243 | break; | ||
244 | } | ||
245 | |||
246 | default: | 195 | default: |
247 | ret = ptrace_request(child, request, addr, data); | 196 | ret = ptrace_request(child, request, addr, data); |
248 | break; | 197 | break; |
@@ -273,38 +222,51 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) | |||
273 | return sys_ptrace(request, pid, addr, data); | 222 | return sys_ptrace(request, pid, addr, data); |
274 | } | 223 | } |
275 | 224 | ||
276 | asmlinkage void syscall_trace(struct pt_regs *regs, int entryexit) | 225 | static inline int audit_arch(void) |
277 | { | 226 | { |
278 | struct task_struct *tsk = current; | 227 | int arch = EM_SH; |
279 | 228 | ||
280 | if (unlikely(current->audit_context) && entryexit) | 229 | #ifdef CONFIG_64BIT |
281 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), | 230 | arch |= __AUDIT_ARCH_64BIT; |
282 | regs->regs[9]); | 231 | #endif |
232 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
233 | arch |= __AUDIT_ARCH_LE; | ||
234 | #endif | ||
283 | 235 | ||
284 | if (!test_thread_flag(TIF_SYSCALL_TRACE) && | 236 | return arch; |
285 | !test_thread_flag(TIF_SINGLESTEP)) | 237 | } |
286 | goto out; | ||
287 | if (!(tsk->ptrace & PT_PTRACED)) | ||
288 | goto out; | ||
289 | |||
290 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && | ||
291 | !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); | ||
292 | |||
293 | /* | ||
294 | * this isn't the same as continuing with a signal, but it will do | ||
295 | * for normal use. strace only continues with a signal if the | ||
296 | * stopping signal is not SIGTRAP. -brl | ||
297 | */ | ||
298 | if (tsk->exit_code) { | ||
299 | send_sig(tsk->exit_code, tsk, 1); | ||
300 | tsk->exit_code = 0; | ||
301 | } | ||
302 | 238 | ||
303 | out: | 239 | asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs) |
304 | if (unlikely(current->audit_context) && !entryexit) | 240 | { |
305 | audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[1], | 241 | long long ret = 0; |
242 | |||
243 | secure_computing(regs->regs[9]); | ||
244 | |||
245 | if (test_thread_flag(TIF_SYSCALL_TRACE) && | ||
246 | tracehook_report_syscall_entry(regs)) | ||
247 | /* | ||
248 | * Tracing decided this syscall should not happen. | ||
249 | * We'll return a bogus call number to get an ENOSYS | ||
250 | * error, but leave the original number in regs->regs[0]. | ||
251 | */ | ||
252 | ret = -1LL; | ||
253 | |||
254 | if (unlikely(current->audit_context)) | ||
255 | audit_syscall_entry(audit_arch(), regs->regs[1], | ||
306 | regs->regs[2], regs->regs[3], | 256 | regs->regs[2], regs->regs[3], |
307 | regs->regs[4], regs->regs[5]); | 257 | regs->regs[4], regs->regs[5]); |
258 | |||
259 | return ret ?: regs->regs[9]; | ||
260 | } | ||
261 | |||
262 | asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) | ||
263 | { | ||
264 | if (unlikely(current->audit_context)) | ||
265 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), | ||
266 | regs->regs[9]); | ||
267 | |||
268 | if (test_thread_flag(TIF_SYSCALL_TRACE)) | ||
269 | tracehook_report_syscall_exit(regs, 0); | ||
308 | } | 270 | } |
309 | 271 | ||
310 | /* Called with interrupts disabled */ | 272 | /* Called with interrupts disabled */ |
@@ -338,5 +300,5 @@ asmlinkage void do_software_break_point(unsigned long long vec, | |||
338 | */ | 300 | */ |
339 | void ptrace_disable(struct task_struct *child) | 301 | void ptrace_disable(struct task_struct *child) |
340 | { | 302 | { |
341 | /* nothing to do.. */ | 303 | user_disable_single_step(child); |
342 | } | 304 | } |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 6339d0c95715..a35207655e7b 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/smp.h> | 25 | #include <linux/smp.h> |
26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
27 | #include <linux/debugfs.h> | 27 | #include <linux/debugfs.h> |
28 | #include <linux/crash_dump.h> | ||
28 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
29 | #include <asm/io.h> | 30 | #include <asm/io.h> |
30 | #include <asm/page.h> | 31 | #include <asm/page.h> |
@@ -286,6 +287,25 @@ static void __init setup_memory(void) | |||
286 | extern void __init setup_memory(void); | 287 | extern void __init setup_memory(void); |
287 | #endif | 288 | #endif |
288 | 289 | ||
290 | /* | ||
291 | * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by | ||
292 | * is_kdump_kernel() to determine if we are booting after a panic. Hence | ||
293 | * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE. | ||
294 | */ | ||
295 | #ifdef CONFIG_CRASH_DUMP | ||
296 | /* elfcorehdr= specifies the location of elf core header | ||
297 | * stored by the crashed kernel. | ||
298 | */ | ||
299 | static int __init parse_elfcorehdr(char *arg) | ||
300 | { | ||
301 | if (!arg) | ||
302 | return -EINVAL; | ||
303 | elfcorehdr_addr = memparse(arg, &arg); | ||
304 | return 0; | ||
305 | } | ||
306 | early_param("elfcorehdr", parse_elfcorehdr); | ||
307 | #endif | ||
308 | |||
289 | void __init setup_arch(char **cmdline_p) | 309 | void __init setup_arch(char **cmdline_p) |
290 | { | 310 | { |
291 | enable_mmu(); | 311 | enable_mmu(); |
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c index 4bbbde895a53..51689d29ad45 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/binfmts.h> | 24 | #include <linux/binfmts.h> |
25 | #include <linux/freezer.h> | 25 | #include <linux/freezer.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/tracehook.h> | ||
27 | #include <asm/system.h> | 28 | #include <asm/system.h> |
28 | #include <asm/ucontext.h> | 29 | #include <asm/ucontext.h> |
29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
@@ -507,14 +508,13 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
507 | switch (regs->regs[0]) { | 508 | switch (regs->regs[0]) { |
508 | case -ERESTART_RESTARTBLOCK: | 509 | case -ERESTART_RESTARTBLOCK: |
509 | case -ERESTARTNOHAND: | 510 | case -ERESTARTNOHAND: |
511 | no_system_call_restart: | ||
510 | regs->regs[0] = -EINTR; | 512 | regs->regs[0] = -EINTR; |
511 | break; | 513 | break; |
512 | 514 | ||
513 | case -ERESTARTSYS: | 515 | case -ERESTARTSYS: |
514 | if (!(ka->sa.sa_flags & SA_RESTART)) { | 516 | if (!(ka->sa.sa_flags & SA_RESTART)) |
515 | regs->regs[0] = -EINTR; | 517 | goto no_system_call_restart; |
516 | break; | ||
517 | } | ||
518 | /* fallthrough */ | 518 | /* fallthrough */ |
519 | case -ERESTARTNOINTR: | 519 | case -ERESTARTNOINTR: |
520 | regs->regs[0] = save_r0; | 520 | regs->regs[0] = save_r0; |
@@ -589,12 +589,15 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) | |||
589 | * clear the TIF_RESTORE_SIGMASK flag */ | 589 | * clear the TIF_RESTORE_SIGMASK flag */ |
590 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 590 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
591 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 591 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
592 | |||
593 | tracehook_signal_handler(signr, &info, &ka, regs, | ||
594 | test_thread_flag(TIF_SINGLESTEP)); | ||
592 | } | 595 | } |
593 | 596 | ||
594 | return; | 597 | return; |
595 | } | 598 | } |
596 | 599 | ||
597 | no_signal: | 600 | no_signal: |
598 | /* Did we come from a system call? */ | 601 | /* Did we come from a system call? */ |
599 | if (regs->tra >= 0) { | 602 | if (regs->tra >= 0) { |
600 | /* Restart the system call - no handlers present */ | 603 | /* Restart the system call - no handlers present */ |
@@ -618,9 +621,14 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) | |||
618 | } | 621 | } |
619 | 622 | ||
620 | asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, | 623 | asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, |
621 | __u32 thread_info_flags) | 624 | unsigned long thread_info_flags) |
622 | { | 625 | { |
623 | /* deal with pending signal delivery */ | 626 | /* deal with pending signal delivery */ |
624 | if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) | 627 | if (thread_info_flags & _TIF_SIGPENDING) |
625 | do_signal(regs, save_r0); | 628 | do_signal(regs, save_r0); |
629 | |||
630 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | ||
631 | clear_thread_flag(TIF_NOTIFY_RESUME); | ||
632 | tracehook_notify_resume(regs); | ||
633 | } | ||
626 | } | 634 | } |
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c index 552eb810cd85..1d62dfef77f1 100644 --- a/arch/sh/kernel/signal_64.c +++ b/arch/sh/kernel/signal_64.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/ptrace.h> | 22 | #include <linux/ptrace.h> |
23 | #include <linux/unistd.h> | 23 | #include <linux/unistd.h> |
24 | #include <linux/stddef.h> | 24 | #include <linux/stddef.h> |
25 | #include <linux/tracehook.h> | ||
25 | #include <asm/ucontext.h> | 26 | #include <asm/ucontext.h> |
26 | #include <asm/uaccess.h> | 27 | #include <asm/uaccess.h> |
27 | #include <asm/pgtable.h> | 28 | #include <asm/pgtable.h> |
@@ -42,7 +43,84 @@ | |||
42 | 43 | ||
43 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 44 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
44 | 45 | ||
45 | asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset); | 46 | /* |
47 | * Note that 'init' is a special process: it doesn't get signals it doesn't | ||
48 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | ||
49 | * mistake. | ||
50 | * | ||
51 | * Note that we go through the signals twice: once to check the signals that | ||
52 | * the kernel can handle, and then we build all the user-level signal handling | ||
53 | * stack-frames in one go after that. | ||
54 | */ | ||
55 | static int do_signal(struct pt_regs *regs, sigset_t *oldset) | ||
56 | { | ||
57 | siginfo_t info; | ||
58 | int signr; | ||
59 | struct k_sigaction ka; | ||
60 | |||
61 | /* | ||
62 | * We want the common case to go fast, which | ||
63 | * is why we may in certain cases get here from | ||
64 | * kernel mode. Just return without doing anything | ||
65 | * if so. | ||
66 | */ | ||
67 | if (!user_mode(regs)) | ||
68 | return 1; | ||
69 | |||
70 | if (try_to_freeze()) | ||
71 | goto no_signal; | ||
72 | |||
73 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
74 | oldset = ¤t->saved_sigmask; | ||
75 | else if (!oldset) | ||
76 | oldset = ¤t->blocked; | ||
77 | |||
78 | signr = get_signal_to_deliver(&info, &ka, regs, 0); | ||
79 | |||
80 | if (signr > 0) { | ||
81 | /* Whee! Actually deliver the signal. */ | ||
82 | handle_signal(signr, &info, &ka, oldset, regs); | ||
83 | |||
84 | /* | ||
85 | * If a signal was successfully delivered, the saved sigmask | ||
86 | * is in its frame, and we can clear the TIF_RESTORE_SIGMASK | ||
87 | * flag. | ||
88 | */ | ||
89 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
90 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
91 | |||
92 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
93 | return 1; | ||
94 | } | ||
95 | |||
96 | no_signal: | ||
97 | /* Did we come from a system call? */ | ||
98 | if (regs->syscall_nr >= 0) { | ||
99 | /* Restart the system call - no handlers present */ | ||
100 | switch (regs->regs[REG_RET]) { | ||
101 | case -ERESTARTNOHAND: | ||
102 | case -ERESTARTSYS: | ||
103 | case -ERESTARTNOINTR: | ||
104 | /* Decode Syscall # */ | ||
105 | regs->regs[REG_RET] = regs->syscall_nr; | ||
106 | regs->pc -= 4; | ||
107 | break; | ||
108 | |||
109 | case -ERESTART_RESTARTBLOCK: | ||
110 | regs->regs[REG_RET] = __NR_restart_syscall; | ||
111 | regs->pc -= 4; | ||
112 | break; | ||
113 | } | ||
114 | } | ||
115 | |||
116 | /* No signal to deliver -- put the saved sigmask back */ | ||
117 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | ||
118 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
119 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
120 | } | ||
121 | |||
122 | return 0; | ||
123 | } | ||
46 | 124 | ||
47 | /* | 125 | /* |
48 | * Atomically swap in the new signal mask, and wait for a signal. | 126 | * Atomically swap in the new signal mask, and wait for a signal. |
@@ -643,14 +721,13 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
643 | switch (regs->regs[REG_RET]) { | 721 | switch (regs->regs[REG_RET]) { |
644 | case -ERESTART_RESTARTBLOCK: | 722 | case -ERESTART_RESTARTBLOCK: |
645 | case -ERESTARTNOHAND: | 723 | case -ERESTARTNOHAND: |
724 | no_system_call_restart: | ||
646 | regs->regs[REG_RET] = -EINTR; | 725 | regs->regs[REG_RET] = -EINTR; |
647 | break; | 726 | break; |
648 | 727 | ||
649 | case -ERESTARTSYS: | 728 | case -ERESTARTSYS: |
650 | if (!(ka->sa.sa_flags & SA_RESTART)) { | 729 | if (!(ka->sa.sa_flags & SA_RESTART)) |
651 | regs->regs[REG_RET] = -EINTR; | 730 | goto no_system_call_restart; |
652 | break; | ||
653 | } | ||
654 | /* fallthrough */ | 731 | /* fallthrough */ |
655 | case -ERESTARTNOINTR: | 732 | case -ERESTARTNOINTR: |
656 | /* Decode syscall # */ | 733 | /* Decode syscall # */ |
@@ -673,80 +750,13 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
673 | spin_unlock_irq(¤t->sighand->siglock); | 750 | spin_unlock_irq(¤t->sighand->siglock); |
674 | } | 751 | } |
675 | 752 | ||
676 | /* | 753 | asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) |
677 | * Note that 'init' is a special process: it doesn't get signals it doesn't | ||
678 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | ||
679 | * mistake. | ||
680 | * | ||
681 | * Note that we go through the signals twice: once to check the signals that | ||
682 | * the kernel can handle, and then we build all the user-level signal handling | ||
683 | * stack-frames in one go after that. | ||
684 | */ | ||
685 | int do_signal(struct pt_regs *regs, sigset_t *oldset) | ||
686 | { | 754 | { |
687 | siginfo_t info; | 755 | if (thread_info_flags & _TIF_SIGPENDING) |
688 | int signr; | 756 | do_signal(regs, 0); |
689 | struct k_sigaction ka; | ||
690 | |||
691 | /* | ||
692 | * We want the common case to go fast, which | ||
693 | * is why we may in certain cases get here from | ||
694 | * kernel mode. Just return without doing anything | ||
695 | * if so. | ||
696 | */ | ||
697 | if (!user_mode(regs)) | ||
698 | return 1; | ||
699 | |||
700 | if (try_to_freeze()) | ||
701 | goto no_signal; | ||
702 | |||
703 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
704 | oldset = ¤t->saved_sigmask; | ||
705 | else if (!oldset) | ||
706 | oldset = ¤t->blocked; | ||
707 | |||
708 | signr = get_signal_to_deliver(&info, &ka, regs, 0); | ||
709 | |||
710 | if (signr > 0) { | ||
711 | /* Whee! Actually deliver the signal. */ | ||
712 | handle_signal(signr, &info, &ka, oldset, regs); | ||
713 | 757 | ||
714 | /* | 758 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
715 | * If a signal was successfully delivered, the saved sigmask | 759 | clear_thread_flag(TIF_NOTIFY_RESUME); |
716 | * is in its frame, and we can clear the TIF_RESTORE_SIGMASK | 760 | tracehook_notify_resume(regs); |
717 | * flag. | ||
718 | */ | ||
719 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
720 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
721 | |||
722 | return 1; | ||
723 | } | 761 | } |
724 | |||
725 | no_signal: | ||
726 | /* Did we come from a system call? */ | ||
727 | if (regs->syscall_nr >= 0) { | ||
728 | /* Restart the system call - no handlers present */ | ||
729 | switch (regs->regs[REG_RET]) { | ||
730 | case -ERESTARTNOHAND: | ||
731 | case -ERESTARTSYS: | ||
732 | case -ERESTARTNOINTR: | ||
733 | /* Decode Syscall # */ | ||
734 | regs->regs[REG_RET] = regs->syscall_nr; | ||
735 | regs->pc -= 4; | ||
736 | break; | ||
737 | |||
738 | case -ERESTART_RESTARTBLOCK: | ||
739 | regs->regs[REG_RET] = __NR_restart_syscall; | ||
740 | regs->pc -= 4; | ||
741 | break; | ||
742 | } | ||
743 | } | ||
744 | |||
745 | /* No signal to deliver -- put the saved sigmask back */ | ||
746 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | ||
747 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
748 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
749 | } | ||
750 | |||
751 | return 0; | ||
752 | } | 762 | } |
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 56d0a7daa34b..9c131cac91a4 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig | |||
@@ -237,7 +237,6 @@ choice | |||
237 | 237 | ||
238 | config CACHE_WRITEBACK | 238 | config CACHE_WRITEBACK |
239 | bool "Write-back" | 239 | bool "Write-back" |
240 | depends on CPU_SH2A || CPU_SH3 || CPU_SH4 || CPU_SH5 | ||
241 | 240 | ||
242 | config CACHE_WRITETHROUGH | 241 | config CACHE_WRITETHROUGH |
243 | bool "Write-through" | 242 | bool "Write-through" |
diff --git a/arch/sh/mm/Makefile_32 b/arch/sh/mm/Makefile_32 index e295db60b91b..70e0906023cc 100644 --- a/arch/sh/mm/Makefile_32 +++ b/arch/sh/mm/Makefile_32 | |||
@@ -5,12 +5,15 @@ | |||
5 | obj-y := init.o extable_32.o consistent.o | 5 | obj-y := init.o extable_32.o consistent.o |
6 | 6 | ||
7 | ifndef CONFIG_CACHE_OFF | 7 | ifndef CONFIG_CACHE_OFF |
8 | obj-$(CONFIG_CPU_SH2) += cache-sh2.o | 8 | cache-$(CONFIG_CPU_SH2) := cache-sh2.o |
9 | obj-$(CONFIG_CPU_SH3) += cache-sh3.o | 9 | cache-$(CONFIG_CPU_SH2A) := cache-sh2a.o |
10 | obj-$(CONFIG_CPU_SH4) += cache-sh4.o | 10 | cache-$(CONFIG_CPU_SH3) := cache-sh3.o |
11 | obj-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o | 11 | cache-$(CONFIG_CPU_SH4) := cache-sh4.o |
12 | cache-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o | ||
12 | endif | 13 | endif |
13 | 14 | ||
15 | obj-y += $(cache-y) | ||
16 | |||
14 | mmu-y := tlb-nommu.o pg-nommu.o | 17 | mmu-y := tlb-nommu.o pg-nommu.o |
15 | mmu-$(CONFIG_MMU) := fault_32.o tlbflush_32.o ioremap_32.o | 18 | mmu-$(CONFIG_MMU) := fault_32.o tlbflush_32.o ioremap_32.o |
16 | 19 | ||
diff --git a/arch/sh/mm/cache-sh2.c b/arch/sh/mm/cache-sh2.c index 6614033f6be9..c4e80d2b764b 100644 --- a/arch/sh/mm/cache-sh2.c +++ b/arch/sh/mm/cache-sh2.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * arch/sh/mm/cache-sh2.c | 2 | * arch/sh/mm/cache-sh2.c |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Paul Mundt | 4 | * Copyright (C) 2002 Paul Mundt |
5 | * Copyright (C) 2008 Yoshinori Sato | ||
5 | * | 6 | * |
6 | * Released under the terms of the GNU GPL v2.0. | 7 | * Released under the terms of the GNU GPL v2.0. |
7 | */ | 8 | */ |
@@ -24,8 +25,15 @@ void __flush_wback_region(void *start, int size) | |||
24 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) | 25 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) |
25 | & ~(L1_CACHE_BYTES-1); | 26 | & ~(L1_CACHE_BYTES-1); |
26 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { | 27 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { |
27 | /* FIXME cache purge */ | 28 | unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0); |
28 | ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); | 29 | int way; |
30 | for (way = 0; way < 4; way++) { | ||
31 | unsigned long data = ctrl_inl(addr | (way << 12)); | ||
32 | if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { | ||
33 | data &= ~SH_CACHE_UPDATED; | ||
34 | ctrl_outl(data, addr | (way << 12)); | ||
35 | } | ||
36 | } | ||
29 | } | 37 | } |
30 | } | 38 | } |
31 | 39 | ||
@@ -37,21 +45,40 @@ void __flush_purge_region(void *start, int size) | |||
37 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); | 45 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); |
38 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) | 46 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) |
39 | & ~(L1_CACHE_BYTES-1); | 47 | & ~(L1_CACHE_BYTES-1); |
40 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { | 48 | |
41 | ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); | 49 | for (v = begin; v < end; v+=L1_CACHE_BYTES) |
42 | } | 50 | ctrl_outl((v & CACHE_PHYSADDR_MASK), |
51 | CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); | ||
43 | } | 52 | } |
44 | 53 | ||
45 | void __flush_invalidate_region(void *start, int size) | 54 | void __flush_invalidate_region(void *start, int size) |
46 | { | 55 | { |
56 | #ifdef CONFIG_CACHE_WRITEBACK | ||
57 | /* | ||
58 | * SH-2 does not support individual line invalidation, only a | ||
59 | * global invalidate. | ||
60 | */ | ||
61 | unsigned long ccr; | ||
62 | unsigned long flags; | ||
63 | local_irq_save(flags); | ||
64 | jump_to_uncached(); | ||
65 | |||
66 | ccr = ctrl_inl(CCR); | ||
67 | ccr |= CCR_CACHE_INVALIDATE; | ||
68 | ctrl_outl(ccr, CCR); | ||
69 | |||
70 | back_to_cached(); | ||
71 | local_irq_restore(flags); | ||
72 | #else | ||
47 | unsigned long v; | 73 | unsigned long v; |
48 | unsigned long begin, end; | 74 | unsigned long begin, end; |
49 | 75 | ||
50 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); | 76 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); |
51 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) | 77 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) |
52 | & ~(L1_CACHE_BYTES-1); | 78 | & ~(L1_CACHE_BYTES-1); |
53 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { | ||
54 | ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); | ||
55 | } | ||
56 | } | ||
57 | 79 | ||
80 | for (v = begin; v < end; v+=L1_CACHE_BYTES) | ||
81 | ctrl_outl((v & CACHE_PHYSADDR_MASK), | ||
82 | CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); | ||
83 | #endif | ||
84 | } | ||
diff --git a/arch/sh/mm/cache-sh2a.c b/arch/sh/mm/cache-sh2a.c new file mode 100644 index 000000000000..62c0c5f35120 --- /dev/null +++ b/arch/sh/mm/cache-sh2a.c | |||
@@ -0,0 +1,129 @@ | |||
1 | /* | ||
2 | * arch/sh/mm/cache-sh2a.c | ||
3 | * | ||
4 | * Copyright (C) 2008 Yoshinori Sato | ||
5 | * | ||
6 | * Released under the terms of the GNU GPL v2.0. | ||
7 | */ | ||
8 | |||
9 | #include <linux/init.h> | ||
10 | #include <linux/mm.h> | ||
11 | |||
12 | #include <asm/cache.h> | ||
13 | #include <asm/addrspace.h> | ||
14 | #include <asm/processor.h> | ||
15 | #include <asm/cacheflush.h> | ||
16 | #include <asm/io.h> | ||
17 | |||
18 | void __flush_wback_region(void *start, int size) | ||
19 | { | ||
20 | unsigned long v; | ||
21 | unsigned long begin, end; | ||
22 | unsigned long flags; | ||
23 | |||
24 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); | ||
25 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) | ||
26 | & ~(L1_CACHE_BYTES-1); | ||
27 | |||
28 | local_irq_save(flags); | ||
29 | jump_to_uncached(); | ||
30 | |||
31 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { | ||
32 | unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0); | ||
33 | int way; | ||
34 | for (way = 0; way < 4; way++) { | ||
35 | unsigned long data = ctrl_inl(addr | (way << 11)); | ||
36 | if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { | ||
37 | data &= ~SH_CACHE_UPDATED; | ||
38 | ctrl_outl(data, addr | (way << 11)); | ||
39 | } | ||
40 | } | ||
41 | } | ||
42 | |||
43 | back_to_cached(); | ||
44 | local_irq_restore(flags); | ||
45 | } | ||
46 | |||
47 | void __flush_purge_region(void *start, int size) | ||
48 | { | ||
49 | unsigned long v; | ||
50 | unsigned long begin, end; | ||
51 | unsigned long flags; | ||
52 | |||
53 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); | ||
54 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) | ||
55 | & ~(L1_CACHE_BYTES-1); | ||
56 | |||
57 | local_irq_save(flags); | ||
58 | jump_to_uncached(); | ||
59 | |||
60 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { | ||
61 | ctrl_outl((v & CACHE_PHYSADDR_MASK), | ||
62 | CACHE_OC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); | ||
63 | } | ||
64 | back_to_cached(); | ||
65 | local_irq_restore(flags); | ||
66 | } | ||
67 | |||
68 | void __flush_invalidate_region(void *start, int size) | ||
69 | { | ||
70 | unsigned long v; | ||
71 | unsigned long begin, end; | ||
72 | unsigned long flags; | ||
73 | |||
74 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); | ||
75 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) | ||
76 | & ~(L1_CACHE_BYTES-1); | ||
77 | local_irq_save(flags); | ||
78 | jump_to_uncached(); | ||
79 | |||
80 | #ifdef CONFIG_CACHE_WRITEBACK | ||
81 | ctrl_outl(ctrl_inl(CCR) | CCR_OCACHE_INVALIDATE, CCR); | ||
82 | /* I-cache invalidate */ | ||
83 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { | ||
84 | ctrl_outl((v & CACHE_PHYSADDR_MASK), | ||
85 | CACHE_IC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); | ||
86 | } | ||
87 | #else | ||
88 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { | ||
89 | ctrl_outl((v & CACHE_PHYSADDR_MASK), | ||
90 | CACHE_IC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); | ||
91 | ctrl_outl((v & CACHE_PHYSADDR_MASK), | ||
92 | CACHE_OC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); | ||
93 | } | ||
94 | #endif | ||
95 | back_to_cached(); | ||
96 | local_irq_restore(flags); | ||
97 | } | ||
98 | |||
99 | /* WBack O-Cache and flush I-Cache */ | ||
100 | void flush_icache_range(unsigned long start, unsigned long end) | ||
101 | { | ||
102 | unsigned long v; | ||
103 | unsigned long flags; | ||
104 | |||
105 | start = start & ~(L1_CACHE_BYTES-1); | ||
106 | end = (end + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); | ||
107 | |||
108 | local_irq_save(flags); | ||
109 | jump_to_uncached(); | ||
110 | |||
111 | for (v = start; v < end; v+=L1_CACHE_BYTES) { | ||
112 | unsigned long addr = (v & 0x000007f0); | ||
113 | int way; | ||
114 | /* O-Cache writeback */ | ||
115 | for (way = 0; way < 4; way++) { | ||
116 | unsigned long data = ctrl_inl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11)); | ||
117 | if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { | ||
118 | data &= ~SH_CACHE_UPDATED; | ||
119 | ctrl_outl(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11)); | ||
120 | } | ||
121 | } | ||
122 | /* I-Cache invalidate */ | ||
123 | ctrl_outl(addr, | ||
124 | CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008); | ||
125 | } | ||
126 | |||
127 | back_to_cached(); | ||
128 | local_irq_restore(flags); | ||
129 | } | ||
diff --git a/arch/sh/mm/tlb-sh5.c b/arch/sh/mm/tlb-sh5.c index f34274a1ded3..dae131243bcc 100644 --- a/arch/sh/mm/tlb-sh5.c +++ b/arch/sh/mm/tlb-sh5.c | |||
@@ -15,9 +15,7 @@ | |||
15 | #include <asm/mmu_context.h> | 15 | #include <asm/mmu_context.h> |
16 | 16 | ||
17 | /** | 17 | /** |
18 | * sh64_tlb_init | 18 | * sh64_tlb_init - Perform initial setup for the DTLB and ITLB. |
19 | * | ||
20 | * Perform initial setup for the DTLB and ITLB. | ||
21 | */ | 19 | */ |
22 | int __init sh64_tlb_init(void) | 20 | int __init sh64_tlb_init(void) |
23 | { | 21 | { |
@@ -46,9 +44,7 @@ int __init sh64_tlb_init(void) | |||
46 | } | 44 | } |
47 | 45 | ||
48 | /** | 46 | /** |
49 | * sh64_next_free_dtlb_entry | 47 | * sh64_next_free_dtlb_entry - Find the next available DTLB entry |
50 | * | ||
51 | * Find the next available DTLB entry | ||
52 | */ | 48 | */ |
53 | unsigned long long sh64_next_free_dtlb_entry(void) | 49 | unsigned long long sh64_next_free_dtlb_entry(void) |
54 | { | 50 | { |
@@ -56,9 +52,7 @@ unsigned long long sh64_next_free_dtlb_entry(void) | |||
56 | } | 52 | } |
57 | 53 | ||
58 | /** | 54 | /** |
59 | * sh64_get_wired_dtlb_entry | 55 | * sh64_get_wired_dtlb_entry - Allocate a wired (locked-in) entry in the DTLB |
60 | * | ||
61 | * Allocate a wired (locked-in) entry in the DTLB | ||
62 | */ | 56 | */ |
63 | unsigned long long sh64_get_wired_dtlb_entry(void) | 57 | unsigned long long sh64_get_wired_dtlb_entry(void) |
64 | { | 58 | { |
@@ -71,12 +65,10 @@ unsigned long long sh64_get_wired_dtlb_entry(void) | |||
71 | } | 65 | } |
72 | 66 | ||
73 | /** | 67 | /** |
74 | * sh64_put_wired_dtlb_entry | 68 | * sh64_put_wired_dtlb_entry - Free a wired (locked-in) entry in the DTLB. |
75 | * | 69 | * |
76 | * @entry: Address of TLB slot. | 70 | * @entry: Address of TLB slot. |
77 | * | 71 | * |
78 | * Free a wired (locked-in) entry in the DTLB. | ||
79 | * | ||
80 | * Works like a stack, last one to allocate must be first one to free. | 72 | * Works like a stack, last one to allocate must be first one to free. |
81 | */ | 73 | */ |
82 | int sh64_put_wired_dtlb_entry(unsigned long long entry) | 74 | int sh64_put_wired_dtlb_entry(unsigned long long entry) |
@@ -115,7 +107,7 @@ int sh64_put_wired_dtlb_entry(unsigned long long entry) | |||
115 | } | 107 | } |
116 | 108 | ||
117 | /** | 109 | /** |
118 | * sh64_setup_tlb_slot | 110 | * sh64_setup_tlb_slot - Load up a translation in a wired slot. |
119 | * | 111 | * |
120 | * @config_addr: Address of TLB slot. | 112 | * @config_addr: Address of TLB slot. |
121 | * @eaddr: Virtual address. | 113 | * @eaddr: Virtual address. |
@@ -154,7 +146,7 @@ inline void sh64_setup_tlb_slot(unsigned long long config_addr, | |||
154 | } | 146 | } |
155 | 147 | ||
156 | /** | 148 | /** |
157 | * sh64_teardown_tlb_slot | 149 | * sh64_teardown_tlb_slot - Teardown a translation. |
158 | * | 150 | * |
159 | * @config_addr: Address of TLB slot. | 151 | * @config_addr: Address of TLB slot. |
160 | * | 152 | * |
diff --git a/arch/sh/tools/Makefile b/arch/sh/tools/Makefile index b5d202be8206..567516b58acc 100644 --- a/arch/sh/tools/Makefile +++ b/arch/sh/tools/Makefile | |||
@@ -10,7 +10,7 @@ | |||
10 | # Shamelessly cloned from ARM. | 10 | # Shamelessly cloned from ARM. |
11 | # | 11 | # |
12 | 12 | ||
13 | arch/sh/include/asm/machtypes.h: $(src)/gen-mach-types $(src)/mach-types | 13 | include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types |
14 | @echo ' Generating $@' | 14 | @echo ' Generating $@' |
15 | $(Q)if [ ! -d arch/sh/include/asm ]; then mkdir -p arch/sh/include/asm; fi | 15 | $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi |
16 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } | 16 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } |