Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/machdep.c
Show First 20 Lines • Show All 592 Lines • ▼ Show 20 Lines | exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) | ||||
pcb->pcb_gsbase = 0; | pcb->pcb_gsbase = 0; | ||||
clear_pcb_flags(pcb, PCB_32BIT); | clear_pcb_flags(pcb, PCB_32BIT); | ||||
pcb->pcb_initial_fpucw = __INITIAL_FPUCW__; | pcb->pcb_initial_fpucw = __INITIAL_FPUCW__; | ||||
bzero((char *)regs, sizeof(struct trapframe)); | bzero((char *)regs, sizeof(struct trapframe)); | ||||
regs->tf_rip = imgp->entry_addr; | regs->tf_rip = imgp->entry_addr; | ||||
regs->tf_rsp = ((stack - 8) & ~0xFul) + 8; | regs->tf_rsp = ((stack - 8) & ~0xFul) + 8; | ||||
regs->tf_rdi = stack; /* argv */ | regs->tf_rdi = stack; /* argv */ | ||||
regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); | regs->tf_rflags = PSL_USER; | ||||
regs->tf_ss = _udatasel; | regs->tf_ss = _udatasel; | ||||
regs->tf_cs = _ucodesel; | regs->tf_cs = _ucodesel; | ||||
regs->tf_ds = _udatasel; | regs->tf_ds = _udatasel; | ||||
regs->tf_es = _udatasel; | regs->tf_es = _udatasel; | ||||
regs->tf_fs = _ufssel; | regs->tf_fs = _ufssel; | ||||
regs->tf_gs = _ugssel; | regs->tf_gs = _ugssel; | ||||
regs->tf_flags = TF_HASSEGS; | regs->tf_flags = TF_HASSEGS; | ||||
▲ Show 20 Lines • Show All 2,011 Lines • Show Last 20 Lines |