Print this page
12743 man page spelling mistakes
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3ext/efi_alloc_and_init.3ext
+++ new/usr/src/man/man3ext/efi_alloc_and_init.3ext
1 1 '\" te
2 2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 3 .\" Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
4 4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 -.TH EFI_ALLOC_AND_INIT 3EXT "November 20, 2019"
7 +.TH EFI_ALLOC_AND_INIT 3EXT "May 16, 2020"
8 8 .SH NAME
9 9 efi_alloc_and_init, efi_alloc_and_read, efi_free, efi_write, efi_use_whole_disk,
10 10 efi_reserved_sectors \- manipulate a disk's EFI Partition Table
11 11 .SH SYNOPSIS
12 12 .nf
13 13 cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-lefi\fR [ \fIlibrary \&.\|.\|.\fR ]
14 14 #include <sys/vtoc.h>
15 15 #include <sys/efi_partition.h>
16 16
17 17 \fBint\fR \fBefi_alloc_and_init\fR(\fBint\fR \fIfd\fR, \fBuint32_t\fR \fInparts\fR, \fBdk_gpt_t **\fR\fIvtoc\fR);
18 18 .fi
19 19
20 20 .LP
21 21 .nf
22 22 \fBint\fR \fBefi_alloc_and_read\fR(\fBint\fR \fIfd\fR, \fBdk_gpt_t **\fR\fIvtoc\fR);
23 23 .fi
24 24
25 25 .LP
26 26 .nf
27 27 \fBvoid\fR \fBefi_free\fR(\fBdk_gpt_t *\fR\fIvtoc\fR);
28 28 .fi
29 29
30 30 .LP
31 31 .nf
32 32 \fBint\fR \fBefi_write\fR(\fBint\fR \fIfd\fR, \fBdk_gpt_t *\fR\fIvtoc\fR);
33 33 .fi
34 34
35 35 .LP
36 36 .nf
37 37 \fBint\fR \fBefi_use_whole_disk\fR(\fBint\fR \fIfd\fR);
38 38 .fi
39 39
40 40 .LP
41 41 .nf
42 42 \fBuint_t\fR \fBefi_reserved_sectors\fR(\fBdk_gpt_t *\fR\fIvtoc\fR);
43 43 .fi
44 44
45 45 .SH DESCRIPTION
46 46 The \fBefi_alloc_and_init()\fR function initializes the \fBdk_gpt_t\fR
47 47 structure specified by \fIvtoc\fR in preparation for a call to
48 48 \fBefi_write()\fR. It calculates and initializes the \fBefi_version\fR,
49 49 \fBefi_lbasize\fR, \fBefi_nparts\fR, \fBefi_first_u_lba\fR, \fBefi_last_lba\fR,
50 50 and \fBefi_last_u_lba\fR members of this structure. The caller can then set the
51 51 \fBefi_nparts\fR member.
52 52 .sp
53 53 .LP
54 54 The \fBefi_alloc_and_read()\fR function allocates memory and returns the
55 55 partition table.
56 56 .sp
57 57 .LP
58 58 The \fBefi_free()\fR function frees the memory allocated by
59 59 \fBefi_alloc_and_init()\fR and \fBefi_alloc_and_read()\fR.
60 60 .sp
61 61 .LP
62 62 The \fBefi_write()\fR function writes the EFI partition table and creates a
63 63 Protective Master Boot Record (PMBR); see below.
64 64 .sp
65 65 .LP
66 66 The \fBefi_use_whole_disk()\fR function takes any space that is not contained
67 67 in the disk label and adds it to the last physically non-zero area before the
68 68 reserved slice (from slice 0 to slice 6 or unallocated space).
69 69 .sp
70 70 .LP
71 71 The \fBefi_reserved_sectors()\fR function calculates number of sectors
72 72 needed to create the reserved partition. The reserved partition is used
73 73 by the operating system for internal purposes. The sector size used is
74 74 based on the device and is recorded in the \fBefi_lbasize\fR member of
75 75 the \fBdkgpt_t\fR structure indicated by the \fIvtoc\fR argument.
76 76 A full description of the \fBdk_gpt_t\fR structure appears later in the manual.
77 77 .sp
78 78 .LP
79 79 The \fIfd\fR argument refers to any slice on a raw disk, opened with
80 80 \fBO_NDELAY\fR. See \fBopen\fR(2).
81 81 .sp
82 82 .LP
83 83 The \fInparts\fR argument specifies the number of desired partitions.
84 84 .sp
85 85 .LP
86 86 The \fIvtoc\fR argument is a \fBdk_gpt_t\fR structure that describes an EFI
87 87 partition table and contains at least the following members:
88 88 .sp
89 89 .in +2
90 90 .nf
91 91 uint_t efi_version; /* set to EFI_VERSION_CURRENT */
92 92 uint_t efi_nparts; /* no. of partitions in efi_parts */
↓ open down ↓ |
75 lines elided |
↑ open up ↑ |
93 93 uint_t efi_lbasize; /* size of block in bytes */
94 94 diskaddr_t efi_last_lba; /* last block on the disk */
95 95 diskaddr_t efi_first_u_lba; /* first block after labels */
96 96 diskaddr_t efi_last_u_lba; /* last block before backup labels */
97 97 struct dk_part efi_parts[]; /* array of partitions */
98 98 .fi
99 99 .in -2
100 100
101 101 .SS "Protective Master Boot Record"
102 102 When a disk receives an EFI label, a protective MBR (\fBPMBR\fR) is also
103 -written containing a single partiton of type \fBEEh\fR and spanning the
103 +written containing a single partition of type \fBEEh\fR and spanning the
104 104 entire disk (up to the limit of what can be represented in an MBR). By
105 105 default that partition is placed in slot 0 of the PMBR and not marked as
106 106 active. Some BIOS implementations contain bugs that require the entry to be
107 107 placed into a different slot or to be made active in order for the system
108 108 to boot successfully. The default behaviour is modified for systems with known
109 109 firmware bugs, refer to \fB/usr/share/hwdata/efi.fixes\fR for more
110 110 information.
111 111
112 112 .SH RETURN VALUES
113 113 Upon successful completion, \fBefi_alloc_and_init()\fR returns 0. Otherwise it
114 114 returns \fBVT_EIO\fR if an I/O operation to the disk fails.
115 115 .sp
116 116 .LP
117 117 Upon successful completion, \fBefi_alloc_and_read()\fR returns a positive
118 118 integer indicating the slice index associated with the open file descriptor.
119 119 Otherwise, it returns a negative integer to indicate one of the following:
120 120 .sp
121 121 .ne 2
122 122 .na
123 123 \fB\fBVT_EIO\fR\fR
124 124 .ad
125 125 .RS 13n
126 126 An I/O error occurred.
127 127 .RE
128 128
129 129 .sp
130 130 .ne 2
131 131 .na
132 132 \fB\fBVT_ERROR\fR\fR
133 133 .ad
134 134 .RS 13n
135 135 An unknown error occurred.
136 136 .RE
137 137
138 138 .sp
139 139 .ne 2
140 140 .na
141 141 \fB\fBVT_EINVAL\fR\fR
142 142 .ad
143 143 .RS 13n
144 144 An EFI label was not found.
145 145 .RE
146 146
147 147 .sp
148 148 .LP
149 149 The \fBefi_reserved_sectors()\fR function always returns the number of
150 150 reserved sectors required. It will always succeed.
151 151
152 152 .sp
153 153 .LP
154 154 Upon successful completion, \fBefi_write()\fR returns 0. Otherwise, it returns
155 155 a negative integer to indicate one of the following:
156 156 .sp
157 157 .ne 2
158 158 .na
159 159 \fB\fBVT_EIO\fR\fR
160 160 .ad
161 161 .RS 13n
162 162 An I/O error occurred.
163 163 .RE
164 164
165 165 .sp
166 166 .ne 2
167 167 .na
168 168 \fB\fBVT_ERROR\fR\fR
169 169 .ad
170 170 .RS 13n
171 171 An unknown error occurred.
172 172 .RE
173 173
174 174 .sp
175 175 .ne 2
176 176 .na
177 177 \fB\fBVT_EINVAL\fR\fR
178 178 .ad
179 179 .RS 13n
180 180 The label contains incorrect data.
181 181 .RE
182 182
183 183 .sp
184 184 .LP
185 185 Upon successfully completion, \fBefi_use_whole_disk()\fR returns 0. Otherwise,
186 186 it returns a negative integer to indicate one of the following:
187 187 .sp
188 188 .ne 2
189 189 .na
190 190 \fB\fBVT_EIO\fR\fR
191 191 .ad
192 192 .RS 13n
193 193 An I/O error occurred.
194 194 .RE
195 195
196 196 .sp
197 197 .ne 2
198 198 .na
199 199 \fB\fBVT_ERROR\fR\fR
200 200 .ad
201 201 .RS 13n
202 202 An unknown error occurred.
203 203 .RE
204 204
205 205 .sp
206 206 .ne 2
207 207 .na
208 208 \fB\fBVT_EINVAL\fR\fR
209 209 .ad
210 210 .RS 13n
211 211 The label contains incorrect data.
212 212 .RE
213 213
214 214 .sp
215 215 .ne 2
216 216 .na
217 217 \fB\fBVT_ENOSPC\fR\fR
218 218 .ad
219 219 .RS 13n
220 220 Space out of label was not found.
221 221 .RE
222 222
223 223 .SH USAGE
224 224 The EFI label is used on disks with more than 1^32-1 blocks. For compatibility
225 225 reasons, the \fBread_vtoc\fR(3EXT) and \fBwrite_vtoc()\fR functions should be
226 226 used on smaller disks. The application should attempt the \fBread_vtoc()\fR or
227 227 \fBwrite_vtoc()\fR call, check for an error of \fBVT_ENOTSUP\fR, then call the
228 228 analogous EFI function.
229 229 .SH ATTRIBUTES
230 230 See \fBattributes\fR(5) for descriptions of the following attributes:
231 231 .sp
232 232
233 233 .sp
234 234 .TS
235 235 box;
236 236 c | c
237 237 l | l .
238 238 ATTRIBUTE TYPE ATTRIBUTE VALUE
239 239 _
240 240 Interface Stability Committed
241 241 _
242 242 MT-Level Unsafe
243 243 .TE
244 244
245 245 .SH SEE ALSO
246 246 \fBfmthard\fR(1M), \fBformat\fR(1M), \fBprtvtoc\fR(1M), \fBioctl\fR(2),
247 247 \fBopen\fR(2), \fBlibefi\fR(3LIB), \fBread_vtoc\fR(3EXT), \fBattributes\fR(5),
248 248 \fBdkio\fR(7I)
↓ open down ↓ |
135 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX