Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/ctf/ctf_mod.c
+++ new/usr/src/uts/common/ctf/ctf_mod.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
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
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 2003 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 -#pragma ident "%Z%%M% %I% %E% SMI"
28 -
29 27 #include <sys/sysmacros.h>
30 28 #include <sys/modctl.h>
31 29 #include <sys/debug.h>
32 30 #include <sys/mman.h>
33 31 #include <sys/modctl.h>
34 32 #include <sys/kobj.h>
35 33 #include <ctf_impl.h>
36 34
37 35 int ctf_leave_compressed = 0;
38 36
39 37 static struct modlmisc modlmisc = {
40 38 &mod_miscops, "Compact C Type Format routines"
41 39 };
42 40
43 41 static struct modlinkage modlinkage = {
44 - MODREV_1, &modlmisc, NULL
42 + MODREV_1, { &modlmisc, NULL }
45 43 };
46 44
47 45 int
48 46 _init(void)
49 47 {
50 48 return (mod_install(&modlinkage));
51 49 }
52 50
53 51 int
54 52 _info(struct modinfo *mip)
55 53 {
56 54 return (mod_info(&modlinkage, mip));
57 55 }
58 56
59 57 int
60 58 _fini(void)
61 59 {
62 60 return (mod_remove(&modlinkage));
63 61 }
64 62
65 63 /*ARGSUSED*/
66 64 void *
67 65 ctf_zopen(int *errp)
68 66 {
69 67 return ((void *)1); /* zmod is always loaded because we depend on it */
70 68 }
71 69
72 70 /*ARGSUSED*/
73 71 const void *
74 72 ctf_sect_mmap(ctf_sect_t *sp, int fd)
75 73 {
76 74 return (MAP_FAILED); /* we don't support this in the kernel */
77 75 }
78 76
79 77 /*ARGSUSED*/
80 78 void
81 79 ctf_sect_munmap(const ctf_sect_t *sp)
82 80 {
83 81 /* we don't support this in the kernel */
84 82 }
85 83
86 84 /*ARGSUSED*/
87 85 ctf_file_t *
88 86 ctf_fdopen(int fd, int *errp)
89 87 {
90 88 return (ctf_set_open_errno(errp, ENOTSUP));
91 89 }
92 90
93 91 /*ARGSUSED*/
94 92 ctf_file_t *
95 93 ctf_open(const char *filename, int *errp)
96 94 {
97 95 return (ctf_set_open_errno(errp, ENOTSUP));
98 96 }
99 97
100 98 /*ARGSUSED*/
101 99 int
102 100 ctf_write(ctf_file_t *fp, int fd)
103 101 {
104 102 return (ctf_set_errno(fp, ENOTSUP));
105 103 }
106 104
107 105 int
108 106 ctf_version(int version)
109 107 {
110 108 ASSERT(version > 0 && version <= CTF_VERSION);
111 109
112 110 if (version > 0)
113 111 _libctf_version = MIN(CTF_VERSION, version);
114 112
115 113 return (_libctf_version);
116 114 }
117 115
118 116 /*ARGSUSED*/
119 117 ctf_file_t *
120 118 ctf_modopen(struct module *mp, int *error)
121 119 {
122 120 ctf_sect_t ctfsect, symsect, strsect;
123 121 ctf_file_t *fp = NULL;
124 122 int err;
125 123
126 124 if (error == NULL)
127 125 error = &err;
128 126
129 127 ctfsect.cts_name = ".SUNW_ctf";
130 128 ctfsect.cts_type = SHT_PROGBITS;
131 129 ctfsect.cts_flags = SHF_ALLOC;
132 130 ctfsect.cts_data = mp->ctfdata;
133 131 ctfsect.cts_size = mp->ctfsize;
134 132 ctfsect.cts_entsize = 1;
135 133 ctfsect.cts_offset = 0;
136 134
137 135 symsect.cts_name = ".symtab";
138 136 symsect.cts_type = SHT_SYMTAB;
139 137 symsect.cts_flags = 0;
140 138 symsect.cts_data = mp->symtbl;
141 139 symsect.cts_size = mp->symhdr->sh_size;
142 140 #ifdef _LP64
143 141 symsect.cts_entsize = sizeof (Elf64_Sym);
144 142 #else
145 143 symsect.cts_entsize = sizeof (Elf32_Sym);
146 144 #endif
147 145 symsect.cts_offset = 0;
148 146
149 147 strsect.cts_name = ".strtab";
150 148 strsect.cts_type = SHT_STRTAB;
151 149 strsect.cts_flags = 0;
152 150 strsect.cts_data = mp->strings;
153 151 strsect.cts_size = mp->strhdr->sh_size;
154 152 strsect.cts_entsize = 1;
155 153 strsect.cts_offset = 0;
156 154
157 155 ASSERT(MUTEX_HELD(&mod_lock));
158 156
159 157 if ((fp = ctf_bufopen(&ctfsect, &symsect, &strsect, error)) == NULL)
160 158 return (NULL);
161 159
162 160 if (!ctf_leave_compressed && (caddr_t)fp->ctf_base != mp->ctfdata) {
163 161 /*
164 162 * We must have just uncompressed the CTF data. To avoid
165 163 * others having to pay the (substantial) cost of decompressing
166 164 * the data, we're going to substitute the uncompressed version
167 165 * for the compressed version. Note that this implies that the
168 166 * first CTF consumer will induce memory impact on the system
169 167 * (but in the name of performance of future CTF consumers).
170 168 */
171 169 kobj_set_ctf(mp, (caddr_t)fp->ctf_base, fp->ctf_size);
172 170 fp->ctf_data.cts_data = fp->ctf_base;
173 171 fp->ctf_data.cts_size = fp->ctf_size;
174 172 }
175 173
176 174 return (fp);
177 175 }
↓ open down ↓ |
123 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX