Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/ia32/os/bootdev.c
+++ new/usr/src/uts/intel/ia32/os/bootdev.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
26 26
27 27 #include <sys/modctl.h>
28 28 #include <sys/sunddi.h>
29 29
30 30 /* internal global data */
31 31 static struct modlmisc modlmisc = {
32 32 &mod_miscops, "bootdev misc module"
33 33 };
34 34
35 35 static struct modlinkage modlinkage = {
36 - MODREV_1, (void *)&modlmisc, NULL
36 + MODREV_1, { (void *)&modlmisc, NULL }
37 37 };
38 38
39 39 int
40 40 _init()
41 41 {
42 42 return (mod_install(&modlinkage));
43 43 }
44 44
45 45 int
46 46 _fini()
47 47 {
48 48 return (mod_remove(&modlinkage));
49 49 }
50 50
51 51 int
52 52 _info(struct modinfo *modinfop)
53 53 {
54 54 return (mod_info(&modlinkage, modinfop));
55 55 }
56 56
57 57 /*
58 58 * convert a prom device path to an equivalent path in /devices
59 59 * Does not deal with aliases. Does deal with pathnames which
60 60 * are not fully qualified. This routine is generalized
61 61 * to work across several flavors of OBP
62 62 */
63 63 int
64 64 i_promname_to_devname(char *prom_name, char *ret_buf)
65 65 {
66 66 if (prom_name == NULL || ret_buf == NULL ||
67 67 (strlen(prom_name) >= MAXPATHLEN)) {
68 68 return (EINVAL);
69 69 }
70 70 if (i_ddi_prompath_to_devfspath(prom_name, ret_buf) != DDI_SUCCESS)
71 71 return (EINVAL);
72 72
73 73 return (0);
74 74 }
75 75
76 76 /*
77 77 * If bootstring contains a device path, we need to convert to a format
78 78 * the prom will understand. To do so, we convert the existing path to
79 79 * a prom-compatible path and return the value of new_path. If the
80 80 * caller specifies new_path as NULL, we allocate an appropriately
81 81 * sized new_path on behalf of the caller. If the caller invokes this
82 82 * function with new_path = NULL, they must do so from a context in
83 83 * which it is safe to perform a sleeping memory allocation.
84 84 *
85 85 * NOTE: Intel does not have a real PROM, so the implementation
86 86 * simply returns a copy of the string passed in.
87 87 */
88 88 char *
89 89 i_convert_boot_device_name(char *cur_path, char *new_path, size_t *len)
90 90 {
91 91 if (new_path != NULL) {
92 92 (void) snprintf(new_path, *len, "%s", cur_path);
93 93 return (new_path);
94 94 } else {
95 95 *len = strlen(cur_path) + 1;
96 96 new_path = kmem_alloc(*len, KM_SLEEP);
97 97 (void) snprintf(new_path, *len, "%s", cur_path);
98 98 return (new_path);
99 99 }
100 100 }
↓ open down ↓ |
54 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX