summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-08-05 00:02:08 +0000
committerdyson <dyson@FreeBSD.org>1997-08-05 00:02:08 +0000
commit8fa8ae3d0d6a785deced2be3e7fd647f31aaf23e (patch)
treec5bee309962268ed673826beec543a2de0ff70aa /sys/kern
parent257e5090900068920bc5af171dec41a2939a084f (diff)
downloadFreeBSD-src-8fa8ae3d0d6a785deced2be3e7fd647f31aaf23e.zip
FreeBSD-src-8fa8ae3d0d6a785deced2be3e7fd647f31aaf23e.tar.gz
Get rid of the ad-hoc memory allocator for vm_map_entries, in lieu of
a simple, clean zone type allocator. This new allocator will also be used for machine dependent pmap PV entries.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/init_main.c7
-rw-r--r--sys/kern/kern_malloc.c6
-rw-r--r--sys/kern/sys_pipe.c18
3 files changed, 28 insertions, 3 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 5cc1c4a..0e474ba 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
- * $Id: init_main.c,v 1.65 1997/06/22 16:04:09 peter Exp $
+ * $Id: init_main.c,v 1.66 1997/07/10 11:44:42 davidn Exp $
*/
#include "opt_rlimit.h"
@@ -319,6 +319,11 @@ proc0_init(dummy)
sleepinit();
/*
+ * additional VM structures
+ */
+ vm_init2();
+
+ /*
* Create process 0 (the swapper).
*/
LIST_INSERT_HEAD(&allproc, p, p_list);
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index a0a470f..62ab7fc 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94
- * $Id: kern_malloc.c,v 1.26 1997/02/22 09:39:07 peter Exp $
+ * $Id: kern_malloc.c,v 1.27 1997/06/24 09:41:00 davidg Exp $
*/
#include <sys/param.h>
@@ -41,11 +41,14 @@
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/vmmeter.h>
+#include <sys/lock.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_kern.h>
#include <vm/vm_extern.h>
+#include <vm/pmap.h>
+#include <vm/vm_map.h>
static void kmeminit __P((void *));
SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
@@ -402,6 +405,7 @@ kmeminit(dummy)
kmem_map = kmem_suballoc(kernel_map, (vm_offset_t *)&kmembase,
(vm_offset_t *)&kmemlimit, (vm_size_t)(npg * PAGE_SIZE),
FALSE);
+ kmem_map->system_map = 1;
#ifdef KMEMSTATS
for (indx = 0; indx < MINBUCKET + 16; indx++) {
if (1 << indx >= PAGE_SIZE)
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 53e1345..d2f36fd 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: sys_pipe.c,v 1.27 1997/03/24 11:52:26 bde Exp $
+ * $Id: sys_pipe.c,v 1.28 1997/04/09 16:53:39 bde Exp $
*/
/*
@@ -80,6 +80,7 @@
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_page.h>
+#include <vm/vm_zone.h>
/*
* Use this define if you want to disable *fancy* VM things. Expect an
@@ -144,6 +145,8 @@ static void pipe_clone_write_buffer __P((struct pipe *wpipe));
#endif
static void pipespace __P((struct pipe *cpipe));
+vm_zone_t pipe_zone;
+
/*
* The pipe system call for the DTYPE_PIPE type of pipes
*/
@@ -162,10 +165,20 @@ pipe(p, uap, retval)
struct pipe *rpipe, *wpipe;
int fd, error;
+ if (pipe_zone == NULL)
+ pipe_zone = zinit("PIPE", sizeof (struct pipe), 0,
+ ZONE_WAIT, 4);
+
+ rpipe = zalloc( pipe_zone);
+/*
rpipe = malloc( sizeof (*rpipe), M_TEMP, M_WAITOK);
+*/
pipeinit(rpipe);
rpipe->pipe_state |= PIPE_DIRECTOK;
+/*
wpipe = malloc( sizeof (*wpipe), M_TEMP, M_WAITOK);
+*/
+ wpipe = zalloc( pipe_zone);
pipeinit(wpipe);
wpipe->pipe_state |= PIPE_DIRECTOK;
@@ -1099,6 +1112,9 @@ pipeclose(cpipe)
cpipe->pipe_buffer.size + PAGE_SIZE);
}
#endif
+ zfree(pipe_zone, cpipe);
+/*
free(cpipe, M_TEMP);
+*/
}
}
OpenPOWER on IntegriCloud