md_regs is a struct trapframe * now, not int []
This commit is contained in:
parent
57e77cca8c
commit
02d04bd29b
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: linux_sysvec.c,v 1.12 1997/03/29 10:50:27 peter Exp $
|
* $Id: linux_sysvec.c,v 1.13 1997/04/01 08:39:07 bde Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* XXX we use functions that might not exist. */
|
/* XXX we use functions that might not exist. */
|
||||||
@ -170,7 +170,7 @@ void
|
|||||||
linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
||||||
{
|
{
|
||||||
register struct proc *p = curproc;
|
register struct proc *p = curproc;
|
||||||
register int *regs;
|
register struct trapframe *regs;
|
||||||
struct linux_sigframe *fp, frame;
|
struct linux_sigframe *fp, frame;
|
||||||
struct sigacts *psp = p->p_sigacts;
|
struct sigacts *psp = p->p_sigacts;
|
||||||
int oonstack;
|
int oonstack;
|
||||||
@ -191,7 +191,7 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
|||||||
psp->ps_sigstk.ss_size - sizeof(struct linux_sigframe));
|
psp->ps_sigstk.ss_size - sizeof(struct linux_sigframe));
|
||||||
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
|
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
|
||||||
} else {
|
} else {
|
||||||
fp = (struct linux_sigframe *)regs[tESP] - 1;
|
fp = (struct linux_sigframe *)regs->tf_esp - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -233,21 +233,21 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
|||||||
frame.sf_sc.sc_mask = mask;
|
frame.sf_sc.sc_mask = mask;
|
||||||
__asm("movl %%gs,%w0" : "=r" (frame.sf_sc.sc_gs));
|
__asm("movl %%gs,%w0" : "=r" (frame.sf_sc.sc_gs));
|
||||||
__asm("movl %%fs,%w0" : "=r" (frame.sf_sc.sc_fs));
|
__asm("movl %%fs,%w0" : "=r" (frame.sf_sc.sc_fs));
|
||||||
frame.sf_sc.sc_es = regs[tES];
|
frame.sf_sc.sc_es = regs->tf_es;
|
||||||
frame.sf_sc.sc_ds = regs[tDS];
|
frame.sf_sc.sc_ds = regs->tf_ds;
|
||||||
frame.sf_sc.sc_edi = regs[tEDI];
|
frame.sf_sc.sc_edi = regs->tf_edi;
|
||||||
frame.sf_sc.sc_esi = regs[tESI];
|
frame.sf_sc.sc_esi = regs->tf_esi;
|
||||||
frame.sf_sc.sc_ebp = regs[tEBP];
|
frame.sf_sc.sc_ebp = regs->tf_ebp;
|
||||||
frame.sf_sc.sc_ebx = regs[tEBX];
|
frame.sf_sc.sc_ebx = regs->tf_ebx;
|
||||||
frame.sf_sc.sc_edx = regs[tEDX];
|
frame.sf_sc.sc_edx = regs->tf_edx;
|
||||||
frame.sf_sc.sc_ecx = regs[tECX];
|
frame.sf_sc.sc_ecx = regs->tf_ecx;
|
||||||
frame.sf_sc.sc_eax = regs[tEAX];
|
frame.sf_sc.sc_eax = regs->tf_eax;
|
||||||
frame.sf_sc.sc_eip = regs[tEIP];
|
frame.sf_sc.sc_eip = regs->tf_eip;
|
||||||
frame.sf_sc.sc_cs = regs[tCS];
|
frame.sf_sc.sc_cs = regs->tf_cs;
|
||||||
frame.sf_sc.sc_eflags = regs[tEFLAGS];
|
frame.sf_sc.sc_eflags = regs->tf_eflags;
|
||||||
frame.sf_sc.sc_esp_at_signal = regs[tESP];
|
frame.sf_sc.sc_esp_at_signal = regs->tf_esp;
|
||||||
frame.sf_sc.sc_ss = regs[tSS];
|
frame.sf_sc.sc_ss = regs->tf_ss;
|
||||||
frame.sf_sc.sc_err = regs[tERR];
|
frame.sf_sc.sc_err = regs->tf_err;
|
||||||
frame.sf_sc.sc_trapno = code; /* XXX ???? */
|
frame.sf_sc.sc_trapno = code; /* XXX ???? */
|
||||||
|
|
||||||
if (copyout(&frame, fp, sizeof(frame)) != 0) {
|
if (copyout(&frame, fp, sizeof(frame)) != 0) {
|
||||||
@ -262,13 +262,13 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
|||||||
/*
|
/*
|
||||||
* Build context to run handler in.
|
* Build context to run handler in.
|
||||||
*/
|
*/
|
||||||
regs[tESP] = (int)fp;
|
regs->tf_esp = (int)fp;
|
||||||
regs[tEIP] = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
|
regs->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
|
||||||
regs[tEFLAGS] &= ~PSL_VM;
|
regs->tf_eflags &= ~PSL_VM;
|
||||||
regs[tCS] = _ucodesel;
|
regs->tf_cs = _ucodesel;
|
||||||
regs[tDS] = _udatasel;
|
regs->tf_ds = _udatasel;
|
||||||
regs[tES] = _udatasel;
|
regs->tf_es = _udatasel;
|
||||||
regs[tSS] = _udatasel;
|
regs->tf_ss = _udatasel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -288,7 +288,7 @@ linux_sigreturn(p, args, retval)
|
|||||||
int *retval;
|
int *retval;
|
||||||
{
|
{
|
||||||
struct linux_sigcontext *scp, context;
|
struct linux_sigcontext *scp, context;
|
||||||
register int *regs;
|
register struct trapframe *regs;
|
||||||
int eflags;
|
int eflags;
|
||||||
|
|
||||||
regs = p->p_md.md_regs;
|
regs = p->p_md.md_regs;
|
||||||
@ -320,7 +320,7 @@ linux_sigreturn(p, args, retval)
|
|||||||
* bit at worst causes one more or one less debugger trap, so
|
* bit at worst causes one more or one less debugger trap, so
|
||||||
* allowing it is fairly harmless.
|
* allowing it is fairly harmless.
|
||||||
*/
|
*/
|
||||||
if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs[tEFLAGS] & ~PSL_RF)) {
|
if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) {
|
||||||
return(EINVAL);
|
return(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,20 +342,20 @@ linux_sigreturn(p, args, retval)
|
|||||||
* Restore signal context.
|
* Restore signal context.
|
||||||
*/
|
*/
|
||||||
/* %fs and %gs were restored by the trampoline. */
|
/* %fs and %gs were restored by the trampoline. */
|
||||||
regs[tES] = context.sc_es;
|
regs->tf_es = context.sc_es;
|
||||||
regs[tDS] = context.sc_ds;
|
regs->tf_ds = context.sc_ds;
|
||||||
regs[tEDI] = context.sc_edi;
|
regs->tf_edi = context.sc_edi;
|
||||||
regs[tESI] = context.sc_esi;
|
regs->tf_esi = context.sc_esi;
|
||||||
regs[tEBP] = context.sc_ebp;
|
regs->tf_ebp = context.sc_ebp;
|
||||||
regs[tEBX] = context.sc_ebx;
|
regs->tf_ebx = context.sc_ebx;
|
||||||
regs[tEDX] = context.sc_edx;
|
regs->tf_edx = context.sc_edx;
|
||||||
regs[tECX] = context.sc_ecx;
|
regs->tf_ecx = context.sc_ecx;
|
||||||
regs[tEAX] = context.sc_eax;
|
regs->tf_eax = context.sc_eax;
|
||||||
regs[tEIP] = context.sc_eip;
|
regs->tf_eip = context.sc_eip;
|
||||||
regs[tCS] = context.sc_cs;
|
regs->tf_cs = context.sc_cs;
|
||||||
regs[tEFLAGS] = eflags;
|
regs->tf_eflags = eflags;
|
||||||
regs[tESP] = context.sc_esp_at_signal;
|
regs->tf_esp = context.sc_esp_at_signal;
|
||||||
regs[tSS] = context.sc_ss;
|
regs->tf_ss = context.sc_ss;
|
||||||
|
|
||||||
return (EJUSTRETURN);
|
return (EJUSTRETURN);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: ibcs2_isc.c,v 1.8 1997/02/22 09:33:21 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -50,7 +50,7 @@ extern struct sysent isc_sysent[];
|
|||||||
int
|
int
|
||||||
ibcs2_isc(struct proc *p, struct ibcs2_isc_args *uap, int *retval)
|
ibcs2_isc(struct proc *p, struct ibcs2_isc_args *uap, int *retval)
|
||||||
{
|
{
|
||||||
struct trapframe *tf = (struct trapframe *)p->p_md.md_regs;
|
struct trapframe *tf = p->p_md.md_regs;
|
||||||
struct sysent *callp;
|
struct sysent *callp;
|
||||||
u_int code;
|
u_int code;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
*
|
*
|
||||||
* @(#)sun_misc.c 8.1 (Berkeley) 6/18/93
|
* @(#)sun_misc.c 8.1 (Berkeley) 6/18/93
|
||||||
*
|
*
|
||||||
* $Id: ibcs2_misc.c,v 1.18 1997/03/24 11:23:31 bde Exp $
|
* $Id: ibcs2_misc.c,v 1.19 1997/04/06 14:10:50 dfr Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -166,7 +166,7 @@ ibcs2_wait(p, uap, retval)
|
|||||||
{
|
{
|
||||||
int error, status;
|
int error, status;
|
||||||
struct wait_args w4;
|
struct wait_args w4;
|
||||||
struct trapframe *tf = (struct trapframe *)p->p_md.md_regs;
|
struct trapframe *tf = p->p_md.md_regs;
|
||||||
|
|
||||||
SCARG(&w4, rusage) = NULL;
|
SCARG(&w4, rusage) = NULL;
|
||||||
if ((tf->tf_eflags & (PSL_Z|PSL_PF|PSL_N|PSL_V))
|
if ((tf->tf_eflags & (PSL_Z|PSL_PF|PSL_N|PSL_V))
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: ibcs2_xenix.c,v 1.9 1997/02/22 09:33:29 peter Exp $
|
* $Id: ibcs2_xenix.c,v 1.10 1997/03/24 11:37:49 bde Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -63,7 +63,7 @@ extern struct sysent xenix_sysent[];
|
|||||||
int
|
int
|
||||||
ibcs2_xenix(struct proc *p, struct ibcs2_xenix_args *uap, int *retval)
|
ibcs2_xenix(struct proc *p, struct ibcs2_xenix_args *uap, int *retval)
|
||||||
{
|
{
|
||||||
struct trapframe *tf = (struct trapframe *)p->p_md.md_regs;
|
struct trapframe *tf = p->p_md.md_regs;
|
||||||
struct sysent *callp;
|
struct sysent *callp;
|
||||||
u_int code;
|
u_int code;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: linux_sysvec.c,v 1.12 1997/03/29 10:50:27 peter Exp $
|
* $Id: linux_sysvec.c,v 1.13 1997/04/01 08:39:07 bde Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* XXX we use functions that might not exist. */
|
/* XXX we use functions that might not exist. */
|
||||||
@ -170,7 +170,7 @@ void
|
|||||||
linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
||||||
{
|
{
|
||||||
register struct proc *p = curproc;
|
register struct proc *p = curproc;
|
||||||
register int *regs;
|
register struct trapframe *regs;
|
||||||
struct linux_sigframe *fp, frame;
|
struct linux_sigframe *fp, frame;
|
||||||
struct sigacts *psp = p->p_sigacts;
|
struct sigacts *psp = p->p_sigacts;
|
||||||
int oonstack;
|
int oonstack;
|
||||||
@ -191,7 +191,7 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
|||||||
psp->ps_sigstk.ss_size - sizeof(struct linux_sigframe));
|
psp->ps_sigstk.ss_size - sizeof(struct linux_sigframe));
|
||||||
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
|
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
|
||||||
} else {
|
} else {
|
||||||
fp = (struct linux_sigframe *)regs[tESP] - 1;
|
fp = (struct linux_sigframe *)regs->tf_esp - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -233,21 +233,21 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
|||||||
frame.sf_sc.sc_mask = mask;
|
frame.sf_sc.sc_mask = mask;
|
||||||
__asm("movl %%gs,%w0" : "=r" (frame.sf_sc.sc_gs));
|
__asm("movl %%gs,%w0" : "=r" (frame.sf_sc.sc_gs));
|
||||||
__asm("movl %%fs,%w0" : "=r" (frame.sf_sc.sc_fs));
|
__asm("movl %%fs,%w0" : "=r" (frame.sf_sc.sc_fs));
|
||||||
frame.sf_sc.sc_es = regs[tES];
|
frame.sf_sc.sc_es = regs->tf_es;
|
||||||
frame.sf_sc.sc_ds = regs[tDS];
|
frame.sf_sc.sc_ds = regs->tf_ds;
|
||||||
frame.sf_sc.sc_edi = regs[tEDI];
|
frame.sf_sc.sc_edi = regs->tf_edi;
|
||||||
frame.sf_sc.sc_esi = regs[tESI];
|
frame.sf_sc.sc_esi = regs->tf_esi;
|
||||||
frame.sf_sc.sc_ebp = regs[tEBP];
|
frame.sf_sc.sc_ebp = regs->tf_ebp;
|
||||||
frame.sf_sc.sc_ebx = regs[tEBX];
|
frame.sf_sc.sc_ebx = regs->tf_ebx;
|
||||||
frame.sf_sc.sc_edx = regs[tEDX];
|
frame.sf_sc.sc_edx = regs->tf_edx;
|
||||||
frame.sf_sc.sc_ecx = regs[tECX];
|
frame.sf_sc.sc_ecx = regs->tf_ecx;
|
||||||
frame.sf_sc.sc_eax = regs[tEAX];
|
frame.sf_sc.sc_eax = regs->tf_eax;
|
||||||
frame.sf_sc.sc_eip = regs[tEIP];
|
frame.sf_sc.sc_eip = regs->tf_eip;
|
||||||
frame.sf_sc.sc_cs = regs[tCS];
|
frame.sf_sc.sc_cs = regs->tf_cs;
|
||||||
frame.sf_sc.sc_eflags = regs[tEFLAGS];
|
frame.sf_sc.sc_eflags = regs->tf_eflags;
|
||||||
frame.sf_sc.sc_esp_at_signal = regs[tESP];
|
frame.sf_sc.sc_esp_at_signal = regs->tf_esp;
|
||||||
frame.sf_sc.sc_ss = regs[tSS];
|
frame.sf_sc.sc_ss = regs->tf_ss;
|
||||||
frame.sf_sc.sc_err = regs[tERR];
|
frame.sf_sc.sc_err = regs->tf_err;
|
||||||
frame.sf_sc.sc_trapno = code; /* XXX ???? */
|
frame.sf_sc.sc_trapno = code; /* XXX ???? */
|
||||||
|
|
||||||
if (copyout(&frame, fp, sizeof(frame)) != 0) {
|
if (copyout(&frame, fp, sizeof(frame)) != 0) {
|
||||||
@ -262,13 +262,13 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
|
|||||||
/*
|
/*
|
||||||
* Build context to run handler in.
|
* Build context to run handler in.
|
||||||
*/
|
*/
|
||||||
regs[tESP] = (int)fp;
|
regs->tf_esp = (int)fp;
|
||||||
regs[tEIP] = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
|
regs->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
|
||||||
regs[tEFLAGS] &= ~PSL_VM;
|
regs->tf_eflags &= ~PSL_VM;
|
||||||
regs[tCS] = _ucodesel;
|
regs->tf_cs = _ucodesel;
|
||||||
regs[tDS] = _udatasel;
|
regs->tf_ds = _udatasel;
|
||||||
regs[tES] = _udatasel;
|
regs->tf_es = _udatasel;
|
||||||
regs[tSS] = _udatasel;
|
regs->tf_ss = _udatasel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -288,7 +288,7 @@ linux_sigreturn(p, args, retval)
|
|||||||
int *retval;
|
int *retval;
|
||||||
{
|
{
|
||||||
struct linux_sigcontext *scp, context;
|
struct linux_sigcontext *scp, context;
|
||||||
register int *regs;
|
register struct trapframe *regs;
|
||||||
int eflags;
|
int eflags;
|
||||||
|
|
||||||
regs = p->p_md.md_regs;
|
regs = p->p_md.md_regs;
|
||||||
@ -320,7 +320,7 @@ linux_sigreturn(p, args, retval)
|
|||||||
* bit at worst causes one more or one less debugger trap, so
|
* bit at worst causes one more or one less debugger trap, so
|
||||||
* allowing it is fairly harmless.
|
* allowing it is fairly harmless.
|
||||||
*/
|
*/
|
||||||
if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs[tEFLAGS] & ~PSL_RF)) {
|
if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) {
|
||||||
return(EINVAL);
|
return(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,20 +342,20 @@ linux_sigreturn(p, args, retval)
|
|||||||
* Restore signal context.
|
* Restore signal context.
|
||||||
*/
|
*/
|
||||||
/* %fs and %gs were restored by the trampoline. */
|
/* %fs and %gs were restored by the trampoline. */
|
||||||
regs[tES] = context.sc_es;
|
regs->tf_es = context.sc_es;
|
||||||
regs[tDS] = context.sc_ds;
|
regs->tf_ds = context.sc_ds;
|
||||||
regs[tEDI] = context.sc_edi;
|
regs->tf_edi = context.sc_edi;
|
||||||
regs[tESI] = context.sc_esi;
|
regs->tf_esi = context.sc_esi;
|
||||||
regs[tEBP] = context.sc_ebp;
|
regs->tf_ebp = context.sc_ebp;
|
||||||
regs[tEBX] = context.sc_ebx;
|
regs->tf_ebx = context.sc_ebx;
|
||||||
regs[tEDX] = context.sc_edx;
|
regs->tf_edx = context.sc_edx;
|
||||||
regs[tECX] = context.sc_ecx;
|
regs->tf_ecx = context.sc_ecx;
|
||||||
regs[tEAX] = context.sc_eax;
|
regs->tf_eax = context.sc_eax;
|
||||||
regs[tEIP] = context.sc_eip;
|
regs->tf_eip = context.sc_eip;
|
||||||
regs[tCS] = context.sc_cs;
|
regs->tf_cs = context.sc_cs;
|
||||||
regs[tEFLAGS] = eflags;
|
regs->tf_eflags = eflags;
|
||||||
regs[tESP] = context.sc_esp_at_signal;
|
regs->tf_esp = context.sc_esp_at_signal;
|
||||||
regs[tSS] = context.sc_ss;
|
regs->tf_ss = context.sc_ss;
|
||||||
|
|
||||||
return (EJUSTRETURN);
|
return (EJUSTRETURN);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user