process.c (97eb3f24352ec6632c2127b35d8087d2a809a9b9) | process.c (b6a84016bd2598e35ead635147fa53619982648d) |
---|---|
1/* 2 * Derived from "arch/i386/kernel/process.c" 3 * Copyright (C) 1995 Linus Torvalds 4 * 5 * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and 6 * Paul Mackerras (paulus@cs.anu.edu.au) 7 * 8 * PowerPC version --- 339 unchanged lines hidden (view full) --- 348 */ 349static void switch_booke_debug_regs(struct thread_struct *new_thread) 350{ 351 if ((current->thread.dbcr0 & DBCR0_IDM) 352 || (new_thread->dbcr0 & DBCR0_IDM)) 353 prime_debug_regs(new_thread); 354} 355#else /* !CONFIG_PPC_ADV_DEBUG_REGS */ | 1/* 2 * Derived from "arch/i386/kernel/process.c" 3 * Copyright (C) 1995 Linus Torvalds 4 * 5 * Updated and modified by Cort Dougan (cort@cs.nmt.edu) and 6 * Paul Mackerras (paulus@cs.anu.edu.au) 7 * 8 * PowerPC version --- 339 unchanged lines hidden (view full) --- 348 */ 349static void switch_booke_debug_regs(struct thread_struct *new_thread) 350{ 351 if ((current->thread.dbcr0 & DBCR0_IDM) 352 || (new_thread->dbcr0 & DBCR0_IDM)) 353 prime_debug_regs(new_thread); 354} 355#else /* !CONFIG_PPC_ADV_DEBUG_REGS */ |
356#ifndef CONFIG_HAVE_HW_BREAKPOINT |
|
356static void set_debug_reg_defaults(struct thread_struct *thread) 357{ 358 if (thread->dabr) { 359 thread->dabr = 0; 360 set_dabr(0); 361 } 362} | 357static void set_debug_reg_defaults(struct thread_struct *thread) 358{ 359 if (thread->dabr) { 360 thread->dabr = 0; 361 set_dabr(0); 362 } 363} |
364#endif /* !CONFIG_HAVE_HW_BREAKPOINT */ |
|
363#endif /* CONFIG_PPC_ADV_DEBUG_REGS */ 364 365int set_dabr(unsigned long dabr) 366{ 367 __get_cpu_var(current_dabr) = dabr; 368 369 if (ppc_md.set_dabr) 370 return ppc_md.set_dabr(dabr); --- 294 unchanged lines hidden (view full) --- 665{ 666 discard_lazy_cpu_state(); 667} 668 669void flush_thread(void) 670{ 671 discard_lazy_cpu_state(); 672 | 365#endif /* CONFIG_PPC_ADV_DEBUG_REGS */ 366 367int set_dabr(unsigned long dabr) 368{ 369 __get_cpu_var(current_dabr) = dabr; 370 371 if (ppc_md.set_dabr) 372 return ppc_md.set_dabr(dabr); --- 294 unchanged lines hidden (view full) --- 667{ 668 discard_lazy_cpu_state(); 669} 670 671void flush_thread(void) 672{ 673 discard_lazy_cpu_state(); 674 |
673#ifdef CONFIG_HAVE_HW_BREAKPOINTS | 675#ifdef CONFIG_HAVE_HW_BREAKPOINT |
674 flush_ptrace_hw_breakpoint(current); | 676 flush_ptrace_hw_breakpoint(current); |
675#else /* CONFIG_HAVE_HW_BREAKPOINTS */ | 677#else /* CONFIG_HAVE_HW_BREAKPOINT */ |
676 set_debug_reg_defaults(¤t->thread); | 678 set_debug_reg_defaults(¤t->thread); |
677#endif /* CONFIG_HAVE_HW_BREAKPOINTS */ | 679#endif /* CONFIG_HAVE_HW_BREAKPOINT */ |
678} 679 680void 681release_thread(struct task_struct *t) 682{ 683} 684 685/* --- 525 unchanged lines hidden (view full) --- 1211 mtspr(SPRN_CTRLT, ctrl); 1212} 1213#endif 1214 1215#if THREAD_SHIFT < PAGE_SHIFT 1216 1217static struct kmem_cache *thread_info_cache; 1218 | 680} 681 682void 683release_thread(struct task_struct *t) 684{ 685} 686 687/* --- 525 unchanged lines hidden (view full) --- 1213 mtspr(SPRN_CTRLT, ctrl); 1214} 1215#endif 1216 1217#if THREAD_SHIFT < PAGE_SHIFT 1218 1219static struct kmem_cache *thread_info_cache; 1220 |
1219struct thread_info *alloc_thread_info(struct task_struct *tsk) | 1221struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node) |
1220{ 1221 struct thread_info *ti; 1222 | 1222{ 1223 struct thread_info *ti; 1224 |
1223 ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL); | 1225 ti = kmem_cache_alloc_node(thread_info_cache, GFP_KERNEL, node); |
1224 if (unlikely(ti == NULL)) 1225 return NULL; 1226#ifdef CONFIG_DEBUG_STACK_USAGE 1227 memset(ti, 0, THREAD_SIZE); 1228#endif 1229 return ti; 1230} 1231 --- 68 unchanged lines hidden --- | 1226 if (unlikely(ti == NULL)) 1227 return NULL; 1228#ifdef CONFIG_DEBUG_STACK_USAGE 1229 memset(ti, 0, THREAD_SIZE); 1230#endif 1231 return ti; 1232} 1233 --- 68 unchanged lines hidden --- |