Replace MACHINE/CHIP macros with compiler macros
This commit is contained in:
@@ -250,7 +250,7 @@ void system_init(void)
|
||||
map(SYS_PROFBUF, do_profbuf); /* announce locations to kernel */
|
||||
|
||||
/* i386-specific. */
|
||||
#if _MINIX_CHIP == _CHIP_INTEL
|
||||
#if defined(__i386__)
|
||||
map(SYS_READBIOS, do_readbios); /* read from BIOS locations */
|
||||
map(SYS_IOPENABLE, do_iopenable); /* Enable I/O */
|
||||
map(SYS_SDEVIO, do_sdevio); /* phys_insb, _insw, _outsb, _outsw */
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
int do_fork(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
/* Handle sys_fork(). PR_ENDPT has forked. The child is PR_SLOT. */
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
char *old_fpu_save_area_p;
|
||||
#endif
|
||||
register struct proc *rpc; /* child process pointer */
|
||||
@@ -53,11 +53,11 @@ int do_fork(struct proc * caller, message * m_ptr)
|
||||
save_fpu(rpp);
|
||||
/* Copy parent 'proc' struct to child. And reinitialize some fields. */
|
||||
gen = _ENDPOINT_G(rpc->p_endpoint);
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
old_fpu_save_area_p = rpc->p_seg.fpu_state;
|
||||
#endif
|
||||
*rpc = *rpp; /* copy 'proc' struct */
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
rpc->p_seg.fpu_state = old_fpu_save_area_p;
|
||||
if(proc_used_fpu(rpp))
|
||||
memcpy(rpc->p_seg.fpu_state, rpp->p_seg.fpu_state, FPU_XFP_SIZE);
|
||||
|
||||
@@ -28,7 +28,7 @@ int do_getmcontext(struct proc * caller, message * m_ptr)
|
||||
if (iskerneln(proc_nr)) return(EPERM);
|
||||
rp = proc_addr(proc_nr);
|
||||
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
if (!proc_used_fpu(rp))
|
||||
return(OK); /* No state to copy */
|
||||
#endif
|
||||
@@ -38,7 +38,7 @@ int do_getmcontext(struct proc * caller, message * m_ptr)
|
||||
(vir_bytes) &mc, (phys_bytes) sizeof(struct __mcontext))) != OK)
|
||||
return(r);
|
||||
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
/* Copy FPU state */
|
||||
mc.mc_fpu_flags = 0;
|
||||
if (proc_used_fpu(rp)) {
|
||||
@@ -79,7 +79,7 @@ int do_setmcontext(struct proc * caller, message * m_ptr)
|
||||
(vir_bytes) &mc, (phys_bytes) sizeof(struct __mcontext))) != OK)
|
||||
return(r);
|
||||
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
/* Copy FPU state */
|
||||
if (mc.mc_fpu_flags & MF_FPU_INITIALIZED) {
|
||||
rp->p_misc_flags |= MF_FPU_INITIALIZED;
|
||||
|
||||
@@ -38,7 +38,7 @@ int do_sigreturn(struct proc * caller, message * m_ptr)
|
||||
sc.sc_psw = (sc.sc_psw & X86_FLAGS_USER) |
|
||||
(rp->p_reg.psw & ~X86_FLAGS_USER);
|
||||
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
/* Don't panic kernel if user gave bad selectors. */
|
||||
sc.sc_cs = rp->p_reg.cs;
|
||||
sc.sc_ds = rp->p_reg.ds;
|
||||
@@ -52,7 +52,7 @@ int do_sigreturn(struct proc * caller, message * m_ptr)
|
||||
|
||||
/* Restore the registers. */
|
||||
memcpy(&rp->p_reg, &sc.sc_regs, sizeof(sigregs));
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
if(sc.sc_flags & MF_FPU_INITIALIZED)
|
||||
{
|
||||
memcpy(rp->p_seg.fpu_state, &sc.sc_fpu_state, FPU_XFP_SIZE);
|
||||
|
||||
@@ -42,7 +42,7 @@ int do_sigsend(struct proc * caller, message * m_ptr)
|
||||
|
||||
/* Copy the registers to the sigcontext structure. */
|
||||
memcpy(&sc.sc_regs, (char *) &rp->p_reg, sizeof(sigregs));
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
if(proc_used_fpu(rp)) {
|
||||
/* save the FPU context before saving it to the sig context */
|
||||
save_fpu(rp);
|
||||
|
||||
@@ -135,7 +135,7 @@ int do_trace(struct proc * caller, message * m_ptr)
|
||||
tr_addr > sizeof(struct stackframe_s) - sizeof(reg_t))
|
||||
return(EFAULT);
|
||||
i = (int) tr_addr;
|
||||
#if (_MINIX_CHIP == _CHIP_INTEL)
|
||||
#if defined(__i386__)
|
||||
/* Altering segment registers might crash the kernel when it
|
||||
* tries to load them prior to restarting a process, so do
|
||||
* not allow it.
|
||||
|
||||
Reference in New Issue
Block a user