PERFORCE change 73550 for review
Juli Mallett
jmallett at FreeBSD.org
Sat Mar 19 17:09:57 PST 2005
http://perforce.freebsd.org/chv.cgi?CH=73550
Change 73550 by jmallett at jmallett_windward on 2005/03/20 01:09:47
tweak pcb
Affected files ...
.. //depot/projects/mips/sys/mips/include/pcb.h#10 edit
.. //depot/projects/mips/sys/mips/mips/vm_machdep.c#20 edit
Differences ...
==== //depot/projects/mips/sys/mips/include/pcb.h#10 (text+ko) ====
@@ -37,18 +37,18 @@
__register_t pcb_regs[12];
};
-#define PCB_REG_S0 (0x00)
-#define PCB_REG_S1 (0x01)
-#define PCB_REG_S2 (0x02)
-#define PCB_REG_S3 (0x03)
-#define PCB_REG_S4 (0x04)
-#define PCB_REG_S5 (0x05)
-#define PCB_REG_S6 (0x06)
-#define PCB_REG_S7 (0x07)
-#define PCB_REG_SP (0x08)
-#define PCB_REG_S8 (0x09)
-#define PCB_REG_SR (0x0a)
-#define PCB_REG_RA (0x0b)
+#define PCB_REG_S0 (0)
+#define PCB_REG_S1 (1)
+#define PCB_REG_S2 (2)
+#define PCB_REG_S3 (3)
+#define PCB_REG_S4 (4)
+#define PCB_REG_S5 (5)
+#define PCB_REG_S6 (6)
+#define PCB_REG_S7 (7)
+#define PCB_REG_S8 (8)
+#define PCB_REG_SP (9)
+#define PCB_REG_SR (10)
+#define PCB_REG_RA (11)
#ifdef _KERNEL
#define PCB_FSR(pcb) (0)
==== //depot/projects/mips/sys/mips/mips/vm_machdep.c#20 (text+ko) ====
@@ -80,10 +80,10 @@
/*
* Call fork_trampoline into fork_return via the pcb.
*/
- td2->td_pcb->pcb_regs[10] = (register_t)fork_trampoline;
- td2->td_pcb->pcb_regs[0] = (register_t)fork_return;
- td2->td_pcb->pcb_regs[1] = (register_t)td2;
- td2->td_pcb->pcb_regs[2] = (register_t)td2->td_frame;
+ td2->td_pcb->pcb_regs[PCB_REG_RA] = (register_t)fork_trampoline;
+ td2->td_pcb->pcb_regs[PCB_REG_S0] = (register_t)fork_return;
+ td2->td_pcb->pcb_regs[PCB_REG_S1] = (register_t)td2;
+ td2->td_pcb->pcb_regs[PCB_REG_S2] = (register_t)td2->td_frame;
/*
* Now cpu_switch() can schedule the new process.
@@ -118,9 +118,9 @@
td->td_pcb =
(struct pcb *)(td->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
td->td_frame = (struct trapframe *)td->td_pcb - 1;
- td->td_pcb->pcb_regs[11] = MIPS_SR_KX | MIPS_SR_INT_IE;
+ td->td_pcb->pcb_regs[PCB_REG_SR] = MIPS_SR_KX | MIPS_SR_INT_IE;
/* Stack pointer. */
- td->td_pcb->pcb_regs[8] = (register_t)_ALIGN(td->td_frame - 1);
+ td->td_pcb->pcb_regs[PCB_REG_SP] = (register_t)_ALIGN(td->td_frame - 1);
}
/*
@@ -130,8 +130,8 @@
void
cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg)
{
- td->td_pcb->pcb_regs[0] = (register_t)func;
- td->td_pcb->pcb_regs[1] = (register_t)arg;
+ td->td_pcb->pcb_regs[PCB_REG_S0] = (register_t)func;
+ td->td_pcb->pcb_regs[PCB_REG_S1] = (register_t)arg;
}
void
More information about the p4-projects
mailing list