xref: /openbsd-src/share/man/man9/uvm_km_alloc.9 (revision ed8f5e8d82ace15e4cefca2c82941b15cb1a7830)
1.\"	$OpenBSD: uvm_km_alloc.9,v 1.3 2024/08/24 10:47:59 mpi Exp $
2.\"	$NetBSD: uvm.9,v 1.14 2000/06/29 06:08:44 mrg Exp $
3.\"
4.\" Copyright (c) 1998 Matthew R. Green
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd $Mdocdate: August 24 2024 $
29.Dt UVM_KM_SUBALLOC 9
30.Os
31.Sh NAME
32.Nm uvm_km_suballoc ,
33.Nm uvm_km_free
34.Nd raw kernel memory or address space allocator
35.Sh SYNOPSIS
36.In sys/param.h
37.In uvm/uvm.h
38.Fn uvm_km_suballoc "vm_map_t map" "vaddr_t *min" "vaddr_t *max " "vsize_t size" "int flags" "boolean_t fixed" "vm_map_t submap"
39.Ft void
40.Fn uvm_km_free "vm_map_t map" "vaddr_t addr" "vsize_t size"
41.Sh DESCRIPTION
42The
43.Fn uvm_km_suballoc
44function allocates submap (with the specified
45.Fa flags ,
46as described above) from
47.Fa map ,
48creating a new map if
49.Fa submap
50is
51.Dv NULL .
52The addresses of the submap can be specified exactly by setting the
53.Fa fixed
54argument to non-zero, which causes the
55.Fa min
56argument to specify the beginning of the address in the submap.
57If
58.Fa fixed
59is zero, any address of size
60.Fa size
61will be allocated from
62.Fa map
63and the start and end addresses returned in
64.Fa min
65and
66.Fa max .
67.Pp
68The
69.Fn uvm_km_free
70function free
71.Fa size
72bytes of memory in the kernel map, starting at address
73.Fa addr .
74.Sh SEE ALSO
75.Xr km_alloc 9
76