From 7dba4abc79ff14f331946c32002def622a6f2e70 Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Fri, 16 Oct 2009 22:52:18 +0000 Subject: [PATCH] - Get rid of label_t. It came from NetBSD and was used only in one place --- sys/mips/include/_types.h | 4 ---- sys/mips/include/pcb.h | 2 +- sys/mips/mips/gdb_machdep.c | 24 ++++++++++++------------ sys/mips/mips/vm_machdep.c | 32 ++++++++++++++++---------------- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/sys/mips/include/_types.h b/sys/mips/include/_types.h index 6ee30e3737f2..1fd760f9cb50 100644 --- a/sys/mips/include/_types.h +++ b/sys/mips/include/_types.h @@ -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_ */ diff --git a/sys/mips/include/pcb.h b/sys/mips/include/pcb.h index 16d274dbf411..208e52f21d42 100644 --- a/sys/mips/include/pcb.h +++ b/sys/mips/include/pcb.h @@ -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 */ }; diff --git a/sys/mips/mips/gdb_machdep.c b/sys/mips/mips/gdb_machdep.c index ae77e6bc6067..0f5b5ed2a206 100644 --- a/sys/mips/mips/gdb_machdep.c +++ b/sys/mips/mips/gdb_machdep.c @@ -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; } diff --git a/sys/mips/mips/vm_machdep.c b/sys/mips/mips/vm_machdep.c index 7e815e26b939..0b51fa1b62d7 100644 --- a/sys/mips/mips/vm_machdep.c +++ b/sys/mips/mips/vm_machdep.c @@ -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