write_cr4(cr4);
}
+/*===========================================================================*
+ * umap_bios *
+ *===========================================================================*/
+phys_bytes umap_bios(vir_addr, bytes)
+vir_bytes vir_addr; /* virtual address in BIOS segment */
+vir_bytes bytes; /* # of bytes to be copied */
+{
+/* Calculate the physical memory address at the BIOS. Note: currently, BIOS
+ * address zero (the first BIOS interrupt vector) is not considered as an
+ * error here, but since the physical address will be zero as well, the
+ * calling function will think an error occurred. This is not a problem,
+ * since no one uses the first BIOS interrupt vector.
+ */
+
+ /* Check all acceptable ranges. */
+ if (vir_addr >= BIOS_MEM_BEGIN && vir_addr + bytes <= BIOS_MEM_END)
+ return (phys_bytes) vir_addr;
+ else if (vir_addr >= BASE_MEM_TOP && vir_addr + bytes <= UPPER_MEM_END)
+ return (phys_bytes) vir_addr;
+
+ printf("Warning, error in umap_bios, virtual address 0x%lx\n", vir_addr);
+ return 0;
+}
+
/*===========================================================================*
* umap_local *
*===========================================================================*/
set_idle_name(ip->p_name, i);
}
+#if (_MINIX_CHIP == _CHIP_INTEL)
for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; ++rp) {
/*
* FXSR requires 16-byte alignment of memory image, but
rp->p_fpu_state.fpu_save_area_p =
(void *) aligned_fp_area;
}
+#endif
}
static void switch_address_space_idle(void)
umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes))
void clear_endpoint(struct proc *rc);
void clear_ipc_refs(struct proc *rc, int caller_ret);
-phys_bytes umap_bios(vir_bytes vir_addr, vir_bytes bytes);
void kernel_call_resume(struct proc *p);
int sched_proc(struct proc *rp, int priority, int quantum, int cpu);
from_addr, endpoint_t to, vir_bytes to_addr, size_t bytes);
void alloc_segments(struct proc *rp);
void vm_stop(void);
+phys_bytes umap_bios(vir_bytes vir_addr, vir_bytes bytes);
phys_bytes umap_local(register struct proc *rp, int seg, vir_bytes
vir_addr, vir_bytes bytes);
phys_bytes umap_virtual(struct proc* rp, int seg, vir_bytes vir_addr,
* send_sig: send a signal directly to a system process
* cause_sig: take action to cause a signal to occur via a signal mgr
* sig_delay_done: tell PM that a process is not sending
- * umap_bios: map virtual address in BIOS_SEG to physical
* get_randomness: accumulate randomness in a buffer
* clear_endpoint: remove a process' ability to send and receive messages
* sched_proc: schedule a process
cause_sig(proc_nr(rp), SIGSNDELAY);
}
-#if _MINIX_CHIP == _CHIP_INTEL
-
-/*===========================================================================*
- * umap_bios *
- *===========================================================================*/
-phys_bytes umap_bios(vir_addr, bytes)
-vir_bytes vir_addr; /* virtual address in BIOS segment */
-vir_bytes bytes; /* # of bytes to be copied */
-{
-/* Calculate the physical memory address at the BIOS. Note: currently, BIOS
- * address zero (the first BIOS interrupt vector) is not considered as an
- * error here, but since the physical address will be zero as well, the
- * calling function will think an error occurred. This is not a problem,
- * since no one uses the first BIOS interrupt vector.
- */
-
- /* Check all acceptable ranges. */
- if (vir_addr >= BIOS_MEM_BEGIN && vir_addr + bytes <= BIOS_MEM_END)
- return (phys_bytes) vir_addr;
- else if (vir_addr >= BASE_MEM_TOP && vir_addr + bytes <= UPPER_MEM_END)
- return (phys_bytes) vir_addr;
-
- printf("Warning, error in umap_bios, virtual address 0x%x\n", vir_addr);
- return 0;
-}
-#endif
-
/*===========================================================================*
* clear_ipc *
*===========================================================================*/
*===========================================================================*/
static void adjust_proc_slot(struct proc *rp, struct proc *from_rp)
{
- /* Preserve endpoints, slot numbers, priv structure, IPC, FPU pointer. */
+ /* Preserve endpoints, slot numbers, priv structure, and IPC. */
rp->p_endpoint = from_rp->p_endpoint;
rp->p_nr = from_rp->p_nr;
rp->p_priv = from_rp->p_priv;
priv(rp)->s_proc_nr = from_rp->p_nr;
rp->p_caller_q = from_rp->p_caller_q;
+
+#if (_MINIX_CHIP == _CHIP_INTEL)
+ /* Preserve FPU pointer. */
rp->p_fpu_state.fpu_save_area_p = from_rp->p_fpu_state.fpu_save_area_p;
+#endif
/* preserve scheduling */
rp->p_scheduler = from_rp->p_scheduler;
/* Copy the FPU state from process B's copied slot, using B's original FPU
* save area alignment, into process A's slot.
*/
+#if (_MINIX_CHIP == _CHIP_INTEL)
int align;
align = (int) ((char *) b_orig_rp->p_fpu_state.fpu_save_area_p -
memcpy(a_rp->p_fpu_state.fpu_save_area_p,
b_copy_rp->p_fpu_state.fpu_image + align, FPU_XFP_SIZE);
+#endif
}
/*===========================================================================*