aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/kgdb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index c1eef241017a..83e89d310734 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -151,15 +151,16 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs)
151 return 1; 151 return 1;
152} 152}
153 153
154static DEFINE_PER_CPU(struct thread_info, kgdb_thread_info);
154static int kgdb_singlestep(struct pt_regs *regs) 155static int kgdb_singlestep(struct pt_regs *regs)
155{ 156{
156 struct thread_info *thread_info, *exception_thread_info; 157 struct thread_info *thread_info, *exception_thread_info;
157 struct thread_info *backup_current_thread_info; 158 struct thread_info *backup_current_thread_info =
159 &__get_cpu_var(kgdb_thread_info);
158 160
159 if (user_mode(regs)) 161 if (user_mode(regs))
160 return 0; 162 return 0;
161 163
162 backup_current_thread_info = kmalloc(sizeof(struct thread_info), GFP_KERNEL);
163 /* 164 /*
164 * On Book E and perhaps other processors, singlestep is handled on 165 * On Book E and perhaps other processors, singlestep is handled on
165 * the critical exception stack. This causes current_thread_info() 166 * the critical exception stack. This causes current_thread_info()
@@ -185,7 +186,6 @@ static int kgdb_singlestep(struct pt_regs *regs)
185 /* Restore current_thread_info lastly. */ 186 /* Restore current_thread_info lastly. */
186 memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info); 187 memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info);
187 188
188 kfree(backup_current_thread_info);
189 return 1; 189 return 1;
190} 190}
191 191