- Get rid of label_t. It came from NetBSD and was used only in one place

This commit is contained in:
Oleksandr Tymoshenko 2009-10-16 22:52:18 +00:00
parent 257c916acf
commit 7dba4abc79
4 changed files with 29 additions and 33 deletions

View File

@ -165,8 +165,4 @@ typedef char * __va_list;
typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
#endif
typedef struct label_t {
__register_t val[13];
} label_t;
#endif /* !_MACHINE__TYPES_H_ */

View File

@ -50,7 +50,7 @@
struct pcb
{
struct trapframe pcb_regs; /* saved CPU and registers */
label_t pcb_context; /* kernel context for resume */
__register_t pcb_context[13]; /* kernel context for resume */
int pcb_onfault; /* for copyin/copyout faults */
};

View File

@ -126,17 +126,17 @@ gdb_cpu_getreg(int regnum, size_t *regsz)
}
}
switch (regnum) {
case 16: return (&kdb_thrctx->pcb_context.val[0]);
case 17: return (&kdb_thrctx->pcb_context.val[1]);
case 18: return (&kdb_thrctx->pcb_context.val[2]);
case 19: return (&kdb_thrctx->pcb_context.val[3]);
case 20: return (&kdb_thrctx->pcb_context.val[4]);
case 21: return (&kdb_thrctx->pcb_context.val[5]);
case 22: return (&kdb_thrctx->pcb_context.val[6]);
case 23: return (&kdb_thrctx->pcb_context.val[7]);
case 29: return (&kdb_thrctx->pcb_context.val[8]);
case 30: return (&kdb_thrctx->pcb_context.val[9]);
case 31: return (&kdb_thrctx->pcb_context.val[10]);
case 16: return (&kdb_thrctx->pcb_context[0]);
case 17: return (&kdb_thrctx->pcb_context[1]);
case 18: return (&kdb_thrctx->pcb_context[2]);
case 19: return (&kdb_thrctx->pcb_context[3]);
case 20: return (&kdb_thrctx->pcb_context[4]);
case 21: return (&kdb_thrctx->pcb_context[5]);
case 22: return (&kdb_thrctx->pcb_context[6]);
case 23: return (&kdb_thrctx->pcb_context[7]);
case 29: return (&kdb_thrctx->pcb_context[8]);
case 30: return (&kdb_thrctx->pcb_context[9]);
case 31: return (&kdb_thrctx->pcb_context[10]);
}
return (NULL);
}
@ -146,7 +146,7 @@ gdb_cpu_setreg(int regnum, void *val)
{
switch (regnum) {
case GDB_REG_PC:
kdb_thrctx->pcb_context.val[10] = *(register_t *)val;
kdb_thrctx->pcb_context[10] = *(register_t *)val;
if (kdb_thread == PCPU_GET(curthread))
kdb_frame->pc = *(register_t *)val;
}

View File

@ -142,14 +142,14 @@ cpu_fork(register struct thread *td1,register struct proc *p2,
if (td1 == PCPU_GET(fpcurthread))
MipsSaveCurFPState(td1);
pcb2->pcb_context.val[PCB_REG_RA] = (register_t)fork_trampoline;
pcb2->pcb_context[PCB_REG_RA] = (register_t)fork_trampoline;
/* Make sp 64-bit aligned */
pcb2->pcb_context.val[PCB_REG_SP] = (register_t)(((vm_offset_t)td2->td_pcb &
pcb2->pcb_context[PCB_REG_SP] = (register_t)(((vm_offset_t)td2->td_pcb &
~(sizeof(__int64_t) - 1)) - STAND_FRAME_SIZE);
pcb2->pcb_context.val[PCB_REG_S0] = (register_t)fork_return;
pcb2->pcb_context.val[PCB_REG_S1] = (register_t)td2;
pcb2->pcb_context.val[PCB_REG_S2] = (register_t)td2->td_frame;
pcb2->pcb_context.val[PCB_REG_SR] = SR_INT_MASK & mips_rd_status();
pcb2->pcb_context[PCB_REG_S0] = (register_t)fork_return;
pcb2->pcb_context[PCB_REG_S1] = (register_t)td2;
pcb2->pcb_context[PCB_REG_S2] = (register_t)td2->td_frame;
pcb2->pcb_context[PCB_REG_SR] = SR_INT_MASK & mips_rd_status();
/*
* FREEBSD_DEVELOPERS_FIXME:
* Setup any other CPU-Specific registers (Not MIPS Standard)
@ -161,7 +161,7 @@ cpu_fork(register struct thread *td1,register struct proc *p2,
td2->td_md.md_saved_intr = MIPS_SR_INT_IE;
td2->td_md.md_spinlock_count = 1;
#ifdef TARGET_OCTEON
pcb2->pcb_context.val[PCB_REG_SR] |= MIPS_SR_COP_2_BIT | MIPS32_SR_PX | MIPS_SR_UX | MIPS_SR_KX | MIPS_SR_SX;
pcb2->pcb_context[PCB_REG_SR] |= MIPS_SR_COP_2_BIT | MIPS32_SR_PX | MIPS_SR_UX | MIPS_SR_KX | MIPS_SR_SX;
#endif
}
@ -179,8 +179,8 @@ cpu_set_fork_handler(struct thread *td, void (*func) __P((void *)), void *arg)
* Note that the trap frame follows the args, so the function
* is really called like this: func(arg, frame);
*/
td->td_pcb->pcb_context.val[PCB_REG_S0] = (register_t) func;
td->td_pcb->pcb_context.val[PCB_REG_S1] = (register_t) arg;
td->td_pcb->pcb_context[PCB_REG_S0] = (register_t) func;
td->td_pcb->pcb_context[PCB_REG_S1] = (register_t) arg;
}
void
@ -293,18 +293,18 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
* Set registers for trampoline to user mode.
*/
pcb2->pcb_context.val[PCB_REG_RA] = (register_t)fork_trampoline;
pcb2->pcb_context[PCB_REG_RA] = (register_t)fork_trampoline;
/* Make sp 64-bit aligned */
pcb2->pcb_context.val[PCB_REG_SP] = (register_t)(((vm_offset_t)td->td_pcb &
pcb2->pcb_context[PCB_REG_SP] = (register_t)(((vm_offset_t)td->td_pcb &
~(sizeof(__int64_t) - 1)) - STAND_FRAME_SIZE);
pcb2->pcb_context.val[PCB_REG_S0] = (register_t)fork_return;
pcb2->pcb_context.val[PCB_REG_S1] = (register_t)td;
pcb2->pcb_context.val[PCB_REG_S2] = (register_t)td->td_frame;
pcb2->pcb_context[PCB_REG_S0] = (register_t)fork_return;
pcb2->pcb_context[PCB_REG_S1] = (register_t)td;
pcb2->pcb_context[PCB_REG_S2] = (register_t)td->td_frame;
/* Dont set IE bit in SR. sched lock release will take care of it */
pcb2->pcb_context.val[PCB_REG_SR] = SR_INT_MASK & mips_rd_status();
pcb2->pcb_context[PCB_REG_SR] = SR_INT_MASK & mips_rd_status();
#ifdef TARGET_OCTEON
pcb2->pcb_context.val[PCB_REG_SR] |= MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT |
pcb2->pcb_context[PCB_REG_SR] |= MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT |
MIPS32_SR_PX | MIPS_SR_UX | MIPS_SR_KX | MIPS_SR_SX;
#endif