diff options
author | julian <julian@FreeBSD.org> | 1999-01-26 02:49:52 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-01-26 02:49:52 +0000 |
commit | 4b7738dba1fe295270f7b0ce61b79c90363bfda3 (patch) | |
tree | eeb7299a05695c873265454849127b2982426426 /sys/vm | |
parent | 05a22328877b551a6299973368b01a69c27c5567 (diff) | |
download | FreeBSD-src-4b7738dba1fe295270f7b0ce61b79c90363bfda3.zip FreeBSD-src-4b7738dba1fe295270f7b0ce61b79c90363bfda3.tar.gz |
Mostly remove the VM_STACK OPTION.
This changes the definitions of a few items so that structures are the
same whether or not the option itself is enabled. This allows
people to enable and disable the option without recompilng the world.
As the author says:
|I ran into a problem pulling out the VM_STACK option. I was aware of this
|when I first did the work, but then forgot about it. The VM_STACK stuff
|has some code changes in the i386 branch. There need to be corresponding
|changes in the alpha branch before it can come out completely.
what is done:
|
|1) Pull the VM_STACK option out of the header files it appears in. This
|really shouldn't affect anything that executes with or without the rest
|of the VM_STACK patches. The vm_map_entry will then always have one
|extra element (avail_ssize). It just won't be used if the VM_STACK
|option is not turned on.
|
|I've also pulled the option out of vm_map.c. This shouldn't harm anything,
|since the routines that are enabled as a result are not called unless
|the VM_STACK option is enabled elsewhere.
|
|2) Add what appears to be appropriate code the the alpha branch, still
|protected behind the VM_STACK switch. I don't have an alpha machine,
|so we would need to get some testers with alpha machines to try it out.
|
|Once there is some testing, we can consider making the change permanent
|for both i386 and alpha.
|
[..]
|
|Once the alpha code is adequately tested, we can pull VM_STACK out
|everywhere.
|
Submitted by: "Richard Seaman, Jr." <dick@tar.com>
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_extern.h | 5 | ||||
-rw-r--r-- | sys/vm/vm_map.c | 8 | ||||
-rw-r--r-- | sys/vm/vm_map.h | 6 | ||||
-rw-r--r-- | sys/vm/vm_mmap.c | 9 |
4 files changed, 9 insertions, 19 deletions
diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index ca5a53e..69a5ebb 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vm_extern.h 8.2 (Berkeley) 1/12/94 - * $Id: vm_extern.h,v 1.38 1998/06/07 17:13:09 dfr Exp $ + * $Id: vm_extern.h,v 1.39 1999/01/06 23:05:41 julian Exp $ */ #ifndef _VM_EXTERN_H_ @@ -61,11 +61,8 @@ int swapon __P((struct proc *, void *, int *)); #endif void faultin __P((struct proc *p)); -#ifndef VM_STACK int grow __P((struct proc *, size_t)); -#else int grow_stack __P((struct proc *, size_t)); -#endif int kernacc __P((caddr_t, int, int)); vm_offset_t kmem_alloc __P((vm_map_t, vm_size_t)); vm_offset_t kmem_alloc_pageable __P((vm_map_t, vm_size_t)); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 6a287b8..b1c4d82 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_map.c,v 1.141 1999/01/21 09:40:48 dillon Exp $ + * $Id: vm_map.c,v 1.142 1999/01/24 06:04:52 dillon Exp $ */ /* @@ -75,9 +75,7 @@ #include <sys/vmmeter.h> #include <sys/mman.h> #include <sys/vnode.h> -#ifdef VM_STACK #include <sys/resourcevar.h> -#endif #include <vm/vm.h> #include <vm/vm_param.h> @@ -548,9 +546,7 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, new_entry->eflags = protoeflags; new_entry->object.vm_object = object; new_entry->offset = offset; -#ifdef VM_STACK new_entry->avail_ssize = 0; -#endif if (object) { if ((object->ref_count > 1) || (object->shadow_count != 0)) { @@ -589,7 +585,6 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, return (KERN_SUCCESS); } -#ifdef VM_STACK int vm_map_stack (vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_prot_t prot, vm_prot_t max, int cow) @@ -785,7 +780,6 @@ vm_map_growstack (struct proc *p, vm_offset_t addr) return (rv); } -#endif /* * Find sufficient space for `length' bytes in the given map, starting at diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index 4d61a3f..de3e267 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_map.h,v 1.32 1998/01/22 17:30:38 dyson Exp $ + * $Id: vm_map.h,v 1.33 1999/01/06 23:05:42 julian Exp $ */ /* @@ -102,9 +102,7 @@ struct vm_map_entry { struct vm_map_entry *next; /* next entry */ vm_offset_t start; /* start address */ vm_offset_t end; /* end address */ -#ifdef VM_STACK vm_offset_t avail_ssize; /* amt can grow if this is a stack */ -#endif union vm_map_object object; /* object I point to */ vm_ooffset_t offset; /* offset into object */ u_char eflags; /* map entry flags */ @@ -338,10 +336,8 @@ void vm_map_simplify_entry __P((vm_map_t, vm_map_entry_t)); void vm_init2 __P((void)); int vm_uiomove __P((vm_map_t, vm_object_t, off_t, int, vm_offset_t, int *)); void vm_freeze_copyopts __P((vm_object_t, vm_pindex_t, vm_pindex_t)); -#ifdef VM_STACK int vm_map_stack __P((vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int)); int vm_map_growstack __P((struct proc *p, vm_offset_t addr)); -#endif #endif #endif /* _VM_MAP_ */ diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 1374dfb..ea40147 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$ * * @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94 - * $Id: vm_mmap.c,v 1.86 1999/01/06 23:05:42 julian Exp $ + * $Id: vm_mmap.c,v 1.87 1999/01/21 08:29:11 dillon Exp $ */ /* @@ -178,15 +178,18 @@ mmap(p, uap) ((flags & MAP_ANON) && uap->fd != -1)) return (EINVAL); -#ifdef VM_STACK if (flags & MAP_STACK) { +#ifdef VM_STACK if ((uap->fd != -1) || ((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE))) return (EINVAL); flags |= MAP_ANON; pos = 0; - } +#else + return (EINVAL); #endif + } + /* * Align the file position to a page boundary, * and save its page offset component. |