Print this page
more copy-editting from Josh
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man9f/vmem_create.9f.man.txt
+++ new/usr/src/man/man9f/vmem_create.9f.man.txt
1 1 VMEM_CREATE(9F) Kernel Functions for Drivers VMEM_CREATE(9F)
2 2
3 3 NAME
4 4 vmem_create, vmem_xcreate, vmem_destroy - create and destroy vmem arenas
5 5
6 6 SYNOPSIS
7 7 #include <sys/vmem.h>
8 8
9 9 typedef struct vmem vmem_t;
10 10 typedef void *(vmem_alloc_t)(vmem_t *, size_t, int);
11 11 typedef void (vmem_free_t)(vmem_t *, void *, size_t);
12 12 typedef void *(vmem_ximport_t)(vmem_t *, size_t *, size_t, int);
13 13
14 14 vmem_t *
15 15 vmem_create(const char *name, void *base, size_t size, size_t quantum,
16 16 vmem_alloc_t *afunc, vmem_free_t *ffunc, vmem_t *source,
17 17 size_t qcache_max, int vmflag);
18 18
19 19 vmem_t *
20 20 vmem_xcreate(const char *name, void *base, size_t size, size_t quantum,
21 21 vmem_ximport_t *afunc, vmem_free_t *ffunc, vmem_t *source,
22 22 size_t qcache_max, int vmflag);
23 23
24 24 void
25 25 vmem_destroy(vmem_t *vmp);
26 26
27 27 INTERFACE LEVEL
28 28 illumos DDI specific
29 29
30 30 PARAMETERS
31 31 name A character string giving a name to the vmem arena to be created.
32 32
33 33 base An address indicating the lowest possible value in the arena.
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
34 34
35 35 size The size of the arena to create.
36 36
37 37 quantum
38 38 The arena's ``quantum''. The granularity of the arena. The
39 39 amount allocated at minimum by each request. Must be a power of
40 40 2.
41 41
42 42 afunc A function which is called to import new spans from source, which
43 43 may be NULL if this arena does not import from another. When
44 - calling vmem_create() afunc is an vmem_alloc_t a function taking
44 + calling vmem_create(), afunc is a vmem_alloc_t, a function taking
45 45 three parameters and returning a pointer to void (the imported
46 46 space):
47 47
48 48 vmem_t *
49 49 The source arena from which we'll import. The source
50 50 argument to vmem_create().
51 51
52 - size_t The size to import
52 + size_t The size to import.
53 53
54 54 int The vmflag argument used for the import.
55 55
56 - When calling vmem_xcreate() afunc is an vmem_ximport_t a function
57 - taking four parameters and returning a pointer to void (the
58 - imported space):
56 + When calling vmem_xcreate(), afunc is a vmem_ximport_t, a
57 + function taking four parameters and returning a pointer to void
58 + (the imported space):
59 59
60 60 vmem_t *
61 61 The source arena from which we'll import. The source
62 62 argument to vmem_xcreate().
63 63
64 64 size_t *
65 - The size of the import, afunc may increase this size if
65 + The size of the import. afunc may increase this size if
66 66 that is desirable, but must never decrease it.
67 67
68 68 size_t The desired alignment of the imported space.
69 69
70 - int the vmflag argument used for the import.
70 + int The vmflag argument used for the import.
71 71
72 72 ffunc A function which is called to return spans to source, which may
73 73 be NULL if this arena does not import from another. This is a
74 - vmem_free_t a function taking three parametes and returning void:
74 + vmem_free_t, a function taking three parameters and returning
75 + void:
75 76
76 77 vmem_t The arena to which space is being returned. The source
77 78 argument to vmem_create() or vmem_xcreate().
78 79
79 80 void * The span being returned to the source arena.
80 81
81 82 size_t The size of the span being returned to the source arena.
82 83
83 84 source An arena from which this arena will import, which may be NULL if
84 85 this arena does not import from another.
85 86
86 87 qcache_max
87 88 Each arena offers caching of integer multiples of quantum up to
88 89 qcache_max, which may be 0.
89 90
90 91 vmflag A bitmask of flags indicating the characteristics of this arena.
91 92
92 93 VMC_IDENTIFIER
93 94 The arena represents arbitrary integer identifiers,
94 95 rather than virtual memory.
95 96
96 97 vmp A pointer to the vmem arena to be destroyed.
97 98
98 99 DESCRIPTION
99 100 A vmem arena is a section of an arbitrary address space (a range of
100 101 integer addresses). This commonly represents virtual memory, but can in
101 102 fact be an arbitrary set of integers. The VMC_IDENTIFIER flag set at
102 103 arena creation time differentiates between these two cases.
103 104
104 105 The afunc, ffunc, and source arguments combine to support a hierarchical
105 106 structure of arenas, each importing from a single parent (the source).
106 107 The vmem_create() and vmem_xcreate() functions differ in that the latter
107 108 provides an interface for afunc to alter the size of the span imported
108 109 from source. It is only legal to increase this size.
109 110
110 111 CONTEXT
111 112 These functions can be called from user or kernel context.
112 113
113 114 RETURN VALUES
114 115 Upon successful completion the vmem_create() and vmem_xcreate() functions
115 116 return a pointer to a vmem arena. Otherwise, NULL is returned to
116 117 indicate the arena could not be created.
117 118
118 119 SEE ALSO
119 120 vmem(9), vmem_add(9F), vmem_alloc(9F)
120 121
121 122 illumos January 18, 2017 illumos
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX