MFC: eliminate pcb_rflags, replacing it with padding. It just wastes
cpu cycles.
This commit is contained in:
parent
93c90b8175
commit
52c2c8deb5
@ -100,8 +100,6 @@ ENTRY(cpu_switch)
|
||||
movq %r13,PCB_R13(%r8)
|
||||
movq %r14,PCB_R14(%r8)
|
||||
movq %r15,PCB_R15(%r8)
|
||||
pushfq /* PSL */
|
||||
popq PCB_RFLAGS(%r8)
|
||||
|
||||
testl $PCB_32BIT,PCB_FLAGS(%r8)
|
||||
jz 1f /* no, skip over */
|
||||
@ -218,8 +216,6 @@ sw1:
|
||||
movq PCB_R15(%r8),%r15
|
||||
movq PCB_RIP(%r8),%rax
|
||||
movq %rax,(%rsp)
|
||||
pushq PCB_RFLAGS(%r8)
|
||||
popfq
|
||||
|
||||
movq %r8, PCPU(CURPCB)
|
||||
movq %rsi, PCPU(CURTHREAD) /* into next thread */
|
||||
@ -269,8 +265,6 @@ ENTRY(savectx)
|
||||
movq %r13,PCB_R13(%rcx)
|
||||
movq %r14,PCB_R14(%rcx)
|
||||
movq %r15,PCB_R15(%rcx)
|
||||
pushfq
|
||||
popq PCB_RFLAGS(%rcx)
|
||||
|
||||
/*
|
||||
* If fpcurthread == NULL, then the fpu h/w state is irrelevant and the
|
||||
|
@ -62,6 +62,7 @@ gdb_cpu_getreg(int regnum, size_t *regsz)
|
||||
case 9: return (&kdb_frame->tf_r9);
|
||||
case 10: return (&kdb_frame->tf_r10);
|
||||
case 11: return (&kdb_frame->tf_r11);
|
||||
case 17: return (&kdb_frame->tf_rflags);
|
||||
case 18: return (&kdb_frame->tf_cs);
|
||||
case 19: return (&kdb_frame->tf_ss);
|
||||
}
|
||||
@ -75,7 +76,6 @@ gdb_cpu_getreg(int regnum, size_t *regsz)
|
||||
case 14: return (&kdb_thrctx->pcb_r14);
|
||||
case 15: return (&kdb_thrctx->pcb_r15);
|
||||
case 16: return (&kdb_thrctx->pcb_rip);
|
||||
case 17: return (&kdb_thrctx->pcb_rflags);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
@ -121,7 +121,6 @@ ASSYM(PCB_RBP, offsetof(struct pcb, pcb_rbp));
|
||||
ASSYM(PCB_RSP, offsetof(struct pcb, pcb_rsp));
|
||||
ASSYM(PCB_RBX, offsetof(struct pcb, pcb_rbx));
|
||||
ASSYM(PCB_RIP, offsetof(struct pcb, pcb_rip));
|
||||
ASSYM(PCB_RFLAGS, offsetof(struct pcb, pcb_rflags));
|
||||
ASSYM(PCB_FSBASE, offsetof(struct pcb, pcb_fsbase));
|
||||
ASSYM(PCB_GSBASE, offsetof(struct pcb, pcb_gsbase));
|
||||
ASSYM(PCB_DS, offsetof(struct pcb, pcb_ds));
|
||||
|
@ -154,7 +154,6 @@ cpu_fork(td1, p2, td2, flags)
|
||||
pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *);
|
||||
pcb2->pcb_rbx = (register_t)td2; /* fork_trampoline argument */
|
||||
pcb2->pcb_rip = (register_t)fork_trampoline;
|
||||
pcb2->pcb_rflags = td2->td_frame->tf_rflags & ~PSL_I; /* ints disabled */
|
||||
/*-
|
||||
* pcb2->pcb_dr*: cloned above.
|
||||
* pcb2->pcb_savefpu: cloned above.
|
||||
@ -289,12 +288,10 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
pcb2->pcb_rsp = (register_t)td->td_frame - sizeof(void *); /* trampoline arg */
|
||||
pcb2->pcb_rbx = (register_t)td; /* trampoline arg */
|
||||
pcb2->pcb_rip = (register_t)fork_trampoline;
|
||||
pcb2->pcb_rflags = PSL_KERNEL; /* ints disabled */
|
||||
/*
|
||||
* If we didn't copy the pcb, we'd need to do the following registers:
|
||||
* pcb2->pcb_dr*: cloned above.
|
||||
* pcb2->pcb_savefpu: cloned above.
|
||||
* pcb2->pcb_rflags: cloned above.
|
||||
* pcb2->pcb_onfault: cloned above (always NULL here?).
|
||||
* pcb2->pcb_[fg]sbase: cloned above
|
||||
*/
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include <machine/fpu.h>
|
||||
|
||||
struct pcb {
|
||||
register_t padxx[8];
|
||||
register_t __pad0[8]; /* Spare */
|
||||
register_t pcb_cr3;
|
||||
register_t pcb_r15;
|
||||
register_t pcb_r14;
|
||||
@ -53,7 +53,7 @@ struct pcb {
|
||||
register_t pcb_rsp;
|
||||
register_t pcb_rbx;
|
||||
register_t pcb_rip;
|
||||
register_t pcb_rflags;
|
||||
register_t __pad1; /* Spare */
|
||||
register_t pcb_fsbase;
|
||||
register_t pcb_gsbase;
|
||||
u_int32_t pcb_ds;
|
||||
|
Loading…
Reference in New Issue
Block a user