17d216f0fSBruce M Simpson.\" 27d216f0fSBruce M Simpson.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org> 37d216f0fSBruce M Simpson.\" All rights reserved. 47d216f0fSBruce M Simpson.\" 57d216f0fSBruce M Simpson.\" Redistribution and use in source and binary forms, with or without 67d216f0fSBruce M Simpson.\" modification, are permitted provided that the following conditions 77d216f0fSBruce M Simpson.\" are met: 87d216f0fSBruce M Simpson.\" 1. Redistributions of source code must retain the above copyright 97d216f0fSBruce M Simpson.\" notice, this list of conditions and the following disclaimer. 107d216f0fSBruce M Simpson.\" 2. Redistributions in binary form must reproduce the above copyright 117d216f0fSBruce M Simpson.\" notice, this list of conditions and the following disclaimer in the 127d216f0fSBruce M Simpson.\" documentation and/or other materials provided with the distribution. 137d216f0fSBruce M Simpson.\" 147d216f0fSBruce M Simpson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 157d216f0fSBruce M Simpson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 167d216f0fSBruce M Simpson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 177d216f0fSBruce M Simpson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 187d216f0fSBruce M Simpson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 197d216f0fSBruce M Simpson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 207d216f0fSBruce M Simpson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 217d216f0fSBruce M Simpson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 227d216f0fSBruce M Simpson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 237d216f0fSBruce M Simpson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 247d216f0fSBruce M Simpson.\" SUCH DAMAGE. 257d216f0fSBruce M Simpson.\" 26e86fef2aSSergey Kandaurov.Dd January 11, 2013 27a970c85cSRuslan Ermilov.Dt VM_MAP_INSERT 9 28b4ca3754SRuslan Ermilov.Os 297d216f0fSBruce M Simpson.Sh NAME 307d216f0fSBruce M Simpson.Nm vm_map_insert 317d216f0fSBruce M Simpson.Nd insert an object into a map 327d216f0fSBruce M Simpson.Sh SYNOPSIS 337d216f0fSBruce M Simpson.In sys/param.h 347d216f0fSBruce M Simpson.In vm/vm.h 357d216f0fSBruce M Simpson.In vm/vm_map.h 367d216f0fSBruce M Simpson.Ft int 37a970c85cSRuslan Ermilov.Fo vm_map_insert 38a970c85cSRuslan Ermilov.Fa "vm_map_t map" "vm_object_t object" "vm_ooffset_t offset" 39a970c85cSRuslan Ermilov.Fa "vm_offset_t start" "vm_offset_t end" "vm_prot_t prot" 40a970c85cSRuslan Ermilov.Fa "vm_prot_t max" "int cow" 41a970c85cSRuslan Ermilov.Fc 427d216f0fSBruce M Simpson.Sh DESCRIPTION 437d216f0fSBruce M SimpsonThe 447d216f0fSBruce M Simpson.Fn vm_map_insert 457d216f0fSBruce M Simpsonfunction inserts a mapping for the entire vm_object 467d216f0fSBruce M Simpson.Fa object 477d216f0fSBruce M Simpsoninto the target map 487d216f0fSBruce M Simpson.Fa map . 497d216f0fSBruce M Simpson.Pp 507d216f0fSBruce M SimpsonThe 517d216f0fSBruce M Simpson.Fa offset 527d216f0fSBruce M Simpsonargument specifies the offset into the 537d216f0fSBruce M Simpson.Fa object 547d216f0fSBruce M Simpsonat which to begin mapping. 557d216f0fSBruce M SimpsonThe object's size should match that of the specified address range. 567d216f0fSBruce M Simpson.Pp 577d216f0fSBruce M SimpsonThe 587d216f0fSBruce M Simpson.Fa start 597d216f0fSBruce M Simpsonand 607d216f0fSBruce M Simpson.Fa end 617d216f0fSBruce M Simpsonarguments specify the bounds of the mapped object's window in the 627d216f0fSBruce M Simpsonaddress space of 637d216f0fSBruce M Simpson.Fa map . 647d216f0fSBruce M Simpson.Pp 657d216f0fSBruce M SimpsonThe 667d216f0fSBruce M Simpson.Fa cow 672988974bSMike Pritchardargument specifies the flags which should be propagated to the new entry, 687d216f0fSBruce M Simpsonfor example, to indicate that this is a copy-on-write mapping. 697d216f0fSBruce M Simpson.Sh IMPLEMENTATION NOTES 702988974bSMike PritchardThis function implicitly creates a new 71a970c85cSRuslan Ermilov.Vt vm_map_entry 727d216f0fSBruce M Simpsonby calling the internal function 737d216f0fSBruce M Simpson.Fn vm_map_entry_create . 747d216f0fSBruce M Simpson.Sh RETURN VALUES 757d216f0fSBruce M SimpsonThe 767d216f0fSBruce M Simpson.Fn vm_map_insert 777d216f0fSBruce M Simpsonfunction returns 787d216f0fSBruce M Simpson.Dv KERN_SUCCESS 797d216f0fSBruce M Simpsonif the mapping could be made successfully. 807d216f0fSBruce M Simpson.Pp 817d216f0fSBruce M SimpsonOtherwise, 827d216f0fSBruce M Simpson.Dv KERN_INVALID_ADDRESS 837d216f0fSBruce M Simpsonwill be returned if the start of the range could not be found, or 847d216f0fSBruce M Simpson.Dv KERN_NO_SPACE 857d216f0fSBruce M Simpsonif the range was found to be part of an existing entry or if it 867d216f0fSBruce M Simpsonoverlaps the end of the map. 877d216f0fSBruce M Simpson.Sh SEE ALSO 887d216f0fSBruce M Simpson.Xr vm_map 9 897d216f0fSBruce M Simpson.Sh AUTHORS 90571dba6eSHiten PandyaThis manual page was written by 91*8a7314fcSBaptiste Daroussin.An Bruce M Simpson Aq Mt bms@spc.org . 92