* Construct a PCB from a trapframe. This is called from kdb_trap() where * we want to start a backtrace from the function that caused us to enter * the debugger. We have the context in the trapframe, but base the trace * on the PCB. The PCB doesn't have to be perfect, as long as it contains * enough for a backtrace. */
| 665 | * enough for a backtrace. |
| 666 | */ |
| 667 | void |
| 668 | makectx(struct trapframe *tf, struct pcb *pcb) |
| 669 | { |
| 670 | pcb->pcb_regs.sf_r4 = tf->tf_r4; |
| 671 | pcb->pcb_regs.sf_r5 = tf->tf_r5; |
| 672 | pcb->pcb_regs.sf_r6 = tf->tf_r6; |
| 673 | pcb->pcb_regs.sf_r7 = tf->tf_r7; |
| 674 | pcb->pcb_regs.sf_r8 = tf->tf_r8; |
| 675 | pcb->pcb_regs.sf_r9 = tf->tf_r9; |
| 676 | pcb->pcb_regs.sf_r10 = tf->tf_r10; |
| 677 | pcb->pcb_regs.sf_r11 = tf->tf_r11; |
| 678 | pcb->pcb_regs.sf_r12 = tf->tf_r12; |
| 679 | pcb->pcb_regs.sf_pc = tf->tf_pc; |
| 680 | pcb->pcb_regs.sf_lr = tf->tf_usr_lr; |
| 681 | pcb->pcb_regs.sf_sp = tf->tf_usr_sp; |
| 682 | } |
| 683 | |
| 684 | void |
| 685 | pcpu0_init(void) |