| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: uvm_km.9,v 1.2.4.1 2014/09/29 18:38:09 msaitoh Exp $ | | 1 | .\" $NetBSD: uvm_km.9,v 1.2.4.2 2015/04/14 13:35:33 msaitoh Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1998 Matthew R. Green | | 3 | .\" Copyright (c) 1998 Matthew R. Green |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" | | 14 | .\" |
| @@ -40,30 +40,31 @@ | | | @@ -40,30 +40,31 @@ |
40 | .Ft struct vm_map * | | 40 | .Ft struct vm_map * |
41 | .Fn uvm_km_suballoc "struct vm_map *map" "vaddr_t *min" "vaddr_t *max" \ | | 41 | .Fn uvm_km_suballoc "struct vm_map *map" "vaddr_t *min" "vaddr_t *max" \ |
42 | "vsize_t size" "int flags" "bool fixed" "struct vm_map *submap" | | 42 | "vsize_t size" "int flags" "bool fixed" "struct vm_map *submap" |
43 | .Sh DESCRIPTION | | 43 | .Sh DESCRIPTION |
44 | The UVM facility for allocation of kernel memory or address space in pages. | | 44 | The UVM facility for allocation of kernel memory or address space in pages. |
45 | Both wired and pageable memory can be allocated by this facility, as well | | 45 | Both wired and pageable memory can be allocated by this facility, as well |
46 | as kernel address space. | | 46 | as kernel address space. |
47 | Note that this is a raw allocator. | | 47 | Note that this is a raw allocator. |
48 | For general purpose memory allocation, | | 48 | For general purpose memory allocation, |
49 | .Xr kmem 9 | | 49 | .Xr kmem 9 |
50 | interface should be used. | | 50 | interface should be used. |
51 | .Sh FUNCTIONS | | 51 | .Sh FUNCTIONS |
52 | .Fn uvm_km_alloc | | 52 | .Fn uvm_km_alloc |
53 | allocates | | 53 | allocates a contiguous range of |
54 | .Fa size | | 54 | .Fa size |
55 | bytes of kernel memory in map | | 55 | bytes of kernel memory in map |
56 | .Fa map . | | 56 | .Fa map |
| | | 57 | and returns the virtual address of the range, or returns zero on failure. |
57 | The first address of the allocated memory range will be aligned according to the | | 58 | The first address of the allocated memory range will be aligned according to the |
58 | .Fa align | | 59 | .Fa align |
59 | argument | | 60 | argument |
60 | .Pq specify 0 if no alignment is necessary . | | 61 | .Pq specify 0 if no alignment is necessary . |
61 | The alignment must be a multiple of page size. | | 62 | The alignment must be a multiple of page size. |
62 | The | | 63 | The |
63 | .Fa flags | | 64 | .Fa flags |
64 | is a bitwise inclusive OR of the allocation type and operation flags. | | 65 | is a bitwise inclusive OR of the allocation type and operation flags. |
65 | .Pp | | 66 | .Pp |
66 | The allocation type should be one of: | | 67 | The allocation type should be one of: |
67 | .Bl -tag -width UVM_KMF_PAGEABLE | | 68 | .Bl -tag -width UVM_KMF_PAGEABLE |
68 | .It UVM_KMF_WIRED | | 69 | .It UVM_KMF_WIRED |
69 | Wired memory. | | 70 | Wired memory. |