diff options
author | jhb <jhb@FreeBSD.org> | 2001-06-29 11:10:41 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-06-29 11:10:41 +0000 |
commit | d82893e6762433665a192f6ffe2dad2a1a6c0678 (patch) | |
tree | cb74fd6ffd13686b7602fd19e3756d344a7b64e2 /sys/i386 | |
parent | 11807e464b0264daf76c2429a84420f80a6605d1 (diff) | |
download | FreeBSD-src-d82893e6762433665a192f6ffe2dad2a1a6c0678.zip FreeBSD-src-d82893e6762433665a192f6ffe2dad2a1a6c0678.tar.gz |
Add a new MI pointer to the process' trapframe p_frame instead of using
various differently named pointers buried under p_md.
Reviewed by: jake (in principle)
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/machdep.c | 26 | ||||
-rw-r--r-- | sys/i386/i386/math_emulate.c | 2 | ||||
-rw-r--r-- | sys/i386/i386/mem.c | 4 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 6 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 16 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_isc.c | 2 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_misc.c | 2 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_xenix.c | 2 | ||||
-rw-r--r-- | sys/i386/include/cpu.h | 4 | ||||
-rw-r--r-- | sys/i386/include/proc.h | 1 | ||||
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_ext.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/spigot.c | 4 | ||||
-rw-r--r-- | sys/i386/linux/linux_machdep.c | 4 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 8 | ||||
-rw-r--r-- | sys/i386/svr4/svr4_machdep.c | 6 |
15 files changed, 45 insertions, 46 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 90ab77c..ed4ebb5 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -467,7 +467,7 @@ osendsig(catcher, sig, mask, code) p = curproc; PROC_LOCK(p); psp = p->p_sigacts; - regs = p->p_md.md_regs; + regs = p->p_frame; oonstack = sigonstack(regs->tf_esp); /* Allocate and validate space for the signal handler context. */ @@ -617,7 +617,7 @@ sendsig(catcher, sig, mask, code) osendsig(catcher, sig, mask, code); return; } - regs = p->p_md.md_regs; + regs = p->p_frame; oonstack = sigonstack(regs->tf_esp); /* Save user context. */ @@ -764,7 +764,7 @@ osigreturn(p, uap) struct osigcontext *scp; int eflags; - regs = p->p_md.md_regs; + regs = p->p_frame; scp = uap->sigcntxp; if (!useracc((caddr_t)scp, sizeof(*scp), VM_PROT_READ)) return (EFAULT); @@ -889,7 +889,7 @@ sigreturn(p, uap) if (!useracc((caddr_t)ucp, sizeof(*ucp), VM_PROT_READ)) return (EFAULT); - regs = p->p_md.md_regs; + regs = p->p_frame; eflags = ucp->uc_mcontext.mc_eflags; if (eflags & PSL_VM) { struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs; @@ -1035,7 +1035,7 @@ setregs(p, entry, stack, ps_strings) u_long stack; u_long ps_strings; { - struct trapframe *regs = p->p_md.md_regs; + struct trapframe *regs = p->p_frame; struct pcb *pcb = &p->p_addr->u_pcb; if (pcb->pcb_ldt) @@ -2034,7 +2034,7 @@ init386(first) proc0.p_addr->u_pcb.pcb_flags = 0; proc0.p_addr->u_pcb.pcb_cr3 = (int)IdlePTD; proc0.p_addr->u_pcb.pcb_ext = 0; - proc0.p_md.md_regs = &proc0_tf; + proc0.p_frame = &proc0_tf; } #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -2081,7 +2081,7 @@ ptrace_set_pc(p, addr) struct proc *p; unsigned long addr; { - p->p_md.md_regs->tf_eip = addr; + p->p_frame->tf_eip = addr; return (0); } @@ -2089,7 +2089,7 @@ int ptrace_single_step(p) struct proc *p; { - p->p_md.md_regs->tf_eflags |= PSL_T; + p->p_frame->tf_eflags |= PSL_T; return (0); } @@ -2105,7 +2105,7 @@ int ptrace_read_u_check(p, addr, len) if ((vm_offset_t) (addr + len) <= sizeof(struct user)) return 0; - gap = (char *) p->p_md.md_regs - (char *) p->p_addr; + gap = (char *) p->p_frame - (char *) p->p_addr; if ((vm_offset_t) addr < gap) return EPERM; @@ -2128,9 +2128,9 @@ int ptrace_write_u(p, off, data) * Privileged kernel state is scattered all over the user area. * Only allow write access to parts of regs and to fpregs. */ - min = (char *)p->p_md.md_regs - (char *)p->p_addr; + min = (char *)p->p_frame - (char *)p->p_addr; if (off >= min && off <= min + sizeof(struct trapframe) - sizeof(int)) { - tp = p->p_md.md_regs; + tp = p->p_frame; frame_copy = *tp; *(int *)((char *)&frame_copy + (off - min)) = data; if (!EFL_SECURE(frame_copy.tf_eflags, tp->tf_eflags) || @@ -2155,7 +2155,7 @@ fill_regs(p, regs) struct pcb *pcb; struct trapframe *tp; - tp = p->p_md.md_regs; + tp = p->p_frame; regs->r_fs = tp->tf_fs; regs->r_es = tp->tf_es; regs->r_ds = tp->tf_ds; @@ -2184,7 +2184,7 @@ set_regs(p, regs) struct pcb *pcb; struct trapframe *tp; - tp = p->p_md.md_regs; + tp = p->p_frame; if (!EFL_SECURE(regs->r_eflags, tp->tf_eflags) || !CS_SECURE(regs->r_cs)) return (EINVAL); diff --git a/sys/i386/i386/math_emulate.c b/sys/i386/i386/math_emulate.c index eae1fcc..94f32b1 100644 --- a/sys/i386/i386/math_emulate.c +++ b/sys/i386/i386/math_emulate.c @@ -604,7 +604,7 @@ static int __regoffset[] = { tEAX, tECX, tEDX, tEBX, tESP, tEBP, tESI, tEDI }; -#define REG(x) (((int *)curproc->p_md.md_regs)[__regoffset[(x)]]) +#define REG(x) (((int *)curproc->p_frame)[__regoffset[(x)]]) static char * sib(struct trapframe * info, int mod) diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c index 13023b8..dfb034e 100644 --- a/sys/i386/i386/mem.c +++ b/sys/i386/i386/mem.c @@ -102,7 +102,7 @@ mmclose(dev_t dev, int flags, int fmt, struct proc *p) { switch (minor(dev)) { case 14: - p->p_md.md_regs->tf_eflags &= ~PSL_IOPL; + p->p_frame->tf_eflags &= ~PSL_IOPL; } return (0); } @@ -124,7 +124,7 @@ mmopen(dev_t dev, int flags, int fmt, struct proc *p) return (error); if (securelevel > 0) return (EPERM); - p->p_md.md_regs->tf_eflags |= PSL_IOPL; + p->p_frame->tf_eflags |= PSL_IOPL; break; } return (0); diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 09cc034..f6a9e0c 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -277,7 +277,7 @@ restart: mtx_lock_spin(&sched_lock); sticks = p->p_sticks; mtx_unlock_spin(&sched_lock); - p->p_md.md_regs = &frame; + p->p_frame = &frame; switch (type) { case T_PRIVINFLT: /* privileged instruction fault */ @@ -1095,7 +1095,7 @@ syscall(frame) sticks = p->p_sticks; mtx_unlock_spin(&sched_lock); - p->p_md.md_regs = &frame; + p->p_frame = &frame; params = (caddr_t)frame.tf_esp + sizeof(int); code = frame.tf_eax; @@ -1279,7 +1279,7 @@ ast(framep) } sticks = p->p_sticks; - p->p_md.md_regs = framep; + p->p_frame = framep; astoff(p); cnt.v_soft++; diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 89762bc..40ae8cd 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -161,13 +161,13 @@ cpu_fork(p1, p2, flags) * Copy the trap frame for the return to user mode as if from a * syscall. This copies most of the user mode register values. */ - p2->p_md.md_regs = (struct trapframe *) + p2->p_frame = (struct trapframe *) ((int)p2->p_addr + UPAGES * PAGE_SIZE - 16) - 1; - bcopy(p1->p_md.md_regs, p2->p_md.md_regs, sizeof(*p2->p_md.md_regs)); + bcopy(p1->p_frame, p2->p_frame, sizeof(struct trapframe)); - p2->p_md.md_regs->tf_eax = 0; /* Child returns zero */ - p2->p_md.md_regs->tf_eflags &= ~PSL_C; /* success */ - p2->p_md.md_regs->tf_edx = 1; + p2->p_frame->tf_eax = 0; /* Child returns zero */ + p2->p_frame->tf_eflags &= ~PSL_C; /* success */ + p2->p_frame->tf_edx = 1; /* * Set registers for trampoline to user mode. Leave space for the @@ -177,7 +177,7 @@ cpu_fork(p1, p2, flags) pcb2->pcb_edi = 0; pcb2->pcb_esi = (int)fork_return; /* fork_trampoline argument */ pcb2->pcb_ebp = 0; - pcb2->pcb_esp = (int)p2->p_md.md_regs - sizeof(void *); + pcb2->pcb_esp = (int)p2->p_frame - sizeof(void *); pcb2->pcb_ebx = (int)p2; /* fork_trampoline argument */ pcb2->pcb_eip = (int)fork_trampoline; /*- @@ -319,8 +319,8 @@ cpu_coredump(p, vp, cred) return EINVAL; bcopy(p->p_addr, tempuser, sizeof(struct user)); - bcopy(p->p_md.md_regs, - tempuser + ((caddr_t) p->p_md.md_regs - (caddr_t) p->p_addr), + bcopy(p->p_frame, + tempuser + ((caddr_t) p->p_frame - (caddr_t) p->p_addr), sizeof(struct trapframe)); error = vn_rdwr(UIO_WRITE, vp, (caddr_t) tempuser, diff --git a/sys/i386/ibcs2/ibcs2_isc.c b/sys/i386/ibcs2/ibcs2_isc.c index bc268b6..f978c2d 100644 --- a/sys/i386/ibcs2/ibcs2_isc.c +++ b/sys/i386/ibcs2/ibcs2_isc.c @@ -46,7 +46,7 @@ extern struct sysent isc_sysent[]; int ibcs2_isc(struct proc *p, struct ibcs2_isc_args *uap) { - struct trapframe *tf = p->p_md.md_regs; + struct trapframe *tf = p->p_frame; struct sysent *callp; u_int code; diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 6f8d7e7..c2e28b9 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -143,7 +143,7 @@ ibcs2_wait(p, uap) { int error, status; struct wait_args w4; - struct trapframe *tf = p->p_md.md_regs; + struct trapframe *tf = p->p_frame; SCARG(&w4, rusage) = NULL; if ((tf->tf_eflags & (PSL_Z|PSL_PF|PSL_N|PSL_V)) diff --git a/sys/i386/ibcs2/ibcs2_xenix.c b/sys/i386/ibcs2/ibcs2_xenix.c index 0cab2fb..b11275c2 100644 --- a/sys/i386/ibcs2/ibcs2_xenix.c +++ b/sys/i386/ibcs2/ibcs2_xenix.c @@ -55,7 +55,7 @@ extern struct sysent xenix_sysent[]; int ibcs2_xenix(struct proc *p, struct ibcs2_xenix_args *uap) { - struct trapframe *tf = p->p_md.md_regs; + struct trapframe *tf = p->p_frame; struct sysent *callp; u_int code; diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 29b34ee..90643aa 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -56,8 +56,8 @@ #define cpu_exec(p) /* nothing */ #define cpu_swapin(p) /* nothing */ -#define cpu_getstack(p) ((p)->p_md.md_regs->tf_esp) -#define cpu_setstack(p, ap) ((p)->p_md.md_regs->tf_esp = (ap)) +#define cpu_getstack(p) ((p)->p_frame->tf_esp) +#define cpu_setstack(p, ap) ((p)->p_frame->tf_esp = (ap)) #define TRAPF_USERMODE(framep) \ ((ISPL((framep)->tf_cs) == SEL_UPL) || ((framep)->tf_eflags & PSL_VM)) diff --git a/sys/i386/include/proc.h b/sys/i386/include/proc.h index bc2679e..4217c4f 100644 --- a/sys/i386/include/proc.h +++ b/sys/i386/include/proc.h @@ -43,7 +43,6 @@ * Machine-dependent part of the proc structure for i386. */ struct mdproc { - struct trapframe *md_regs; /* registers on current frame */ }; #endif /* !_MACHINE_PROC_H_ */ diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c index 15686f4..967c928 100644 --- a/sys/i386/isa/pcvt/pcvt_ext.c +++ b/sys/i386/isa/pcvt/pcvt_ext.c @@ -2613,7 +2613,7 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) /* grant the process IO access; only allowed if euid == 0 */ /* and insecure */ { - struct trapframe *fp = p->p_md.md_regs; + struct trapframe *fp = p->p_frame; error = suser(p); if (error != 0) @@ -2629,7 +2629,7 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case KDDISABIO: /* abandon IO access permission */ { - struct trapframe *fp = p->p_md.md_regs; + struct trapframe *fp = p->p_frame; fp->tf_eflags &= ~PSL_IOPL; return 0; } diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index 39e9e33..db4a926 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -241,10 +241,10 @@ struct spigot_info *info; if (securelevel > 0) return EPERM; #endif - p->p_md.md_regs->tf_eflags |= PSL_IOPL; + p->p_frame->tf_eflags |= PSL_IOPL; break; case SPIGOT_IOPL_OFF: /* deny access to the IO PAGE */ - p->p_md.md_regs->tf_eflags &= ~PSL_IOPL; + p->p_frame->tf_eflags &= ~PSL_IOPL; break; case SPIGOT_GET_INFO: info = (struct spigot_info *)data; diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index fe43527..ce8d52b 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -262,7 +262,7 @@ linux_clone(struct proc *p, struct linux_clone_args *args) PROC_LOCK(p2); p2->p_sigparent = exit_signal; PROC_UNLOCK(p2); - p2->p_md.md_regs->tf_esp = (unsigned int)args->stack; + p2->p_frame->tf_esp = (unsigned int)args->stack; #ifdef DEBUG if (ldebug(clone)) @@ -474,7 +474,7 @@ linux_iopl(struct proc *p, struct linux_iopl_args *args) return (error); if (securelevel > 0) return (EPERM); - p->p_md.md_regs->tf_eflags = (p->p_md.md_regs->tf_eflags & ~PSL_IOPL) | + p->p_frame->tf_eflags = (p->p_frame->tf_eflags & ~PSL_IOPL) | (args->level * (PSL_IOPL / 3)); return (0); } diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 4dd664b..c37a03f 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -213,7 +213,7 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) struct linux_rt_sigframe *fp, frame; int oonstack; - regs = p->p_md.md_regs; + regs = p->p_frame; oonstack = sigonstack(regs->tf_esp); #ifdef DEBUG @@ -370,7 +370,7 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) return; } - regs = p->p_md.md_regs; + regs = p->p_frame; oonstack = sigonstack(regs->tf_esp); #ifdef DEBUG @@ -496,7 +496,7 @@ linux_sigreturn(p, args) linux_sigset_t lmask; int eflags, i; - regs = p->p_md.md_regs; + regs = p->p_frame; #ifdef DEBUG if (ldebug(sigreturn)) @@ -595,7 +595,7 @@ linux_rt_sigreturn(p, args) int eflags; caddr_t sg = stackgap_init(); - regs = p->p_md.md_regs; + regs = p->p_frame; #ifdef DEBUG if (ldebug(rt_sigreturn)) diff --git a/sys/i386/svr4/svr4_machdep.c b/sys/i386/svr4/svr4_machdep.c index 7346f07..18d50d5 100644 --- a/sys/i386/svr4/svr4_machdep.c +++ b/sys/i386/svr4/svr4_machdep.c @@ -96,7 +96,7 @@ svr4_getcontext(p, uc, mask, oonstack) sigset_t *mask; int oonstack; { - struct trapframe *tf = p->p_md.md_regs; + struct trapframe *tf = p->p_frame; svr4_greg_t *r = uc->uc_mcontext.greg; struct svr4_sigaltstack *s = &uc->uc_stack; #if defined(DONE_MORE_SIGALTSTACK_WORK) @@ -219,7 +219,7 @@ svr4_setcontext(p, uc) DPRINTF(("svr4_setcontext(%d)\n", p->p_pid)); - tf = p->p_md.md_regs; + tf = p->p_frame; /* * Restore register context. @@ -421,7 +421,7 @@ svr4_sendsig(catcher, sig, mask, code) PROC_LOCK(p); psp = p->p_sigacts; - tf = p->p_md.md_regs; + tf = p->p_frame; oonstack = sigonstack(tf->tf_esp); /* |