diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-05-05 11:05:45 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-05-08 08:08:45 -0400 |
commit | c03a6a7ba6f456663e4b254cdde460b24c0852e1 (patch) | |
tree | 65946bd5107fd3d0d738bc31ce8679d6d0dea58d /arch/mn10300 | |
parent | 96c951179736eb59c5f66de2ac85af9e7a6a8b15 (diff) |
mn10300: Use common threadinfo allocator
Let the core code allocate and handle the kgdb cleanup with the
arch_release_thread_info() function.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: David Howells <dhowells@redhat.com>
Link: http://lkml.kernel.org/r/20120505150141.996582377@linutronix.de
Diffstat (limited to 'arch/mn10300')
-rw-r--r-- | arch/mn10300/include/asm/thread_info.h | 17 | ||||
-rw-r--r-- | arch/mn10300/kernel/kgdb.c | 3 |
2 files changed, 4 insertions, 16 deletions
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h index 28cf52100baa..08251d6f6b11 100644 --- a/arch/mn10300/include/asm/thread_info.h +++ b/arch/mn10300/include/asm/thread_info.h | |||
@@ -20,8 +20,10 @@ | |||
20 | 20 | ||
21 | #ifdef CONFIG_4KSTACKS | 21 | #ifdef CONFIG_4KSTACKS |
22 | #define THREAD_SIZE (4096) | 22 | #define THREAD_SIZE (4096) |
23 | #define THREAD_SIZE_ORDER (0) | ||
23 | #else | 24 | #else |
24 | #define THREAD_SIZE (8192) | 25 | #define THREAD_SIZE (8192) |
26 | #define THREAD_SIZE_ORDER (1) | ||
25 | #endif | 27 | #endif |
26 | 28 | ||
27 | #define STACK_WARN (THREAD_SIZE / 8) | 29 | #define STACK_WARN (THREAD_SIZE / 8) |
@@ -120,21 +122,8 @@ static inline unsigned long current_stack_pointer(void) | |||
120 | return sp; | 122 | return sp; |
121 | } | 123 | } |
122 | 124 | ||
123 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
124 | |||
125 | /* thread information allocation */ | ||
126 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
127 | #define alloc_thread_info_node(tsk, node) \ | ||
128 | kzalloc_node(THREAD_SIZE, GFP_KERNEL, node) | ||
129 | #else | ||
130 | #define alloc_thread_info_node(tsk, node) \ | ||
131 | kmalloc_node(THREAD_SIZE, GFP_KERNEL, node) | ||
132 | #endif | ||
133 | |||
134 | #ifndef CONFIG_KGDB | 125 | #ifndef CONFIG_KGDB |
135 | #define free_thread_info(ti) kfree((ti)) | 126 | void arch_release_thread_info(struct thread_info *ti) |
136 | #else | ||
137 | extern void free_thread_info(struct thread_info *); | ||
138 | #endif | 127 | #endif |
139 | #define get_thread_info(ti) get_task_struct((ti)->task) | 128 | #define get_thread_info(ti) get_task_struct((ti)->task) |
140 | #define put_thread_info(ti) put_task_struct((ti)->task) | 129 | #define put_thread_info(ti) put_task_struct((ti)->task) |
diff --git a/arch/mn10300/kernel/kgdb.c b/arch/mn10300/kernel/kgdb.c index f6c981db2a36..99770823451a 100644 --- a/arch/mn10300/kernel/kgdb.c +++ b/arch/mn10300/kernel/kgdb.c | |||
@@ -397,7 +397,7 @@ static bool kgdb_arch_undo_singlestep(struct pt_regs *regs) | |||
397 | * single-step state is cleared. At this point the breakpoints should have | 397 | * single-step state is cleared. At this point the breakpoints should have |
398 | * been removed by __switch_to(). | 398 | * been removed by __switch_to(). |
399 | */ | 399 | */ |
400 | void free_thread_info(struct thread_info *ti) | 400 | void arch_release_thread_info(struct thread_info *ti) |
401 | { | 401 | { |
402 | if (kgdb_sstep_thread == ti) { | 402 | if (kgdb_sstep_thread == ti) { |
403 | kgdb_sstep_thread = NULL; | 403 | kgdb_sstep_thread = NULL; |
@@ -407,7 +407,6 @@ void free_thread_info(struct thread_info *ti) | |||
407 | * so force immediate reentry */ | 407 | * so force immediate reentry */ |
408 | kgdb_breakpoint(); | 408 | kgdb_breakpoint(); |
409 | } | 409 | } |
410 | kfree(ti); | ||
411 | } | 410 | } |
412 | 411 | ||
413 | /* | 412 | /* |