History

exit_thread: remove empty bodies

Define HAVE_EXIT_THREAD for archs which want to do something in exit_thread. For others, let's define exit_thread as an empty inline. This is a cleanup before we change the prototype of exit_thread to accept a task parameter. [akpm@linux-foundation.org: fix mips] Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: "David S. Miller" <davem@davemloft.net> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chen Liqin <liqin.linux@gmail.com> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Chris Zankel <chris@zankel.net> Cc: David Howells <dhowells@redhat.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Helge Deller <deller@gmx.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: James Hogan <james.hogan@imgtec.com> Cc: Jeff Dike <jdike@addtoit.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Jonas Bonn <jonas@southpole.se> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Cc: Lennox Wu <lennox.wu@gmail.com> Cc: Ley Foon Tan <lftan@altera.com> Cc: Mark Salter <msalter@redhat.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Matt Turner <mattst88@gmail.com> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Simek <monstr@monstr.eu> Cc: Mikael Starvik <starvik@axis.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Rich Felker <dalias@libc.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Richard Weinberger <richard@nod.at> Cc: Russell King <linux@arm.linux.org.uk> Cc: Steven Miao <realmz6@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Jiri Slaby committed 10 years ago

Commit 5f56a5d1 parent 2ec656e36 files · +24 −140Browse files

Unified · Split

36 files
  1. arch/Kconfig +5 −0
  2. arch/alpha/kernel/process.c +0 −8
  3. arch/arc/kernel/process.c +0 −7
  4. arch/arm/Kconfig +1 −0
  5. arch/arm64/kernel/process.c +0 −7
  6. arch/avr32/Kconfig +1 −0
  7. arch/blackfin/include/asm/processor.h +0 −7
  8. arch/c6x/kernel/process.c +0 −4
  9. arch/cris/Kconfig +1 −0
  10. arch/cris/arch-v10/kernel/process.c +0 −9
  11. arch/frv/include/asm/processor.h +0 −7
  12. arch/h8300/include/asm/processor.h +0 −7
  13. arch/hexagon/kernel/process.c +0 −7
  14. arch/ia64/Kconfig +1 −0
  15. arch/m32r/kernel/process.c +0 −9
  16. arch/m68k/include/asm/processor.h +0 −7
  17. arch/metag/Kconfig +1 −0
  18. arch/metag/include/asm/processor.h +0 −2
  19. arch/microblaze/include/asm/processor.h +0 −10
  20. arch/mips/kernel/process.c +0 −4
  21. arch/mn10300/Kconfig +1 −0
  22. arch/nios2/include/asm/processor.h +0 −5
  23. arch/openrisc/include/asm/processor.h +0 −9
  24. arch/parisc/kernel/process.c +0 −7
  25. arch/powerpc/kernel/process.c +0 −4
  26. arch/s390/Kconfig +1 −0
  27. arch/score/kernel/process.c +0 −2
  28. arch/sh/Kconfig +1 −0
  29. arch/sh/kernel/process_32.c +0 −7
  30. arch/sparc/Kconfig +1 −0
  31. arch/tile/Kconfig +1 −0
  32. arch/um/kernel/process.c +0 −4
  33. arch/unicore32/kernel/process.c +0 −7
  34. arch/x86/Kconfig +1 −0
  35. arch/xtensa/Kconfig +1 −0
  36. include/linux/sched.h +7 −0
arch/Kconfig+5−0
@@ -517,6 +517,11 @@ config HAVE_ARCH_MMAP_RND_BITS · 516 unmodified lines
517517 - ARCH_MMAP_RND_BITS_MIN
518518 - ARCH_MMAP_RND_BITS_MAX
519519
520+config HAVE_EXIT_THREAD
521+ bool
522+ help
523+ An architecture implements exit_thread.
524+
520525 config ARCH_MMAP_RND_BITS_MIN
521526 int
522527
arch/alpha/kernel/process.c+0−8
@@ -210,14 +210,6 @@ start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) · 209 unmodified lines
210210 }
211211 EXPORT_SYMBOL(start_thread);
212212
213−/*
214− * Free current thread data structures etc..
215− */
216−void
217−exit_thread(void)
218−{
219−}
220−
221213 void
222214 flush_thread(void)
223215 {
arch/arc/kernel/process.c+0−7
@@ -183,13 +183,6 @@ void flush_thread(void) · 182 unmodified lines
183183 {
184184 }
185185
186−/*
187− * Free any architecture-specific thread data structures, etc.
188− */
189−void exit_thread(void)
190−{
191−}
192−
193186 int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
194187 {
195188 return 0;
arch/arm/Kconfig+1−0
@@ -50,6 +50,7 @@ config ARM · 49 unmodified lines
5050 select HAVE_DMA_CONTIGUOUS if MMU
5151 select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU
5252 select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
53+ select HAVE_EXIT_THREAD
5354 select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
5455 select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
5556 select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
arch/arm64/kernel/process.c+0−7
@@ -200,13 +200,6 @@ void show_regs(struct pt_regs * regs) · 199 unmodified lines
200200 __show_regs(regs);
201201 }
202202
203−/*
204− * Free current thread data structures etc..
205− */
206−void exit_thread(void)
207−{
208−}
209−
210203 static void tls_thread_flush(void)
211204 {
212205 asm ("msr tpidr_el0, xzr");
arch/avr32/Kconfig+1−0
@@ -4,6 +4,7 @@ config AVR32 · 3 unmodified lines
44 # that we usually don't need on AVR32.
55 select EXPERT
66 select HAVE_CLK
7+ select HAVE_EXIT_THREAD
78 select HAVE_OPROFILE
89 select HAVE_KPROBES
910 select VIRT_TO_BUS
arch/blackfin/include/asm/processor.h+0−7
@@ -75,13 +75,6 @@ static inline void release_thread(struct task_struct *dead_task) · 74 unmodified lines
7575 {
7676 }
7777
78−/*
79− * Free current thread data structures etc..
80− */
81−static inline void exit_thread(void)
82−{
83−}
84−
8578 /*
8679 * Return saved PC of a blocked thread.
8780 */
arch/c6x/kernel/process.c+0−4
@@ -82,10 +82,6 @@ void flush_thread(void) · 81 unmodified lines
8282 {
8383 }
8484
85−void exit_thread(void)
86−{
87−}
88−
8985 /*
9086 * Do necessary setup to start up a newly executed thread.
9187 */
arch/cris/Kconfig+1−0
@@ -59,6 +59,7 @@ config CRIS · 58 unmodified lines
5959 select GENERIC_IOMAP
6060 select MODULES_USE_ELF_RELA
6161 select CLONE_BACKWARDS2
62+ select HAVE_EXIT_THREAD if ETRAX_ARCH_V32
6263 select OLD_SIGSUSPEND
6364 select OLD_SIGACTION
6465 select GPIOLIB
arch/cris/arch-v10/kernel/process.c+0−9
@@ -35,15 +35,6 @@ void default_idle(void) · 34 unmodified lines
3535 local_irq_enable();
3636 }
3737
38−/*
39− * Free current thread data structures etc..
40− */
41−
42−void exit_thread(void)
43−{
44− /* Nothing needs to be done. */
45−}
46−
4738 /* if the watchdog is enabled, we can simply disable interrupts and go
4839 * into an eternal loop, and the watchdog will reset the CPU after 0.1s
4940 * if on the other hand the watchdog wasn't enabled, we just enable it and wait
arch/frv/include/asm/processor.h+0−7
@@ -96,13 +96,6 @@ extern asmlinkage void *restore_user_regs(const struct user_context *target, ... · 95 unmodified lines
9696 #define release_segments(mm) do { } while (0)
9797 #define forget_segments() do { } while (0)
9898
99−/*
100− * Free current thread data structures etc..
101− */
102−static inline void exit_thread(void)
103−{
104−}
105−
10699 /*
107100 * Return saved PC of a blocked thread.
108101 */
arch/h8300/include/asm/processor.h+0−7
@@ -110,13 +110,6 @@ static inline void release_thread(struct task_struct *dead_task) · 109 unmodified lines
110110 {
111111 }
112112
113−/*
114− * Free current thread data structures etc..
115− */
116−static inline void exit_thread(void)
117−{
118−}
119−
120113 /*
121114 * Return saved PC of a blocked thread.
122115 */
arch/hexagon/kernel/process.c+0−7
@@ -136,13 +136,6 @@ void release_thread(struct task_struct *dead_task) · 135 unmodified lines
136136 {
137137 }
138138
139−/*
140− * Free any architecture-specific thread data structures, etc.
141− */
142−void exit_thread(void)
143−{
144−}
145−
146139 /*
147140 * Some archs flush debug and FPU info here
148141 */
arch/ia64/Kconfig+1−0
@@ -18,6 +18,7 @@ config IA64 · 17 unmodified lines
1818 select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
1919 select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
2020 select HAVE_UNSTABLE_SCHED_CLOCK
21+ select HAVE_EXIT_THREAD
2122 select HAVE_IDE
2223 select HAVE_OPROFILE
2324 select HAVE_KPROBES
arch/m32r/kernel/process.c+0−9
@@ -101,15 +101,6 @@ void show_regs(struct pt_regs * regs) · 100 unmodified lines
101101 #endif
102102 }
103103
104−/*
105− * Free current thread data structures etc..
106− */
107−void exit_thread(void)
108−{
109− /* Nothing to do. */
110− DPRINTK("pid = %d\n", current->pid);
111−}
112−
113104 void flush_thread(void)
114105 {
115106 DPRINTK("pid = %d\n", current->pid);
arch/m68k/include/asm/processor.h+0−7
@@ -153,13 +153,6 @@ static inline void release_thread(struct task_struct *dead_task) · 152 unmodified lines
153153 {
154154 }
155155
156−/*
157− * Free current thread data structures etc..
158− */
159−static inline void exit_thread(void)
160−{
161−}
162−
163156 extern unsigned long thread_saved_pc(struct task_struct *tsk);
164157
165158 unsigned long get_wchan(struct task_struct *p);
arch/metag/Kconfig+1−0
@@ -11,6 +11,7 @@ config METAG · 10 unmodified lines
1111 select HAVE_DEBUG_KMEMLEAK
1212 select HAVE_DEBUG_STACKOVERFLOW
1313 select HAVE_DYNAMIC_FTRACE
14+ select HAVE_EXIT_THREAD
1415 select HAVE_FTRACE_MCOUNT_RECORD
1516 select HAVE_FUNCTION_TRACER
1617 select HAVE_KERNEL_BZIP2
arch/metag/include/asm/processor.h+0−2
@@ -134,8 +134,6 @@ static inline void release_thread(struct task_struct *dead_task) · 133 unmodified lines
134134 #define copy_segments(tsk, mm) do { } while (0)
135135 #define release_segments(mm) do { } while (0)
136136
137−extern void exit_thread(void);
138−
139137 /*
140138 * Return saved PC of a blocked thread.
141139 */
arch/microblaze/include/asm/processor.h+0−10
@@ -70,11 +70,6 @@ static inline void release_thread(struct task_struct *dead_task) · 69 unmodified lines
7070 {
7171 }
7272
73−/* Free all resources held by a thread. */
74−static inline void exit_thread(void)
75−{
76−}
77−
7873 extern unsigned long thread_saved_pc(struct task_struct *t);
7974
8075 extern unsigned long get_wchan(struct task_struct *p);
@@ -127,11 +122,6 @@ static inline void release_thread(struct task_struct *dead_task) · 46 unmodified lines
127122 {
128123 }
129124
130−/* Free current thread data structures etc. */
131−static inline void exit_thread(void)
132−{
133−}
134−
135125 /* Return saved (kernel) PC of a blocked thread. */
136126 # define thread_saved_pc(tsk) \
137127 ((tsk)->thread.regs ? (tsk)->thread.regs->r15 : 0)
arch/mips/kernel/process.c+0−4
@@ -73,10 +73,6 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) · 72 unmodified lines
7373 regs->regs[29] = sp;
7474 }
7575
76−void exit_thread(void)
77−{
78−}
79−
8076 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
8177 {
8278 /*
arch/mn10300/Kconfig+1−0
@@ -1,5 +1,6 @@
11 config MN10300
22 def_bool y
3+ select HAVE_EXIT_THREAD
34 select HAVE_OPROFILE
45 select HAVE_UID16
56 select GENERIC_IRQ_SHOW
arch/nios2/include/asm/processor.h+0−5
@@ -75,11 +75,6 @@ static inline void release_thread(struct task_struct *dead_task) · 74 unmodified lines
7575 {
7676 }
7777
78−/* Free current thread data structures etc.. */
79−static inline void exit_thread(void)
80−{
81−}
82−
8378 /* Return saved PC of a blocked thread. */
8479 #define thread_saved_pc(tsk) ((tsk)->thread.kregs->ea)
8580
arch/openrisc/include/asm/processor.h+0−9
@@ -84,15 +84,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp); · 83 unmodified lines
8484 void release_thread(struct task_struct *);
8585 unsigned long get_wchan(struct task_struct *p);
8686
87−/*
88− * Free current thread data structures etc..
89− */
90−
91−extern inline void exit_thread(void)
92−{
93− /* Nothing needs to be done. */
94−}
95−
9687 /*
9788 * Return saved PC of a blocked thread. For now, this is the "user" PC
9889 */
arch/parisc/kernel/process.c+0−7
@@ -144,13 +144,6 @@ void machine_power_off(void) · 143 unmodified lines
144144 void (*pm_power_off)(void) = machine_power_off;
145145 EXPORT_SYMBOL(pm_power_off);
146146
147−/*
148− * Free current thread data structures etc..
149− */
150−void exit_thread(void)
151−{
152−}
153−
154147 void flush_thread(void)
155148 {
156149 /* Only needs to handle fpu stuff or perf monitors.
arch/powerpc/kernel/process.c+0−4
@@ -1329,10 +1329,6 @@ void show_regs(struct pt_regs * regs) · 1328 unmodified lines
13291329 show_instructions(regs);
13301330 }
13311331
1332−void exit_thread(void)
1333−{
1334−}
1335−
13361332 void flush_thread(void)
13371333 {
13381334 #ifdef CONFIG_HAVE_HW_BREAKPOINT
arch/s390/Kconfig+1−0
@@ -134,6 +134,7 @@ config S390 · 133 unmodified lines
134134 select HAVE_DMA_API_DEBUG
135135 select HAVE_DYNAMIC_FTRACE
136136 select HAVE_DYNAMIC_FTRACE_WITH_REGS
137+ select HAVE_EXIT_THREAD
137138 select HAVE_FTRACE_MCOUNT_RECORD
138139 select HAVE_FUNCTION_GRAPH_TRACER
139140 select HAVE_FUNCTION_TRACER
arch/score/kernel/process.c+0−2
@@ -56,8 +56,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) · 55 unmodified lines
5656 regs->regs[0] = sp;
5757 }
5858
59−void exit_thread(void) {}
60−
6159 /*
6260 * When a process does an "exec", machine state like FPU and debug
6361 * registers need to be reset. This is a hook function for that.
arch/sh/Kconfig+1−0
@@ -71,6 +71,7 @@ config SUPERH32 · 70 unmodified lines
7171
7272 config SUPERH64
7373 def_bool ARCH = "sh64"
74+ select HAVE_EXIT_THREAD
7475 select KALLSYMS
7576
7677 config ARCH_DEFCONFIG
arch/sh/kernel/process_32.c+0−7
@@ -76,13 +76,6 @@ void start_thread(struct pt_regs *regs, unsigned long new_pc, · 75 unmodified lines
7676 }
7777 EXPORT_SYMBOL(start_thread);
7878
79−/*
80− * Free current thread data structures etc..
81− */
82−void exit_thread(void)
83−{
84−}
85−
8679 void flush_thread(void)
8780 {
8881 struct task_struct *tsk = current;
arch/sparc/Kconfig+1−0
@@ -20,6 +20,7 @@ config SPARC · 19 unmodified lines
2020 select HAVE_OPROFILE
2121 select HAVE_ARCH_KGDB if !SMP || SPARC64
2222 select HAVE_ARCH_TRACEHOOK
23+ select HAVE_EXIT_THREAD
2324 select SYSCTL_EXCEPTION_TRACE
2425 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
2526 select RTC_CLASS
arch/tile/Kconfig+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33
44 config TILE
55 def_bool y
6+ select HAVE_EXIT_THREAD
67 select HAVE_PERF_EVENTS
78 select USE_PMC if PERF_EVENTS
89 select HAVE_DMA_API_DEBUG
arch/um/kernel/process.c+0−4
@@ -103,10 +103,6 @@ void interrupt_end(void) · 102 unmodified lines
103103 tracehook_notify_resume(regs);
104104 }
105105
106−void exit_thread(void)
107−{
108−}
109−
110106 int get_current_pid(void)
111107 {
112108 return task_pid_nr(current);
arch/unicore32/kernel/process.c+0−7
@@ -201,13 +201,6 @@ void show_regs(struct pt_regs *regs) · 200 unmodified lines
201201 __backtrace();
202202 }
203203
204−/*
205− * Free current thread data structures etc..
206− */
207−void exit_thread(void)
208−{
209−}
210−
211204 void flush_thread(void)
212205 {
213206 struct thread_info *thread = current_thread_info();
arch/x86/Kconfig+1−0
@@ -105,6 +105,7 @@ config X86 · 104 unmodified lines
105105 select HAVE_DYNAMIC_FTRACE
106106 select HAVE_DYNAMIC_FTRACE_WITH_REGS
107107 select HAVE_EFFICIENT_UNALIGNED_ACCESS
108+ select HAVE_EXIT_THREAD
108109 select HAVE_FENTRY if X86_64
109110 select HAVE_FTRACE_MCOUNT_RECORD
110111 select HAVE_FUNCTION_GRAPH_FP_TEST
arch/xtensa/Kconfig+1−0
@@ -14,6 +14,7 @@ config XTENSA · 13 unmodified lines
1414 select GENERIC_PCI_IOMAP
1515 select GENERIC_SCHED_CLOCK
1616 select HAVE_DMA_API_DEBUG
17+ select HAVE_EXIT_THREAD
1718 select HAVE_FUNCTION_TRACER
1819 select HAVE_FUTEX_CMPXCHG if !MMU
1920 select HAVE_HW_BREAKPOINT if PERF_EVENTS
include/linux/sched.h+7−0
@@ -2769,7 +2769,14 @@ static inline int copy_thread_tls( · 2768 unmodified lines
27692769 }
27702770 #endif
27712771 extern void flush_thread(void);
2772+
2773+#ifdef CONFIG_HAVE_EXIT_THREAD
27722774 extern void exit_thread(void);
2775+#else
2776+static inline void exit_thread(void)
2777+{
2778+}
2779+#endif
27732780
27742781 extern void exit_files(struct task_struct *);
27752782 extern void __cleanup_sighand(struct sighand_struct *);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t