Lines Matching refs:child
74 int ptrace_get_debugreg(struct task_struct *child, unsigned long addr, in ptrace_get_debugreg() argument
80 return put_user(child->thread.debug.dac1, datalp); in ptrace_get_debugreg()
140 static long set_instruction_bp(struct task_struct *child, in set_instruction_bp() argument
144 int slot1_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC1) != 0); in set_instruction_bp()
145 int slot2_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC2) != 0); in set_instruction_bp()
146 int slot3_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC3) != 0); in set_instruction_bp()
147 int slot4_in_use = ((child->thread.debug.dbcr0 & DBCR0_IAC4) != 0); in set_instruction_bp()
149 if (dbcr_iac_range(child) & DBCR_IAC12MODE) in set_instruction_bp()
151 if (dbcr_iac_range(child) & DBCR_IAC34MODE) in set_instruction_bp()
165 child->thread.debug.iac1 = bp_info->addr; in set_instruction_bp()
166 child->thread.debug.iac2 = bp_info->addr2; in set_instruction_bp()
167 child->thread.debug.dbcr0 |= DBCR0_IAC1; in set_instruction_bp()
170 dbcr_iac_range(child) |= DBCR_IAC12X; in set_instruction_bp()
172 dbcr_iac_range(child) |= DBCR_IAC12I; in set_instruction_bp()
176 child->thread.debug.iac3 = bp_info->addr; in set_instruction_bp()
177 child->thread.debug.iac4 = bp_info->addr2; in set_instruction_bp()
178 child->thread.debug.dbcr0 |= DBCR0_IAC3; in set_instruction_bp()
181 dbcr_iac_range(child) |= DBCR_IAC34X; in set_instruction_bp()
183 dbcr_iac_range(child) |= DBCR_IAC34I; in set_instruction_bp()
199 child->thread.debug.iac1 = bp_info->addr; in set_instruction_bp()
200 child->thread.debug.dbcr0 |= DBCR0_IAC1; in set_instruction_bp()
206 child->thread.debug.iac2 = bp_info->addr; in set_instruction_bp()
207 child->thread.debug.dbcr0 |= DBCR0_IAC2; in set_instruction_bp()
211 child->thread.debug.iac3 = bp_info->addr; in set_instruction_bp()
212 child->thread.debug.dbcr0 |= DBCR0_IAC3; in set_instruction_bp()
215 child->thread.debug.iac4 = bp_info->addr; in set_instruction_bp()
216 child->thread.debug.dbcr0 |= DBCR0_IAC4; in set_instruction_bp()
223 child->thread.debug.dbcr0 |= DBCR0_IDM; in set_instruction_bp()
224 regs_set_return_msr(child->thread.regs, child->thread.regs->msr | MSR_DE); in set_instruction_bp()
229 static int del_instruction_bp(struct task_struct *child, int slot) in del_instruction_bp() argument
233 if ((child->thread.debug.dbcr0 & DBCR0_IAC1) == 0) in del_instruction_bp()
236 if (dbcr_iac_range(child) & DBCR_IAC12MODE) { in del_instruction_bp()
238 child->thread.debug.iac2 = 0; in del_instruction_bp()
239 dbcr_iac_range(child) &= ~DBCR_IAC12MODE; in del_instruction_bp()
241 child->thread.debug.iac1 = 0; in del_instruction_bp()
242 child->thread.debug.dbcr0 &= ~DBCR0_IAC1; in del_instruction_bp()
245 if ((child->thread.debug.dbcr0 & DBCR0_IAC2) == 0) in del_instruction_bp()
248 if (dbcr_iac_range(child) & DBCR_IAC12MODE) in del_instruction_bp()
251 child->thread.debug.iac2 = 0; in del_instruction_bp()
252 child->thread.debug.dbcr0 &= ~DBCR0_IAC2; in del_instruction_bp()
256 if ((child->thread.debug.dbcr0 & DBCR0_IAC3) == 0) in del_instruction_bp()
259 if (dbcr_iac_range(child) & DBCR_IAC34MODE) { in del_instruction_bp()
261 child->thread.debug.iac4 = 0; in del_instruction_bp()
262 dbcr_iac_range(child) &= ~DBCR_IAC34MODE; in del_instruction_bp()
264 child->thread.debug.iac3 = 0; in del_instruction_bp()
265 child->thread.debug.dbcr0 &= ~DBCR0_IAC3; in del_instruction_bp()
268 if ((child->thread.debug.dbcr0 & DBCR0_IAC4) == 0) in del_instruction_bp()
271 if (dbcr_iac_range(child) & DBCR_IAC34MODE) in del_instruction_bp()
274 child->thread.debug.iac4 = 0; in del_instruction_bp()
275 child->thread.debug.dbcr0 &= ~DBCR0_IAC4; in del_instruction_bp()
284 static int set_dac(struct task_struct *child, struct ppc_hw_breakpoint *bp_info) in set_dac() argument
299 if ((dbcr_dac(child) & (DBCR_DAC1R | DBCR_DAC1W)) == 0) { in set_dac()
302 dbcr_dac(child) |= DBCR_DAC1R; in set_dac()
304 dbcr_dac(child) |= DBCR_DAC1W; in set_dac()
305 child->thread.debug.dac1 = (unsigned long)bp_info->addr; in set_dac()
308 child->thread.debug.dvc1 = in set_dac()
310 child->thread.debug.dbcr2 |= in set_dac()
316 } else if (child->thread.debug.dbcr2 & DBCR2_DAC12MODE) { in set_dac()
320 } else if ((dbcr_dac(child) & (DBCR_DAC2R | DBCR_DAC2W)) == 0) { in set_dac()
323 dbcr_dac(child) |= DBCR_DAC2R; in set_dac()
325 dbcr_dac(child) |= DBCR_DAC2W; in set_dac()
326 child->thread.debug.dac2 = (unsigned long)bp_info->addr; in set_dac()
329 child->thread.debug.dvc2 = in set_dac()
331 child->thread.debug.dbcr2 |= in set_dac()
339 child->thread.debug.dbcr0 |= DBCR0_IDM; in set_dac()
340 regs_set_return_msr(child->thread.regs, child->thread.regs->msr | MSR_DE); in set_dac()
345 static int del_dac(struct task_struct *child, int slot) in del_dac() argument
348 if ((dbcr_dac(child) & (DBCR_DAC1R | DBCR_DAC1W)) == 0) in del_dac()
351 child->thread.debug.dac1 = 0; in del_dac()
352 dbcr_dac(child) &= ~(DBCR_DAC1R | DBCR_DAC1W); in del_dac()
354 if (child->thread.debug.dbcr2 & DBCR2_DAC12MODE) { in del_dac()
355 child->thread.debug.dac2 = 0; in del_dac()
356 child->thread.debug.dbcr2 &= ~DBCR2_DAC12MODE; in del_dac()
358 child->thread.debug.dbcr2 &= ~(DBCR2_DVC1M | DBCR2_DVC1BE); in del_dac()
361 child->thread.debug.dvc1 = 0; in del_dac()
364 if ((dbcr_dac(child) & (DBCR_DAC2R | DBCR_DAC2W)) == 0) in del_dac()
368 if (child->thread.debug.dbcr2 & DBCR2_DAC12MODE) in del_dac()
371 child->thread.debug.dbcr2 &= ~(DBCR2_DVC2M | DBCR2_DVC2BE); in del_dac()
374 child->thread.debug.dvc2 = 0; in del_dac()
376 child->thread.debug.dac2 = 0; in del_dac()
377 dbcr_dac(child) &= ~(DBCR_DAC2R | DBCR_DAC2W); in del_dac()
386 static int set_dac_range(struct task_struct *child, in set_dac_range() argument
418 if (child->thread.debug.dbcr0 & in set_dac_range()
423 child->thread.debug.dbcr0 |= (DBCR0_DAC1R | DBCR0_IDM); in set_dac_range()
425 child->thread.debug.dbcr0 |= (DBCR0_DAC1W | DBCR0_IDM); in set_dac_range()
426 child->thread.debug.dac1 = bp_info->addr; in set_dac_range()
427 child->thread.debug.dac2 = bp_info->addr2; in set_dac_range()
429 child->thread.debug.dbcr2 |= DBCR2_DAC12M; in set_dac_range()
431 child->thread.debug.dbcr2 |= DBCR2_DAC12MX; in set_dac_range()
433 child->thread.debug.dbcr2 |= DBCR2_DAC12MM; in set_dac_range()
434 regs_set_return_msr(child->thread.regs, child->thread.regs->msr | MSR_DE); in set_dac_range()
440 long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_info) in ppc_set_hwdebug() argument
464 return set_instruction_bp(child, bp_info); in ppc_set_hwdebug()
467 return set_dac(child, bp_info); in ppc_set_hwdebug()
470 return set_dac_range(child, bp_info); in ppc_set_hwdebug()
476 long ppc_del_hwdebug(struct task_struct *child, long data) in ppc_del_hwdebug() argument
481 rc = del_instruction_bp(child, (int)data); in ppc_del_hwdebug()
483 rc = del_dac(child, (int)data - 4); in ppc_del_hwdebug()
486 if (!DBCR_ACTIVE_EVENTS(child->thread.debug.dbcr0, in ppc_del_hwdebug()
487 child->thread.debug.dbcr1)) { in ppc_del_hwdebug()
488 child->thread.debug.dbcr0 &= ~DBCR0_IDM; in ppc_del_hwdebug()
489 regs_set_return_msr(child->thread.regs, in ppc_del_hwdebug()
490 child->thread.regs->msr & ~MSR_DE); in ppc_del_hwdebug()