mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Ifdefed some SMP and VM86 code. Note that although VM86 is not a global
option, the ifdef on it in a header works because only the name of the VM86 extension is hidden.
This commit is contained in:
parent
5099706acd
commit
a8961a8284
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=33051
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.284 1998/01/25 12:01:16 kato Exp $
|
||||
* $Id: machdep.c,v 1.285 1998/01/30 10:26:20 dyson Exp $
|
||||
*/
|
||||
|
||||
#include "apm.h"
|
||||
@ -544,6 +544,7 @@ sendsig(catcher, sig, mask, code)
|
||||
sf.sf_sc.sc_trapno = regs->tf_trapno;
|
||||
sf.sf_sc.sc_err = regs->tf_err;
|
||||
|
||||
#ifdef VM86
|
||||
/*
|
||||
* If we're a vm86 process, we want to save the segment registers.
|
||||
* We also change eflags to be our emulated eflags, not the actual
|
||||
@ -569,6 +570,7 @@ sendsig(catcher, sig, mask, code)
|
||||
*/
|
||||
tf->tf_eflags &= ~(PSL_VM | PSL_T | PSL_VIF | PSL_VIP);
|
||||
}
|
||||
#endif /* VM86 */
|
||||
|
||||
/*
|
||||
* Copy the sigframe out to the user's stack.
|
||||
@ -624,6 +626,7 @@ sigreturn(p, uap)
|
||||
return(EFAULT);
|
||||
|
||||
eflags = scp->sc_ps;
|
||||
#ifdef VM86
|
||||
if (eflags & PSL_VM) {
|
||||
struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs;
|
||||
struct vm86_kernel *vm86;
|
||||
@ -658,6 +661,7 @@ sigreturn(p, uap)
|
||||
tf->tf_ds = _udatasel;
|
||||
tf->tf_es = _udatasel;
|
||||
} else {
|
||||
#endif /* VM86 */
|
||||
/*
|
||||
* Don't allow users to change privileged or reserved flags.
|
||||
*/
|
||||
@ -694,7 +698,10 @@ sigreturn(p, uap)
|
||||
}
|
||||
regs->tf_ds = scp->sc_ds;
|
||||
regs->tf_es = scp->sc_es;
|
||||
#ifdef VM86
|
||||
}
|
||||
#endif
|
||||
|
||||
/* restore scratch registers */
|
||||
regs->tf_eax = scp->sc_eax;
|
||||
regs->tf_ebx = scp->sc_ebx;
|
||||
@ -1543,8 +1550,12 @@ init386(first)
|
||||
/* setup proc 0's pcb */
|
||||
proc0.p_addr->u_pcb.pcb_flags = 0;
|
||||
proc0.p_addr->u_pcb.pcb_cr3 = (int)IdlePTD;
|
||||
#ifdef SMP
|
||||
proc0.p_addr->u_pcb.pcb_mpnest = 1;
|
||||
#endif
|
||||
#ifdef VM86
|
||||
proc0.p_addr->u_pcb.pcb_ext = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)pcb.h 5.10 (Berkeley) 5/12/91
|
||||
* $Id: pcb.h,v 1.24 1997/08/09 00:03:18 dyson Exp $
|
||||
* $Id: pcb.h,v 1.25 1997/10/10 12:40:09 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I386_PCB_H_
|
||||
@ -59,10 +59,18 @@ struct pcb {
|
||||
u_char pcb_flags;
|
||||
#define FP_SOFTFP 0x01 /* process using software fltng pnt emulator */
|
||||
caddr_t pcb_onfault; /* copyin/out fault recovery */
|
||||
#ifdef SMP
|
||||
u_long pcb_mpnest;
|
||||
#else
|
||||
u_long pcb_mpnest_dontuse;
|
||||
#endif
|
||||
int pcb_fs;
|
||||
int pcb_gs;
|
||||
#ifdef VM86
|
||||
struct pcb_ext *pcb_ext; /* optional pcb extension */
|
||||
#else
|
||||
struct pcb_ext *pcb_ext_dontuse;
|
||||
#endif
|
||||
u_long __pcb_spare[1]; /* adjust to avoid core dump size changes */
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.284 1998/01/25 12:01:16 kato Exp $
|
||||
* $Id: machdep.c,v 1.285 1998/01/30 10:26:20 dyson Exp $
|
||||
*/
|
||||
|
||||
#include "apm.h"
|
||||
@ -544,6 +544,7 @@ sendsig(catcher, sig, mask, code)
|
||||
sf.sf_sc.sc_trapno = regs->tf_trapno;
|
||||
sf.sf_sc.sc_err = regs->tf_err;
|
||||
|
||||
#ifdef VM86
|
||||
/*
|
||||
* If we're a vm86 process, we want to save the segment registers.
|
||||
* We also change eflags to be our emulated eflags, not the actual
|
||||
@ -569,6 +570,7 @@ sendsig(catcher, sig, mask, code)
|
||||
*/
|
||||
tf->tf_eflags &= ~(PSL_VM | PSL_T | PSL_VIF | PSL_VIP);
|
||||
}
|
||||
#endif /* VM86 */
|
||||
|
||||
/*
|
||||
* Copy the sigframe out to the user's stack.
|
||||
@ -624,6 +626,7 @@ sigreturn(p, uap)
|
||||
return(EFAULT);
|
||||
|
||||
eflags = scp->sc_ps;
|
||||
#ifdef VM86
|
||||
if (eflags & PSL_VM) {
|
||||
struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs;
|
||||
struct vm86_kernel *vm86;
|
||||
@ -658,6 +661,7 @@ sigreturn(p, uap)
|
||||
tf->tf_ds = _udatasel;
|
||||
tf->tf_es = _udatasel;
|
||||
} else {
|
||||
#endif /* VM86 */
|
||||
/*
|
||||
* Don't allow users to change privileged or reserved flags.
|
||||
*/
|
||||
@ -694,7 +698,10 @@ sigreturn(p, uap)
|
||||
}
|
||||
regs->tf_ds = scp->sc_ds;
|
||||
regs->tf_es = scp->sc_es;
|
||||
#ifdef VM86
|
||||
}
|
||||
#endif
|
||||
|
||||
/* restore scratch registers */
|
||||
regs->tf_eax = scp->sc_eax;
|
||||
regs->tf_ebx = scp->sc_ebx;
|
||||
@ -1543,8 +1550,12 @@ init386(first)
|
||||
/* setup proc 0's pcb */
|
||||
proc0.p_addr->u_pcb.pcb_flags = 0;
|
||||
proc0.p_addr->u_pcb.pcb_cr3 = (int)IdlePTD;
|
||||
#ifdef SMP
|
||||
proc0.p_addr->u_pcb.pcb_mpnest = 1;
|
||||
#endif
|
||||
#ifdef VM86
|
||||
proc0.p_addr->u_pcb.pcb_ext = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
|
||||
|
@ -23,9 +23,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: vm86.c,v 1.4 1997/10/10 12:42:50 peter Exp $
|
||||
* $Id: vm86.c,v 1.5 1997/11/20 18:43:46 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_vm86.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)pcb.h 5.10 (Berkeley) 5/12/91
|
||||
* $Id: pcb.h,v 1.24 1997/08/09 00:03:18 dyson Exp $
|
||||
* $Id: pcb.h,v 1.25 1997/10/10 12:40:09 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I386_PCB_H_
|
||||
@ -59,10 +59,18 @@ struct pcb {
|
||||
u_char pcb_flags;
|
||||
#define FP_SOFTFP 0x01 /* process using software fltng pnt emulator */
|
||||
caddr_t pcb_onfault; /* copyin/out fault recovery */
|
||||
#ifdef SMP
|
||||
u_long pcb_mpnest;
|
||||
#else
|
||||
u_long pcb_mpnest_dontuse;
|
||||
#endif
|
||||
int pcb_fs;
|
||||
int pcb_gs;
|
||||
#ifdef VM86
|
||||
struct pcb_ext *pcb_ext; /* optional pcb extension */
|
||||
#else
|
||||
struct pcb_ext *pcb_ext_dontuse;
|
||||
#endif
|
||||
u_long __pcb_spare[1]; /* adjust to avoid core dump size changes */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user