summaryrefslogtreecommitdiff
path: root/share/man/man9/vm_allocate.9
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-03-11 13:04:54 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-03-11 13:04:54 +0000
commitf0c764329290ea18f307390b5dc1b03bddacb91c (patch)
tree7fa267aef5036fd666248db194426f80e76d8bd9 /share/man/man9/vm_allocate.9
parent8bac3df8ddd2f4ae7dd7eb669a82db56e09d0968 (diff)
New pages for VM interface.
Introduction need to be expanded.
Diffstat (limited to 'share/man/man9/vm_allocate.9')
-rw-r--r--share/man/man9/vm_allocate.9119
1 files changed, 119 insertions, 0 deletions
diff --git a/share/man/man9/vm_allocate.9 b/share/man/man9/vm_allocate.9
new file mode 100644
index 00000000000..7dbee03eadd
--- /dev/null
+++ b/share/man/man9/vm_allocate.9
@@ -0,0 +1,119 @@
+.\"
+.\" $OpenBSD: vm_allocate.9,v 1.1 1996/03/11 13:04:50 mickey Exp $
+.\"
+.\" Mach Operating System
+.\" Copyright (c) 1991,1990 Carnegie Mellon University
+.\" All Rights Reserved.
+.\"
+.\" Permission to use, copy, modify and distribute this software and its
+.\" documentation is hereby granted, provided that both the copyright
+.\" notice and this permission notice appear in all copies of the
+.\" software, derivative works or modified versions, and any portions
+.\" thereof, and that both notices appear in supporting documentation.
+.\"
+.\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+.\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+.\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+.\"
+.\" Carnegie Mellon requests users of this software to return to
+.\"
+.\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+.\" School of Computer Science
+.\" Carnegie Mellon University
+.\" Pittsburgh PA 15213-3890
+.\"
+.\" any improvements or extensions that they make and grant Carnegie Mellon
+.\" the rights to redistribute these changes.
+.\"
+.TH vm_allocate 9 9/19/93
+.CM 4
+.SH NAME
+.nf
+vm_allocate \- allocates virtual memory for a task
+.SH SYNOPSIS
+.nf
+.ft B
+#include <vm/vm_extern.h>
+
+.nf
+.ft B
+int vm_allocate(map, address, size, anywhere)
+ vm_map_t map;
+ vm_address_t *address; /* in/out */
+ vm_size_t size;
+ boolean_t anywhere;
+
+
+.fi
+.ft P
+.SH ARGUMENTS
+.TP 15
+.B
+map
+Virtual address space to be affected.
+.TP 15
+.B
+address
+Starting address. If the
+.B anywhere
+option is false,
+an attempt is made to allocate virtual memory starting at
+this virtual address. If this address is not at the beginning
+of a virtual page, it will be rounded down to one.
+If there is not enough space at this address, no memory will be allocated.
+If the anywhere option is true, the input value of this address will
+be ignored, and the space will be allocated wherever it is available.
+In either case, the address at which memory was actually allocated will
+be returned in
+.B address
+.
+.TP 15
+.B
+size
+Number of bytes to allocate (rounded by the system in a
+machine dependent way to an integral number of virtual pages).
+.TP 15
+.B
+anywhere
+If true, the kernel should find and allocate any region of
+the specified size, and return the address of the resulting region in
+.B address
+. If false, virtual memory will be allocated starting at
+.B address
+, rounded to a virtual page boundary if there
+is sufficient space.
+
+.SH DESCRIPTION
+.B vm_allocate
+allocates a region of virtual memory, placing it in the
+specified task's address space. The physical memory is not actually
+allocated until the new virtual memory is referenced. By default,
+the kernel rounds all addresses down
+to the nearest page boundary and all memory sizes up to the nearest page
+size. The global variable
+.B cnt.vm_page_size
+contains the page size.
+Initially, the pages of allocated memory will be protected
+to allow all forms of access, and will be inherited in child tasks as
+a copy. Subsequent calls to
+.B vm_map_protect
+and
+.B vm_map_inherit
+may
+be used to change these properties. The allocated region is always
+zero-filled.
+
+.SH DIAGNOSTICS
+.TP 25
+KERN_SUCCESS
+Memory allocated.
+.TP 25
+KERN_INVALID_ADDRESS
+Illegal address specified.
+.TP 25
+KERN_NO_SPACE
+Not enough space left to satisfy this request
+
+.SH SEE ALSO
+.B vm_deallocate, vm_map_inherit, vm_map_protect
+