Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/crypto/core/kcf.c
+++ new/usr/src/uts/common/crypto/core/kcf.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 (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25 /*
26 26 * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
27 27 */
28 28
29 29 /*
30 30 * Core KCF (Kernel Cryptographic Framework). This file implements
31 31 * the loadable module entry points and module verification routines.
32 32 */
33 33
34 34 #include <sys/systm.h>
35 35 #include <sys/cmn_err.h>
36 36 #include <sys/ddi.h>
37 37 #include <sys/sunddi.h>
38 38 #include <sys/modctl.h>
39 39 #include <sys/errno.h>
40 40 #include <sys/rwlock.h>
41 41 #include <sys/kmem.h>
42 42 #include <sys/door.h>
43 43 #include <sys/kobj.h>
44 44
45 45 #include <sys/crypto/common.h>
46 46 #include <sys/crypto/api.h>
47 47 #include <sys/crypto/spi.h>
48 48 #include <sys/crypto/impl.h>
49 49 #include <sys/crypto/sched_impl.h>
50 50 #include <sys/crypto/elfsign.h>
51 51 #include <sys/crypto/ioctladmin.h>
52 52
53 53 #ifdef DEBUG
54 54 int kcf_frmwrk_debug = 0;
55 55
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
56 56 #define KCF_FRMWRK_DEBUG(l, x) if (kcf_frmwrk_debug >= l) printf x
57 57 #else /* DEBUG */
58 58 #define KCF_FRMWRK_DEBUG(l, x)
59 59 #endif /* DEBUG */
60 60
61 61 static struct modlmisc modlmisc = {
62 62 &mod_miscops, "Kernel Crypto Framework"
63 63 };
64 64
65 65 static struct modlinkage modlinkage = {
66 - MODREV_1, (void *)&modlmisc, NULL
66 + MODREV_1, { (void *)&modlmisc, NULL }
67 67 };
68 68
69 69 extern int sys_shutdown;
70 70
71 71 int
72 72 _init()
73 73 {
74 74 /* initialize the mechanisms tables supported out-of-the-box */
75 75 kcf_init_mech_tabs();
76 76
77 77 /* initialize the providers tables */
78 78 kcf_prov_tab_init();
79 79
80 80 /* initialize the policy table */
81 81 kcf_policy_tab_init();
82 82
83 83 /* initialize soft_config_list */
84 84 kcf_soft_config_init();
85 85
86 86 /*
87 87 * Initialize scheduling structures. Note that this does NOT
88 88 * start any threads since it might not be safe to do so.
89 89 */
90 90 kcf_sched_init();
91 91
92 92 /* initialize the RNG support structures */
93 93 kcf_rnd_init();
94 94
95 95 return (mod_install(&modlinkage));
96 96 }
97 97
98 98 int
99 99 _info(struct modinfo *modinfop)
100 100 {
101 101 return (mod_info(&modlinkage, modinfop));
102 102 }
103 103
104 104 /*
105 105 * We do not allow kcf to unload.
106 106 */
107 107 int
108 108 _fini(void)
109 109 {
110 110 return (EBUSY);
111 111 }
112 112
113 113
114 114 /*
115 115 * Return a pointer to the modctl structure of the
116 116 * provider's module.
117 117 */
118 118 struct modctl *
119 119 kcf_get_modctl(crypto_provider_info_t *pinfo)
120 120 {
121 121 struct modctl *mctlp;
122 122
123 123 /* Get the modctl struct for this module */
124 124 if (pinfo->pi_provider_type == CRYPTO_SW_PROVIDER)
125 125 mctlp = mod_getctl(pinfo->pi_provider_dev.pd_sw);
126 126 else {
127 127 major_t major;
128 128 char *drvmod;
129 129
130 130 if ((major = ddi_driver_major(pinfo->pi_provider_dev.pd_hw))
131 131 != DDI_MAJOR_T_NONE) {
132 132 drvmod = ddi_major_to_name(major);
133 133 mctlp = mod_find_by_filename("drv", drvmod);
134 134 } else
135 135 return (NULL);
136 136 }
137 137
138 138 return (mctlp);
139 139 }
↓ open down ↓ |
63 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX