summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/cpu.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-04-07 07:16:06 +0000
committerpeter <peter@FreeBSD.org>1997-04-07 07:16:06 +0000
commitecf50a7463380158994f03aa71d9b084c0c5114a (patch)
treeec1548851ef256720ebb6254e235cc3d5bc04523 /sys/amd64/include/cpu.h
parent237ff29ca4d094b8fbf6c41083b91ddda096ae46 (diff)
downloadFreeBSD-src-ecf50a7463380158994f03aa71d9b084c0c5114a.zip
FreeBSD-src-ecf50a7463380158994f03aa71d9b084c0c5114a.tar.gz
The biggie: Get rid of the UPAGES from the top of the per-process address
space. (!) Have each process use the kernel stack and pcb in the kvm space. Since the stacks are at a different address, we cannot copy the stack at fork() and allow the child to return up through the function call tree to return to user mode - create a new execution context and have the new process begin executing from cpu_switch() and go to user mode directly. In theory this should speed up fork a bit. Context switch the tss_esp0 pointer in the common tss. This is a lot simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer to each process's tss since the esp0 pointer is a 32 bit pointer, and the sd_base setting is split into three different bit sections at non-aligned boundaries and requires a lot of twiddling to reset. The 8K of memory at the top of the process space is now empty, and unmapped (and unmappable, it's higher than VM_MAXUSER_ADDRESS). Simplity the pmap code to manage process contexts, we no longer have to double map the UPAGES, this simplifies and should measuably speed up fork(). The following parts came from John Dyson: Set PG_G on the UPAGES that are now in kernel context, and invalidate them when swapping them out. Move the upages object (upobj) from the vmspace to the proc structure. Now that the UPAGES (pcb and kernel stack) are out of user space, make rfork(..RFMEM..) do what was intended by sharing the vmspace entirely via reference counting rather than simply inheriting the mappings.
Diffstat (limited to 'sys/amd64/include/cpu.h')
-rw-r--r--sys/amd64/include/cpu.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h
index ff0c70c..d28079a 100644
--- a/sys/amd64/include/cpu.h
+++ b/sys/amd64/include/cpu.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
- * $Id$
+ * $Id: cpu.h,v 1.28 1997/02/22 09:34:04 peter Exp $
*/
#ifndef _MACHINE_CPU_H_
@@ -134,6 +134,10 @@ extern int cpu;
extern int cpu_class;
extern u_char intr_nesting_level;
extern int want_resched; /* resched was called */
+
+void fork_trampoline __P((void));
+void fork_return __P((struct proc *, struct trapframe));
+void cpu_set_fork_handler __P((struct proc *, void (*pc)(void *), void *));
#endif
#endif /* !_MACHINE_CPU_H_ */
OpenPOWER on IntegriCloud