Apparently a recent round of vandalism by the C++ standards committee includes disallowing the standard and historic type name "unsigned". Add a gratuitous "int" to recent changes. C++ is really a blight on the world.diff -r1.6 -r1.7 src/include/ifaddrs.h
(dholland)
--- src/include/ifaddrs.h 2016/01/22 21:55:57 1.6
+++ src/include/ifaddrs.h 2016/01/23 01:26:14 1.7
@@ -1,56 +1,56 @@ | @@ -1,56 +1,56 @@ | |||
1 | /* $NetBSD: ifaddrs.h,v 1.6 2016/01/22 21:55:57 dholland Exp $ */ | 1 | /* $NetBSD: ifaddrs.h,v 1.7 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1995, 1999 | 4 | * Copyright (c) 1995, 1999 | |
5 | * Berkeley Software Design, Inc. All rights reserved. | 5 | * Berkeley Software Design, Inc. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * | 12 | * | |
13 | * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND | 13 | * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND | |
14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
16 | * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE | 16 | * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE | |
17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
19 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 19 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
20 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 20 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
21 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 21 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
22 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 22 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
23 | * SUCH DAMAGE. | 23 | * SUCH DAMAGE. | |
24 | * | 24 | * | |
25 | * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp | 25 | * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp | |
26 | */ | 26 | */ | |
27 | 27 | |||
28 | #ifndef _IFADDRS_H_ | 28 | #ifndef _IFADDRS_H_ | |
29 | #define _IFADDRS_H_ | 29 | #define _IFADDRS_H_ | |
30 | 30 | |||
31 | struct ifaddrs { | 31 | struct ifaddrs { | |
32 | struct ifaddrs *ifa_next; | 32 | struct ifaddrs *ifa_next; | |
33 | char *ifa_name; | 33 | char *ifa_name; | |
34 | unsigned ifa_flags; | 34 | unsigned int ifa_flags; | |
35 | struct sockaddr *ifa_addr; | 35 | struct sockaddr *ifa_addr; | |
36 | struct sockaddr *ifa_netmask; | 36 | struct sockaddr *ifa_netmask; | |
37 | struct sockaddr *ifa_dstaddr; | 37 | struct sockaddr *ifa_dstaddr; | |
38 | void *ifa_data; | 38 | void *ifa_data; | |
39 | }; | 39 | }; | |
40 | 40 | |||
41 | /* | 41 | /* | |
42 | * This may have been defined in <net/if.h>. Note that if <net/if.h> is | 42 | * This may have been defined in <net/if.h>. Note that if <net/if.h> is | |
43 | * to be included it must be included before this header file. | 43 | * to be included it must be included before this header file. | |
44 | */ | 44 | */ | |
45 | #ifndef ifa_broadaddr | 45 | #ifndef ifa_broadaddr | |
46 | #define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ | 46 | #define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ | |
47 | #endif | 47 | #endif | |
48 | 48 | |||
49 | #include <sys/cdefs.h> | 49 | #include <sys/cdefs.h> | |
50 | 50 | |||
51 | __BEGIN_DECLS | 51 | __BEGIN_DECLS | |
52 | int getifaddrs(struct ifaddrs **); | 52 | int getifaddrs(struct ifaddrs **); | |
53 | void freeifaddrs(struct ifaddrs *); | 53 | void freeifaddrs(struct ifaddrs *); | |
54 | __END_DECLS | 54 | __END_DECLS | |
55 | 55 | |||
56 | #endif /* !_IFADDRS_H_ */ | 56 | #endif /* !_IFADDRS_H_ */ |
--- src/include/link_aout.h 2016/01/22 21:55:57 1.22
+++ src/include/link_aout.h 2016/01/23 01:26:14 1.23
@@ -1,288 +1,288 @@ | @@ -1,288 +1,288 @@ | |||
1 | /* $NetBSD: link_aout.h,v 1.22 2016/01/22 21:55:57 dholland Exp $ */ | 1 | /* $NetBSD: link_aout.h,v 1.23 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Paul Kranenburg. | 8 | * by Paul Kranenburg. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright | |
16 | * notice, this list of conditions and the following disclaimer in the | 16 | * notice, this list of conditions and the following disclaimer in the | |
17 | * documentation and/or other materials provided with the distribution. | 17 | * documentation and/or other materials provided with the distribution. | |
18 | * | 18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * RRS section definitions. | 33 | * RRS section definitions. | |
34 | * | 34 | * | |
35 | * The layout of some data structures defined in this header file is | 35 | * The layout of some data structures defined in this header file is | |
36 | * such that we can provide compatibility with the SunOS 4.x shared | 36 | * such that we can provide compatibility with the SunOS 4.x shared | |
37 | * library scheme. | 37 | * library scheme. | |
38 | */ | 38 | */ | |
39 | 39 | |||
40 | #ifndef _LINK_AOUT_H_ | 40 | #ifndef _LINK_AOUT_H_ | |
41 | #define _LINK_AOUT_H_ | 41 | #define _LINK_AOUT_H_ | |
42 | 42 | |||
43 | #include <dlfcn.h> /* for Dl_info */ | 43 | #include <dlfcn.h> /* for Dl_info */ | |
44 | #include <a.out.h> /* for struct nlist */ | 44 | #include <a.out.h> /* for struct nlist */ | |
45 | 45 | |||
46 | /* | 46 | /* | |
47 | * A `Shared Object Descriptor' describes a shared object that is needed | 47 | * A `Shared Object Descriptor' describes a shared object that is needed | |
48 | * to complete the link edit process of the object containing it. | 48 | * to complete the link edit process of the object containing it. | |
49 | * A list of such objects (chained through `sod_next') is pointed at | 49 | * A list of such objects (chained through `sod_next') is pointed at | |
50 | * by `sdt_sods' in the section_dispatch_table structure. | 50 | * by `sdt_sods' in the section_dispatch_table structure. | |
51 | */ | 51 | */ | |
52 | 52 | |||
53 | struct sod { /* Shared Object Descriptor */ | 53 | struct sod { /* Shared Object Descriptor */ | |
54 | long sod_name; /* name (relative to load address) */ | 54 | long sod_name; /* name (relative to load address) */ | |
55 | unsigned sod_library : 1, /* Searched for by library rules */ | 55 | unsigned int sod_library : 1, /* Searched for by library rules */ | |
56 | sod_reserved : 31; | 56 | sod_reserved : 31; | |
57 | short sod_major; /* major version number */ | 57 | short sod_major; /* major version number */ | |
58 | short sod_minor; /* minor version number */ | 58 | short sod_minor; /* minor version number */ | |
59 | long sod_next; /* next sod */ | 59 | long sod_next; /* next sod */ | |
60 | }; | 60 | }; | |
61 | 61 | |||
62 | /* | 62 | /* | |
63 | * `Shared Object Map's are used by the run-time link editor (ld.so) to | 63 | * `Shared Object Map's are used by the run-time link editor (ld.so) to | |
64 | * keep track of all shared objects loaded into a process' address space. | 64 | * keep track of all shared objects loaded into a process' address space. | |
65 | * These structures are only used at run-time and do not occur within | 65 | * These structures are only used at run-time and do not occur within | |
66 | * the text or data segment of an executable or shared library. | 66 | * the text or data segment of an executable or shared library. | |
67 | */ | 67 | */ | |
68 | struct so_map { /* Shared Object Map */ | 68 | struct so_map { /* Shared Object Map */ | |
69 | caddr_t som_addr; /* Address at which object mapped */ | 69 | caddr_t som_addr; /* Address at which object mapped */ | |
70 | char *som_path; /* Path to mmap'ed file */ | 70 | char *som_path; /* Path to mmap'ed file */ | |
71 | struct so_map *som_next; /* Next map in chain */ | 71 | struct so_map *som_next; /* Next map in chain */ | |
72 | struct sod *som_sod; /* Sod responsible for this map */ | 72 | struct sod *som_sod; /* Sod responsible for this map */ | |
73 | caddr_t som_sodbase; /* Base address of this sod */ | 73 | caddr_t som_sodbase; /* Base address of this sod */ | |
74 | unsigned som_write : 1; /* Text is currently writable */ | 74 | unsigned int som_write : 1; /* Text is currently writable */ | |
75 | struct _dynamic *som_dynamic; /* _dynamic structure */ | 75 | struct _dynamic *som_dynamic; /* _dynamic structure */ | |
76 | caddr_t som_spd; /* Private data */ | 76 | caddr_t som_spd; /* Private data */ | |
77 | }; | 77 | }; | |
78 | 78 | |||
79 | /* | 79 | /* | |
80 | * Symbol description with size. This is simply an `nlist' with | 80 | * Symbol description with size. This is simply an `nlist' with | |
81 | * one field (nz_size) added. | 81 | * one field (nz_size) added. | |
82 | * Used to convey size information on items in the data segment | 82 | * Used to convey size information on items in the data segment | |
83 | * of shared objects. An array of these live in the shared object's | 83 | * of shared objects. An array of these live in the shared object's | |
84 | * text segment and is addressed by the `sdt_nzlist' field. | 84 | * text segment and is addressed by the `sdt_nzlist' field. | |
85 | */ | 85 | */ | |
86 | struct nzlist { | 86 | struct nzlist { | |
87 | struct nlist nlist; | 87 | struct nlist nlist; | |
88 | unsigned long nz_size; | 88 | unsigned long nz_size; | |
89 | #define nz_un nlist.n_un | 89 | #define nz_un nlist.n_un | |
90 | #define nz_strx nlist.n_un.n_strx | 90 | #define nz_strx nlist.n_un.n_strx | |
91 | #define nz_name nlist.n_un.n_name | 91 | #define nz_name nlist.n_un.n_name | |
92 | #define nz_type nlist.n_type | 92 | #define nz_type nlist.n_type | |
93 | #define nz_value nlist.n_value | 93 | #define nz_value nlist.n_value | |
94 | #define nz_desc nlist.n_desc | 94 | #define nz_desc nlist.n_desc | |
95 | #define nz_other nlist.n_other | 95 | #define nz_other nlist.n_other | |
96 | }; | 96 | }; | |
97 | 97 | |||
98 | #define N_AUX(p) ((p)->n_other & 0xf) | 98 | #define N_AUX(p) ((p)->n_other & 0xf) | |
99 | #define N_BIND(p) (((unsigned int)(p)->n_other >> 4) & 0xf) | 99 | #define N_BIND(p) (((unsigned int)(p)->n_other >> 4) & 0xf) | |
100 | #define N_OTHER(r, v) (((unsigned int)(r) << 4) | ((v) & 0xf)) | 100 | #define N_OTHER(r, v) (((unsigned int)(r) << 4) | ((v) & 0xf)) | |
101 | 101 | |||
102 | #define AUX_OBJECT 1 | 102 | #define AUX_OBJECT 1 | |
103 | #define AUX_FUNC 2 | 103 | #define AUX_FUNC 2 | |
104 | #define AUX_LABEL 3 | 104 | #define AUX_LABEL 3 | |
105 | /*#define BIND_LOCAL 0 not used */ | 105 | /*#define BIND_LOCAL 0 not used */ | |
106 | /*#define BIND_GLOBAL 1 not used */ | 106 | /*#define BIND_GLOBAL 1 not used */ | |
107 | #define BIND_WEAK 2 | 107 | #define BIND_WEAK 2 | |
108 | 108 | |||
109 | 109 | |||
110 | /* | 110 | /* | |
111 | * The `section_dispatch_table' structure contains offsets to various data | 111 | * The `section_dispatch_table' structure contains offsets to various data | |
112 | * structures needed to do run-time relocation. | 112 | * structures needed to do run-time relocation. | |
113 | */ | 113 | */ | |
114 | struct section_dispatch_table { | 114 | struct section_dispatch_table { | |
115 | struct so_map *sdt_loaded; /* List of loaded objects */ | 115 | struct so_map *sdt_loaded; /* List of loaded objects */ | |
116 | long sdt_sods; /* List of shared objects descriptors */ | 116 | long sdt_sods; /* List of shared objects descriptors */ | |
117 | long sdt_paths; /* Library search paths */ | 117 | long sdt_paths; /* Library search paths */ | |
118 | long sdt_got; /* Global offset table */ | 118 | long sdt_got; /* Global offset table */ | |
119 | long sdt_plt; /* Procedure linkage table */ | 119 | long sdt_plt; /* Procedure linkage table */ | |
120 | long sdt_rel; /* Relocation table */ | 120 | long sdt_rel; /* Relocation table */ | |
121 | long sdt_hash; /* Symbol hash table */ | 121 | long sdt_hash; /* Symbol hash table */ | |
122 | long sdt_nzlist; /* Symbol table itself */ | 122 | long sdt_nzlist; /* Symbol table itself */ | |
123 | long sdt_filler2; /* Unused (was: stab_hash) */ | 123 | long sdt_filler2; /* Unused (was: stab_hash) */ | |
124 | long sdt_buckets; /* Number of hash buckets */ | 124 | long sdt_buckets; /* Number of hash buckets */ | |
125 | long sdt_strings; /* Symbol strings */ | 125 | long sdt_strings; /* Symbol strings */ | |
126 | long sdt_str_sz; /* Size of symbol strings */ | 126 | long sdt_str_sz; /* Size of symbol strings */ | |
127 | long sdt_text_sz; /* Size of text area */ | 127 | long sdt_text_sz; /* Size of text area */ | |
128 | long sdt_plt_sz; /* Size of procedure linkage table */ | 128 | long sdt_plt_sz; /* Size of procedure linkage table */ | |
129 | }; | 129 | }; | |
130 | 130 | |||
131 | /* | 131 | /* | |
132 | * RRS symbol hash table, addressed by `sdt_hash' in section_dispatch_table. | 132 | * RRS symbol hash table, addressed by `sdt_hash' in section_dispatch_table. | |
133 | * Used to quickly lookup symbols of the shared object by hashing | 133 | * Used to quickly lookup symbols of the shared object by hashing | |
134 | * on the symbol's name. `rh_symbolnum' is the index of the symbol | 134 | * on the symbol's name. `rh_symbolnum' is the index of the symbol | |
135 | * in the shared object's symbol list (`sdt_nzlist'), `rh_next' is | 135 | * in the shared object's symbol list (`sdt_nzlist'), `rh_next' is | |
136 | * the next symbol in the hash bucket (in case of collisions). | 136 | * the next symbol in the hash bucket (in case of collisions). | |
137 | */ | 137 | */ | |
138 | struct rrs_hash { | 138 | struct rrs_hash { | |
139 | int rh_symbolnum; /* Symbol number */ | 139 | int rh_symbolnum; /* Symbol number */ | |
140 | int rh_next; /* Next hash entry */ | 140 | int rh_next; /* Next hash entry */ | |
141 | }; | 141 | }; | |
142 | 142 | |||
143 | /* | 143 | /* | |
144 | * `rt_symbols' is used to keep track of run-time allocated commons | 144 | * `rt_symbols' is used to keep track of run-time allocated commons | |
145 | * and data items copied from shared objects. | 145 | * and data items copied from shared objects. | |
146 | */ | 146 | */ | |
147 | struct rt_symbol { | 147 | struct rt_symbol { | |
148 | struct nzlist *rt_sp; /* The symbol */ | 148 | struct nzlist *rt_sp; /* The symbol */ | |
149 | struct rt_symbol *rt_next; /* Next in linear list */ | 149 | struct rt_symbol *rt_next; /* Next in linear list */ | |
150 | struct rt_symbol *rt_link; /* Next in bucket */ | 150 | struct rt_symbol *rt_link; /* Next in bucket */ | |
151 | caddr_t rt_srcaddr; /* Address of "master" copy */ | 151 | caddr_t rt_srcaddr; /* Address of "master" copy */ | |
152 | struct so_map *rt_smp; /* Originating map */ | 152 | struct so_map *rt_smp; /* Originating map */ | |
153 | }; | 153 | }; | |
154 | 154 | |||
155 | /* | 155 | /* | |
156 | * Debugger interface structure. | 156 | * Debugger interface structure. | |
157 | */ | 157 | */ | |
158 | struct so_debug { | 158 | struct so_debug { | |
159 | int dd_version; /* Version # of interface */ | 159 | int dd_version; /* Version # of interface */ | |
160 | int dd_in_debugger; /* Set when run by debugger */ | 160 | int dd_in_debugger; /* Set when run by debugger */ | |
161 | int dd_sym_loaded; /* Run-time linking brought more | 161 | int dd_sym_loaded; /* Run-time linking brought more | |
162 | symbols into scope */ | 162 | symbols into scope */ | |
163 | char *dd_bpt_addr; /* Address of rtld-generated bpt */ | 163 | char *dd_bpt_addr; /* Address of rtld-generated bpt */ | |
164 | int dd_bpt_shadow; /* Original contents of bpt */ | 164 | int dd_bpt_shadow; /* Original contents of bpt */ | |
165 | struct rt_symbol *dd_cc; /* Allocated commons/copied data */ | 165 | struct rt_symbol *dd_cc; /* Allocated commons/copied data */ | |
166 | }; | 166 | }; | |
167 | 167 | |||
168 | /* | 168 | /* | |
169 | * Entry points into ld.so - user interface to the run-time linker. | 169 | * Entry points into ld.so - user interface to the run-time linker. | |
170 | */ | 170 | */ | |
171 | struct ld_entry { | 171 | struct ld_entry { | |
172 | void *(*dlopen)(const char *, int); | 172 | void *(*dlopen)(const char *, int); | |
173 | int (*dlclose)(void *); | 173 | int (*dlclose)(void *); | |
174 | void *(*dlsym)(void *, const char *); | 174 | void *(*dlsym)(void *, const char *); | |
175 | int (*dlctl)(void *, int, void *); | 175 | int (*dlctl)(void *, int, void *); | |
176 | void (*dlexit)(void); | 176 | void (*dlexit)(void); | |
177 | int (*dladdr)(const void *, Dl_info *); | 177 | int (*dladdr)(const void *, Dl_info *); | |
178 | void (*dlrsrvd[2])(void); | 178 | void (*dlrsrvd[2])(void); | |
179 | }; | 179 | }; | |
180 | 180 | |||
181 | /* | 181 | /* | |
182 | * This is the structure pointed at by the __DYNAMIC symbol if an | 182 | * This is the structure pointed at by the __DYNAMIC symbol if an | |
183 | * executable requires the attention of the run-time link editor. | 183 | * executable requires the attention of the run-time link editor. | |
184 | * __DYNAMIC is given the value zero if no run-time linking needs to | 184 | * __DYNAMIC is given the value zero if no run-time linking needs to | |
185 | * be done (it is always present in shared objects). | 185 | * be done (it is always present in shared objects). | |
186 | * The union `d_un' provides for different versions of the dynamic | 186 | * The union `d_un' provides for different versions of the dynamic | |
187 | * linking mechanism (switched on by `d_version'). The last version | 187 | * linking mechanism (switched on by `d_version'). The last version | |
188 | * used by Sun is 3. We leave some room here and go to version number | 188 | * used by Sun is 3. We leave some room here and go to version number | |
189 | * 8 for NetBSD, the main difference lying in the support for the | 189 | * 8 for NetBSD, the main difference lying in the support for the | |
190 | * `nz_list' type of symbols. | 190 | * `nz_list' type of symbols. | |
191 | */ | 191 | */ | |
192 | 192 | |||
193 | struct _dynamic { | 193 | struct _dynamic { | |
194 | int d_version; /* version # of this interface */ | 194 | int d_version; /* version # of this interface */ | |
195 | struct so_debug *d_debug; | 195 | struct so_debug *d_debug; | |
196 | union { | 196 | union { | |
197 | struct section_dispatch_table *d_sdt; | 197 | struct section_dispatch_table *d_sdt; | |
198 | } d_un; | 198 | } d_un; | |
199 | struct ld_entry *d_entry; /* compat - now in crt_ldso */ | 199 | struct ld_entry *d_entry; /* compat - now in crt_ldso */ | |
200 | }; | 200 | }; | |
201 | 201 | |||
202 | #define LD_VERSION_SUN (3) | 202 | #define LD_VERSION_SUN (3) | |
203 | #define LD_VERSION_BSD (8) | 203 | #define LD_VERSION_BSD (8) | |
204 | #define LD_VERSION_NZLIST_P(v) ((v) >= 8) | 204 | #define LD_VERSION_NZLIST_P(v) ((v) >= 8) | |
205 | 205 | |||
206 | #define LD_GOT(x) ((x)->d_un.d_sdt->sdt_got) | 206 | #define LD_GOT(x) ((x)->d_un.d_sdt->sdt_got) | |
207 | #define LD_PLT(x) ((x)->d_un.d_sdt->sdt_plt) | 207 | #define LD_PLT(x) ((x)->d_un.d_sdt->sdt_plt) | |
208 | #define LD_REL(x) ((x)->d_un.d_sdt->sdt_rel) | 208 | #define LD_REL(x) ((x)->d_un.d_sdt->sdt_rel) | |
209 | #define LD_SYMBOL(x) ((x)->d_un.d_sdt->sdt_nzlist) | 209 | #define LD_SYMBOL(x) ((x)->d_un.d_sdt->sdt_nzlist) | |
210 | #define LD_HASH(x) ((x)->d_un.d_sdt->sdt_hash) | 210 | #define LD_HASH(x) ((x)->d_un.d_sdt->sdt_hash) | |
211 | #define LD_STRINGS(x) ((x)->d_un.d_sdt->sdt_strings) | 211 | #define LD_STRINGS(x) ((x)->d_un.d_sdt->sdt_strings) | |
212 | #define LD_NEED(x) ((x)->d_un.d_sdt->sdt_sods) | 212 | #define LD_NEED(x) ((x)->d_un.d_sdt->sdt_sods) | |
213 | #define LD_BUCKETS(x) ((x)->d_un.d_sdt->sdt_buckets) | 213 | #define LD_BUCKETS(x) ((x)->d_un.d_sdt->sdt_buckets) | |
214 | #define LD_PATHS(x) ((x)->d_un.d_sdt->sdt_paths) | 214 | #define LD_PATHS(x) ((x)->d_un.d_sdt->sdt_paths) | |
215 | 215 | |||
216 | #define LD_GOTSZ(x) ((x)->d_un.d_sdt->sdt_plt - (x)->d_un.d_sdt->sdt_got) | 216 | #define LD_GOTSZ(x) ((x)->d_un.d_sdt->sdt_plt - (x)->d_un.d_sdt->sdt_got) | |
217 | #define LD_RELSZ(x) ((x)->d_un.d_sdt->sdt_hash - (x)->d_un.d_sdt->sdt_rel) | 217 | #define LD_RELSZ(x) ((x)->d_un.d_sdt->sdt_hash - (x)->d_un.d_sdt->sdt_rel) | |
218 | #define LD_HASHSZ(x) ((x)->d_un.d_sdt->sdt_nzlist - (x)->d_un.d_sdt->sdt_hash) | 218 | #define LD_HASHSZ(x) ((x)->d_un.d_sdt->sdt_nzlist - (x)->d_un.d_sdt->sdt_hash) | |
219 | #define LD_STABSZ(x) ((x)->d_un.d_sdt->sdt_strings - (x)->d_un.d_sdt->sdt_nzlist) | 219 | #define LD_STABSZ(x) ((x)->d_un.d_sdt->sdt_strings - (x)->d_un.d_sdt->sdt_nzlist) | |
220 | #define LD_PLTSZ(x) ((x)->d_un.d_sdt->sdt_plt_sz) | 220 | #define LD_PLTSZ(x) ((x)->d_un.d_sdt->sdt_plt_sz) | |
221 | #define LD_STRSZ(x) ((x)->d_un.d_sdt->sdt_str_sz) | 221 | #define LD_STRSZ(x) ((x)->d_un.d_sdt->sdt_str_sz) | |
222 | #define LD_TEXTSZ(x) ((x)->d_un.d_sdt->sdt_text_sz) | 222 | #define LD_TEXTSZ(x) ((x)->d_un.d_sdt->sdt_text_sz) | |
223 | 223 | |||
224 | /* | 224 | /* | |
225 | * Interface to ld.so | 225 | * Interface to ld.so | |
226 | */ | 226 | */ | |
227 | struct crt_ldso { | 227 | struct crt_ldso { | |
228 | int crt_ba; /* Base address of ld.so */ | 228 | int crt_ba; /* Base address of ld.so */ | |
229 | int crt_dzfd; /* "/dev/zero" file descriptor (SunOS) */ | 229 | int crt_dzfd; /* "/dev/zero" file descriptor (SunOS) */ | |
230 | int crt_ldfd; /* ld.so file descriptor */ | 230 | int crt_ldfd; /* ld.so file descriptor */ | |
231 | struct _dynamic *crt_dp; /* Main's __DYNAMIC */ | 231 | struct _dynamic *crt_dp; /* Main's __DYNAMIC */ | |
232 | char **crt_ep; /* environment strings */ | 232 | char **crt_ep; /* environment strings */ | |
233 | caddr_t crt_bp; /* Breakpoint if run from debugger */ | 233 | caddr_t crt_bp; /* Breakpoint if run from debugger */ | |
234 | char *crt_prog; /* Program name (v3) */ | 234 | char *crt_prog; /* Program name (v3) */ | |
235 | char *crt_ldso; /* Link editor name (v4) */ | 235 | char *crt_ldso; /* Link editor name (v4) */ | |
236 | struct ld_entry *crt_ldentry; /* dl*() access (v4) */ | 236 | struct ld_entry *crt_ldentry; /* dl*() access (v4) */ | |
237 | }; | 237 | }; | |
238 | 238 | |||
239 | /* | 239 | /* | |
240 | * Version passed from crt0 to ld.so (1st argument to _rtld()). | 240 | * Version passed from crt0 to ld.so (1st argument to _rtld()). | |
241 | */ | 241 | */ | |
242 | #define CRT_VERSION_SUN 1 | 242 | #define CRT_VERSION_SUN 1 | |
243 | #define CRT_VERSION_BSD_2 2 | 243 | #define CRT_VERSION_BSD_2 2 | |
244 | #define CRT_VERSION_BSD_3 3 | 244 | #define CRT_VERSION_BSD_3 3 | |
245 | #define CRT_VERSION_BSD_4 4 | 245 | #define CRT_VERSION_BSD_4 4 | |
246 | 246 | |||
247 | 247 | |||
248 | /* | 248 | /* | |
249 | * Maximum number of recognized shared object version numbers. | 249 | * Maximum number of recognized shared object version numbers. | |
250 | */ | 250 | */ | |
251 | #define MAXDEWEY 8 | 251 | #define MAXDEWEY 8 | |
252 | 252 | |||
253 | /* | 253 | /* | |
254 | * Header of the hints file. | 254 | * Header of the hints file. | |
255 | */ | 255 | */ | |
256 | struct hints_header { | 256 | struct hints_header { | |
257 | long hh_magic; | 257 | long hh_magic; | |
258 | #define HH_MAGIC 011421044151 | 258 | #define HH_MAGIC 011421044151 | |
259 | long hh_version; /* Interface version number */ | 259 | long hh_version; /* Interface version number */ | |
260 | #define LD_HINTS_VERSION_1 1 | 260 | #define LD_HINTS_VERSION_1 1 | |
261 | #define LD_HINTS_VERSION_2 2 | 261 | #define LD_HINTS_VERSION_2 2 | |
262 | long hh_hashtab; /* Location of hash table */ | 262 | long hh_hashtab; /* Location of hash table */ | |
263 | long hh_nbucket; /* Number of buckets in hashtab */ | 263 | long hh_nbucket; /* Number of buckets in hashtab */ | |
264 | long hh_strtab; /* Location of strings */ | 264 | long hh_strtab; /* Location of strings */ | |
265 | long hh_strtab_sz; /* Size of strings */ | 265 | long hh_strtab_sz; /* Size of strings */ | |
266 | long hh_ehints; /* End of hints (max offset in file) */ | 266 | long hh_ehints; /* End of hints (max offset in file) */ | |
267 | long hh_dirlist; /* Colon-separated list of srch dirs */ | 267 | long hh_dirlist; /* Colon-separated list of srch dirs */ | |
268 | }; | 268 | }; | |
269 | 269 | |||
270 | #define HH_BADMAG(hdr) ((hdr).hh_magic != HH_MAGIC) | 270 | #define HH_BADMAG(hdr) ((hdr).hh_magic != HH_MAGIC) | |
271 | 271 | |||
272 | /* | 272 | /* | |
273 | * Hash table element in hints file. | 273 | * Hash table element in hints file. | |
274 | */ | 274 | */ | |
275 | struct hints_bucket { | 275 | struct hints_bucket { | |
276 | /* namex and pathx are indices into the string table */ | 276 | /* namex and pathx are indices into the string table */ | |
277 | int hi_namex; /* Library name */ | 277 | int hi_namex; /* Library name */ | |
278 | int hi_pathx; /* Full path */ | 278 | int hi_pathx; /* Full path */ | |
279 | int hi_dewey[MAXDEWEY]; /* The versions */ | 279 | int hi_dewey[MAXDEWEY]; /* The versions */ | |
280 | int hi_ndewey; /* Number of version numbers */ | 280 | int hi_ndewey; /* Number of version numbers */ | |
281 | #define hi_major hi_dewey[0] | 281 | #define hi_major hi_dewey[0] | |
282 | #define hi_minor hi_dewey[1] | 282 | #define hi_minor hi_dewey[1] | |
283 | int hi_next; /* Next in this bucket */ | 283 | int hi_next; /* Next in this bucket */ | |
284 | }; | 284 | }; | |
285 | 285 | |||
286 | #define _PATH_LD_HINTS "/var/run/ld.so.hints" | 286 | #define _PATH_LD_HINTS "/var/run/ld.so.hints" | |
287 | 287 | |||
288 | #endif /* _LINK_AOUT_H_ */ | 288 | #endif /* _LINK_AOUT_H_ */ |
--- src/include/nsswitch.h 2016/01/22 21:55:57 1.22
+++ src/include/nsswitch.h 2016/01/23 01:26:14 1.23
@@ -1,230 +1,230 @@ | @@ -1,230 +1,230 @@ | |||
1 | /* $NetBSD: nsswitch.h,v 1.22 2016/01/22 21:55:57 dholland Exp $ */ | 1 | /* $NetBSD: nsswitch.h,v 1.23 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Luke Mewburn. | 8 | * by Luke Mewburn. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright | |
16 | * notice, this list of conditions and the following disclaimer in the | 16 | * notice, this list of conditions and the following disclaimer in the | |
17 | * documentation and/or other materials provided with the distribution. | 17 | * documentation and/or other materials provided with the distribution. | |
18 | * | 18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #ifndef _NSSWITCH_H | 32 | #ifndef _NSSWITCH_H | |
33 | #define _NSSWITCH_H 1 | 33 | #define _NSSWITCH_H 1 | |
34 | 34 | |||
35 | #include <sys/types.h> | 35 | #include <sys/types.h> | |
36 | #include <stdarg.h> | 36 | #include <stdarg.h> | |
37 | 37 | |||
38 | #define NSS_MODULE_INTERFACE_VERSION 0 | 38 | #define NSS_MODULE_INTERFACE_VERSION 0 | |
39 | 39 | |||
40 | #ifndef _PATH_NS_CONF | 40 | #ifndef _PATH_NS_CONF | |
41 | #define _PATH_NS_CONF "/etc/nsswitch.conf" | 41 | #define _PATH_NS_CONF "/etc/nsswitch.conf" | |
42 | #endif | 42 | #endif | |
43 | 43 | |||
44 | #define NS_CONTINUE 0 | 44 | #define NS_CONTINUE 0 | |
45 | #define NS_RETURN 1 | 45 | #define NS_RETURN 1 | |
46 | 46 | |||
47 | /* | 47 | /* | |
48 | * Layout of: | 48 | * Layout of: | |
49 | * uint32_t ns_src.flags | 49 | * uint32_t ns_src.flags | |
50 | */ | 50 | */ | |
51 | /* nsswitch.conf status codes and nsdispatch(3) return values */ | 51 | /* nsswitch.conf status codes and nsdispatch(3) return values */ | |
52 | #define NS_SUCCESS (1<<0) /* entry was found */ | 52 | #define NS_SUCCESS (1<<0) /* entry was found */ | |
53 | #define NS_UNAVAIL (1<<1) /* source not responding, or corrupt */ | 53 | #define NS_UNAVAIL (1<<1) /* source not responding, or corrupt */ | |
54 | #define NS_NOTFOUND (1<<2) /* source responded 'no such entry' */ | 54 | #define NS_NOTFOUND (1<<2) /* source responded 'no such entry' */ | |
55 | #define NS_TRYAGAIN (1<<3) /* source busy, may respond to retrys */ | 55 | #define NS_TRYAGAIN (1<<3) /* source busy, may respond to retrys */ | |
56 | #define NS_STATUSMASK 0x000000ff /* bitmask to get the status flags */ | 56 | #define NS_STATUSMASK 0x000000ff /* bitmask to get the status flags */ | |
57 | 57 | |||
58 | /* internal nsdispatch(3) flags; not settable in nsswitch.conf(5) */ | 58 | /* internal nsdispatch(3) flags; not settable in nsswitch.conf(5) */ | |
59 | #define NS_FORCEALL (1<<8) /* force all methods to be invoked; */ | 59 | #define NS_FORCEALL (1<<8) /* force all methods to be invoked; */ | |
60 | 60 | |||
61 | /* | 61 | /* | |
62 | * Currently implemented sources. | 62 | * Currently implemented sources. | |
63 | */ | 63 | */ | |
64 | #define NSSRC_FILES "files" /* local files */ | 64 | #define NSSRC_FILES "files" /* local files */ | |
65 | #define NSSRC_DNS "dns" /* DNS; IN for hosts, HS for others */ | 65 | #define NSSRC_DNS "dns" /* DNS; IN for hosts, HS for others */ | |
66 | #define NSSRC_NIS "nis" /* YP/NIS */ | 66 | #define NSSRC_NIS "nis" /* YP/NIS */ | |
67 | #define NSSRC_COMPAT "compat" /* passwd,group in YP compat mode */ | 67 | #define NSSRC_COMPAT "compat" /* passwd,group in YP compat mode */ | |
68 | 68 | |||
69 | /* | 69 | /* | |
70 | * Currently implemented databases. | 70 | * Currently implemented databases. | |
71 | */ | 71 | */ | |
72 | #define NSDB_HOSTS "hosts" | 72 | #define NSDB_HOSTS "hosts" | |
73 | #define NSDB_GROUP "group" | 73 | #define NSDB_GROUP "group" | |
74 | #define NSDB_GROUP_COMPAT "group_compat" | 74 | #define NSDB_GROUP_COMPAT "group_compat" | |
75 | #define NSDB_NETGROUP "netgroup" | 75 | #define NSDB_NETGROUP "netgroup" | |
76 | #define NSDB_NETWORKS "networks" | 76 | #define NSDB_NETWORKS "networks" | |
77 | #define NSDB_PASSWD "passwd" | 77 | #define NSDB_PASSWD "passwd" | |
78 | #define NSDB_PASSWD_COMPAT "passwd_compat" | 78 | #define NSDB_PASSWD_COMPAT "passwd_compat" | |
79 | #define NSDB_SHELLS "shells" | 79 | #define NSDB_SHELLS "shells" | |
80 | 80 | |||
81 | /* | 81 | /* | |
82 | * Suggested databases to implement. | 82 | * Suggested databases to implement. | |
83 | */ | 83 | */ | |
84 | #define NSDB_ALIASES "aliases" | 84 | #define NSDB_ALIASES "aliases" | |
85 | #define NSDB_AUTH "auth" | 85 | #define NSDB_AUTH "auth" | |
86 | #define NSDB_AUTOMOUNT "automount" | 86 | #define NSDB_AUTOMOUNT "automount" | |
87 | #define NSDB_BOOTPARAMS "bootparams" | 87 | #define NSDB_BOOTPARAMS "bootparams" | |
88 | #define NSDB_ETHERS "ethers" | 88 | #define NSDB_ETHERS "ethers" | |
89 | #define NSDB_EXPORTS "exports" | 89 | #define NSDB_EXPORTS "exports" | |
90 | #define NSDB_NETMASKS "netmasks" | 90 | #define NSDB_NETMASKS "netmasks" | |
91 | #define NSDB_PHONES "phones" | 91 | #define NSDB_PHONES "phones" | |
92 | #define NSDB_PRINTCAP "printcap" | 92 | #define NSDB_PRINTCAP "printcap" | |
93 | #define NSDB_PROTOCOLS "protocols" | 93 | #define NSDB_PROTOCOLS "protocols" | |
94 | #define NSDB_REMOTE "remote" | 94 | #define NSDB_REMOTE "remote" | |
95 | #define NSDB_RPC "rpc" | 95 | #define NSDB_RPC "rpc" | |
96 | #define NSDB_SENDMAILVARS "sendmailvars" | 96 | #define NSDB_SENDMAILVARS "sendmailvars" | |
97 | #define NSDB_SERVICES "services" | 97 | #define NSDB_SERVICES "services" | |
98 | #define NSDB_TERMCAP "termcap" | 98 | #define NSDB_TERMCAP "termcap" | |
99 | #define NSDB_TTYS "ttys" | 99 | #define NSDB_TTYS "ttys" | |
100 | 100 | |||
101 | /* | 101 | /* | |
102 | * ns_dtab `callback' function signature. | 102 | * ns_dtab `callback' function signature. | |
103 | */ | 103 | */ | |
104 | typedef int (*nss_method)(void *, void *, va_list); | 104 | typedef int (*nss_method)(void *, void *, va_list); | |
105 | 105 | |||
106 | /* | 106 | /* | |
107 | * ns_dtab - `nsswitch dispatch table' | 107 | * ns_dtab - `nsswitch dispatch table' | |
108 | * Contains an entry for each source and the appropriate function to call. | 108 | * Contains an entry for each source and the appropriate function to call. | |
109 | */ | 109 | */ | |
110 | typedef struct { | 110 | typedef struct { | |
111 | const char *src; | 111 | const char *src; | |
112 | nss_method callback; | 112 | nss_method callback; | |
113 | void *cb_data; | 113 | void *cb_data; | |
114 | } ns_dtab; | 114 | } ns_dtab; | |
115 | 115 | |||
116 | /* | 116 | /* | |
117 | * Macros to help build an ns_dtab[] | 117 | * Macros to help build an ns_dtab[] | |
118 | */ | 118 | */ | |
119 | #define NS_FILES_CB(F,C) { NSSRC_FILES, F, __UNCONST(C) }, | 119 | #define NS_FILES_CB(F,C) { NSSRC_FILES, F, __UNCONST(C) }, | |
120 | #define NS_COMPAT_CB(F,C) { NSSRC_COMPAT, F, __UNCONST(C) }, | 120 | #define NS_COMPAT_CB(F,C) { NSSRC_COMPAT, F, __UNCONST(C) }, | |
121 | 121 | |||
122 | #ifdef HESIOD | 122 | #ifdef HESIOD | |
123 | # define NS_DNS_CB(F,C) { NSSRC_DNS, F, __UNCONST(C) }, | 123 | # define NS_DNS_CB(F,C) { NSSRC_DNS, F, __UNCONST(C) }, | |
124 | #else | 124 | #else | |
125 | # define NS_DNS_CB(F,C) | 125 | # define NS_DNS_CB(F,C) | |
126 | #endif | 126 | #endif | |
127 | 127 | |||
128 | #ifdef YP | 128 | #ifdef YP | |
129 | # define NS_NIS_CB(F,C) { NSSRC_NIS, F, __UNCONST(C) }, | 129 | # define NS_NIS_CB(F,C) { NSSRC_NIS, F, __UNCONST(C) }, | |
130 | #else | 130 | #else | |
131 | # define NS_NIS_CB(F,C) | 131 | # define NS_NIS_CB(F,C) | |
132 | #endif | 132 | #endif | |
133 | #define NS_NULL_CB { .src = NULL }, | 133 | #define NS_NULL_CB { .src = NULL }, | |
134 | 134 | |||
135 | /* | 135 | /* | |
136 | * ns_src - `nsswitch source' | 136 | * ns_src - `nsswitch source' | |
137 | * Used by the nsparser routines to store a mapping between a source | 137 | * Used by the nsparser routines to store a mapping between a source | |
138 | * and its dispatch control flags for a given database. | 138 | * and its dispatch control flags for a given database. | |
139 | */ | 139 | */ | |
140 | typedef struct { | 140 | typedef struct { | |
141 | const char *name; | 141 | const char *name; | |
142 | uint32_t flags; | 142 | uint32_t flags; | |
143 | } ns_src; | 143 | } ns_src; | |
144 | 144 | |||
145 | 145 | |||
146 | /* | 146 | /* | |
147 | * Default sourcelists (if nsswitch.conf is missing, corrupt, | 147 | * Default sourcelists (if nsswitch.conf is missing, corrupt, | |
148 | * or the requested database doesn't have an entry) | 148 | * or the requested database doesn't have an entry) | |
149 | */ | 149 | */ | |
150 | extern const ns_src __nsdefaultsrc[]; | 150 | extern const ns_src __nsdefaultsrc[]; | |
151 | extern const ns_src __nsdefaultcompat[]; | 151 | extern const ns_src __nsdefaultcompat[]; | |
152 | extern const ns_src __nsdefaultcompat_forceall[]; | 152 | extern const ns_src __nsdefaultcompat_forceall[]; | |
153 | extern const ns_src __nsdefaultfiles[]; | 153 | extern const ns_src __nsdefaultfiles[]; | |
154 | extern const ns_src __nsdefaultfiles_forceall[]; | 154 | extern const ns_src __nsdefaultfiles_forceall[]; | |
155 | extern const ns_src __nsdefaultnis[]; | 155 | extern const ns_src __nsdefaultnis[]; | |
156 | extern const ns_src __nsdefaultnis_forceall[]; | 156 | extern const ns_src __nsdefaultnis_forceall[]; | |
157 | 157 | |||
158 | 158 | |||
159 | /* | 159 | /* | |
160 | * ns_mtab - `nsswitch method table' | 160 | * ns_mtab - `nsswitch method table' | |
161 | * An nsswitch module provides a mapping from (database name, method name) | 161 | * An nsswitch module provides a mapping from (database name, method name) | |
162 | * tuples to the nss_method and associated callback data. Effectively, | 162 | * tuples to the nss_method and associated callback data. Effectively, | |
163 | * ns_dtab, but used for dynamically loaded modules. | 163 | * ns_dtab, but used for dynamically loaded modules. | |
164 | */ | 164 | */ | |
165 | typedef struct { | 165 | typedef struct { | |
166 | const char *database; | 166 | const char *database; | |
167 | const char *name; | 167 | const char *name; | |
168 | nss_method method; | 168 | nss_method method; | |
169 | void *mdata; | 169 | void *mdata; | |
170 | } ns_mtab; | 170 | } ns_mtab; | |
171 | 171 | |||
172 | /* | 172 | /* | |
173 | * nss_module_register_fn - module registration function | 173 | * nss_module_register_fn - module registration function | |
174 | * called at module load | 174 | * called at module load | |
175 | * nss_module_unregister_fn - module un-registration function | 175 | * nss_module_unregister_fn - module un-registration function | |
176 | * called at module unload | 176 | * called at module unload | |
177 | */ | 177 | */ | |
178 | typedef void (*nss_module_unregister_fn)(ns_mtab *, unsigned); | 178 | typedef void (*nss_module_unregister_fn)(ns_mtab *, unsigned int); | |
179 | typedef ns_mtab *(*nss_module_register_fn)(const char *, unsigned *, | 179 | typedef ns_mtab *(*nss_module_register_fn)(const char *, unsigned int *, | |
180 | nss_module_unregister_fn *); | 180 | nss_module_unregister_fn *); | |
181 | 181 | |||
182 | #ifdef _NS_PRIVATE | 182 | #ifdef _NS_PRIVATE | |
183 | 183 | |||
184 | /* | 184 | /* | |
185 | * Private data structures for back-end nsswitch implementation. | 185 | * Private data structures for back-end nsswitch implementation. | |
186 | */ | 186 | */ | |
187 | 187 | |||
188 | /* | 188 | /* | |
189 | * ns_dbt - `nsswitch database thang' | 189 | * ns_dbt - `nsswitch database thang' | |
190 | * For each database in /etc/nsswitch.conf there is a ns_dbt, with its | 190 | * For each database in /etc/nsswitch.conf there is a ns_dbt, with its | |
191 | * name and a list of ns_src's containing the source information. | 191 | * name and a list of ns_src's containing the source information. | |
192 | */ | 192 | */ | |
193 | typedef struct { | 193 | typedef struct { | |
194 | const char *name; /* name of database */ | 194 | const char *name; /* name of database */ | |
195 | ns_src *srclist; /* list of sources */ | 195 | ns_src *srclist; /* list of sources */ | |
196 | unsigned srclistsize; /* size of srclist */ | 196 | unsigned int srclistsize; /* size of srclist */ | |
197 | } ns_dbt; | 197 | } ns_dbt; | |
198 | 198 | |||
199 | /* | 199 | /* | |
200 | * ns_mod - `nsswitch module' | 200 | * ns_mod - `nsswitch module' | |
201 | */ | 201 | */ | |
202 | typedef struct { | 202 | typedef struct { | |
203 | const char *name; /* module name */ | 203 | const char *name; /* module name */ | |
204 | void *handle; /* handle from dlopen() */ | 204 | void *handle; /* handle from dlopen() */ | |
205 | ns_mtab *mtab; /* method table */ | 205 | ns_mtab *mtab; /* method table */ | |
206 | unsigned mtabsize; /* size of mtab */ | 206 | unsigned int mtabsize; /* size of mtab */ | |
207 | /* called to unload module */ | 207 | /* called to unload module */ | |
208 | nss_module_unregister_fn unregister; | 208 | nss_module_unregister_fn unregister; | |
209 | } ns_mod; | 209 | } ns_mod; | |
210 | 210 | |||
211 | #endif /* _NS_PRIVATE */ | 211 | #endif /* _NS_PRIVATE */ | |
212 | 212 | |||
213 | 213 | |||
214 | #include <sys/cdefs.h> | 214 | #include <sys/cdefs.h> | |
215 | 215 | |||
216 | __BEGIN_DECLS | 216 | __BEGIN_DECLS | |
217 | int nsdispatch(void *, const ns_dtab [], const char *, | 217 | int nsdispatch(void *, const ns_dtab [], const char *, | |
218 | const char *, const ns_src [], ...); | 218 | const char *, const ns_src [], ...); | |
219 | 219 | |||
220 | #ifdef _NS_PRIVATE | 220 | #ifdef _NS_PRIVATE | |
221 | int _nsdbtaddsrc(ns_dbt *, const ns_src *); | 221 | int _nsdbtaddsrc(ns_dbt *, const ns_src *); | |
222 | void _nsdbtdump(const ns_dbt *); | 222 | void _nsdbtdump(const ns_dbt *); | |
223 | int _nsdbtput(const ns_dbt *); | 223 | int _nsdbtput(const ns_dbt *); | |
224 | void _nsyyerror(const char *); | 224 | void _nsyyerror(const char *); | |
225 | int _nsyylex(void); | 225 | int _nsyylex(void); | |
226 | #endif /* _NS_PRIVATE */ | 226 | #endif /* _NS_PRIVATE */ | |
227 | 227 | |||
228 | __END_DECLS | 228 | __END_DECLS | |
229 | 229 | |||
230 | #endif /* !_NSSWITCH_H */ | 230 | #endif /* !_NSSWITCH_H */ |
--- src/include/login_cap.h 2016/01/22 21:55:57 1.12
+++ src/include/login_cap.h 2016/01/23 01:26:14 1.13
@@ -1,92 +1,92 @@ | @@ -1,92 +1,92 @@ | |||
1 | /* $NetBSD: login_cap.h,v 1.12 2016/01/22 21:55:57 dholland Exp $ */ | 1 | /* $NetBSD: login_cap.h,v 1.13 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved. | 4 | * Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | 14 | * 3. All advertising materials mentioning features or use of this software | |
15 | * must display the following acknowledgement: | 15 | * must display the following acknowledgement: | |
16 | * This product includes software developed by Berkeley Software Design, | 16 | * This product includes software developed by Berkeley Software Design, | |
17 | * Inc. | 17 | * Inc. | |
18 | * 4. The name of Berkeley Software Design, Inc. may not be used to endorse | 18 | * 4. The name of Berkeley Software Design, Inc. may not be used to endorse | |
19 | * or promote products derived from this software without specific prior | 19 | * or promote products derived from this software without specific prior | |
20 | * written permission. | 20 | * written permission. | |
21 | * | 21 | * | |
22 | * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND | 22 | * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND | |
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
25 | * ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE | |
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
32 | * SUCH DAMAGE. | 32 | * SUCH DAMAGE. | |
33 | * | 33 | * | |
34 | * BSDI login_cap.h,v 2.10 1997/08/07 21:35:19 prb Exp | 34 | * BSDI login_cap.h,v 2.10 1997/08/07 21:35:19 prb Exp | |
35 | */ | 35 | */ | |
36 | 36 | |||
37 | #ifndef _LOGIN_CAP_H_ | 37 | #ifndef _LOGIN_CAP_H_ | |
38 | #define _LOGIN_CAP_H_ | 38 | #define _LOGIN_CAP_H_ | |
39 | 39 | |||
40 | #define LOGIN_DEFCLASS "default" | 40 | #define LOGIN_DEFCLASS "default" | |
41 | #define LOGIN_DEFSERVICE "login" | 41 | #define LOGIN_DEFSERVICE "login" | |
42 | #define LOGIN_DEFUMASK 022 | 42 | #define LOGIN_DEFUMASK 022 | |
43 | #define _PATH_LOGIN_CONF "/etc/login.conf" | 43 | #define _PATH_LOGIN_CONF "/etc/login.conf" | |
44 | 44 | |||
45 | #define LOGIN_OSETGROUP 0x0001 /* Obsolete setgroup */ | 45 | #define LOGIN_OSETGROUP 0x0001 /* Obsolete setgroup */ | |
46 | #define LOGIN_SETLOGIN 0x0002 /* Set login */ | 46 | #define LOGIN_SETLOGIN 0x0002 /* Set login */ | |
47 | #define LOGIN_SETPATH 0x0004 /* Set path */ | 47 | #define LOGIN_SETPATH 0x0004 /* Set path */ | |
48 | #define LOGIN_SETPRIORITY 0x0008 /* Set priority */ | 48 | #define LOGIN_SETPRIORITY 0x0008 /* Set priority */ | |
49 | #define LOGIN_SETRESOURCES 0x0010 /* Set resource limits */ | 49 | #define LOGIN_SETRESOURCES 0x0010 /* Set resource limits */ | |
50 | #define LOGIN_SETUMASK 0x0020 /* Set umask */ | 50 | #define LOGIN_SETUMASK 0x0020 /* Set umask */ | |
51 | #define LOGIN_SETUSER 0x0040 /* Set user */ | 51 | #define LOGIN_SETUSER 0x0040 /* Set user */ | |
52 | #define LOGIN_SETENV 0x0080 /* Set user environment */ | 52 | #define LOGIN_SETENV 0x0080 /* Set user environment */ | |
53 | #define LOGIN_SETGID 0x0100 /* Set group id */ | 53 | #define LOGIN_SETGID 0x0100 /* Set group id */ | |
54 | #define LOGIN_SETGROUPS 0x0200 /* Set group membership (initgroups) */ | 54 | #define LOGIN_SETGROUPS 0x0200 /* Set group membership (initgroups) */ | |
55 | #define LOGIN_SETALL 0x03fe /* Set all. 0x0001 is obsolete! */ | 55 | #define LOGIN_SETALL 0x03fe /* Set all. 0x0001 is obsolete! */ | |
56 | #define LOGIN_SETGROUP (LOGIN_SETGID|LOGIN_SETGROUPS) /* Set group */ | 56 | #define LOGIN_SETGROUP (LOGIN_SETGID|LOGIN_SETGROUPS) /* Set group */ | |
57 | 57 | |||
58 | typedef struct { | 58 | typedef struct { | |
59 | char *lc_class; | 59 | char *lc_class; | |
60 | char *lc_cap; | 60 | char *lc_cap; | |
61 | char *lc_style; | 61 | char *lc_style; | |
62 | } login_cap_t; | 62 | } login_cap_t; | |
63 | 63 | |||
64 | typedef int (*envfunc_t)(void *, const char *, const char *, int); | 64 | typedef int (*envfunc_t)(void *, const char *, const char *, int); | |
65 | 65 | |||
66 | #include <sys/cdefs.h> | 66 | #include <sys/cdefs.h> | |
67 | __BEGIN_DECLS | 67 | __BEGIN_DECLS | |
68 | struct passwd; | 68 | struct passwd; | |
69 | 69 | |||
70 | login_cap_t *login_getclass(const char *); | 70 | login_cap_t *login_getclass(const char *); | |
71 | #ifndef __LIBC12_SOURCE__ | 71 | #ifndef __LIBC12_SOURCE__ | |
72 | login_cap_t *login_getpwclass(const struct passwd *) | 72 | login_cap_t *login_getpwclass(const struct passwd *) | |
73 | __RENAME(__login_getpwclass50); | 73 | __RENAME(__login_getpwclass50); | |
74 | #endif | 74 | #endif | |
75 | void login_close(login_cap_t *); | 75 | void login_close(login_cap_t *); | |
76 | int login_getcapbool(login_cap_t *, const char *, unsigned); | 76 | int login_getcapbool(login_cap_t *, const char *, unsigned int); | |
77 | quad_t login_getcapnum(login_cap_t *, const char *, quad_t, quad_t); | 77 | quad_t login_getcapnum(login_cap_t *, const char *, quad_t, quad_t); | |
78 | quad_t login_getcapsize(login_cap_t *, const char *, quad_t, quad_t); | 78 | quad_t login_getcapsize(login_cap_t *, const char *, quad_t, quad_t); | |
79 | char *login_getcapstr(login_cap_t *, const char *, char *, char *); | 79 | char *login_getcapstr(login_cap_t *, const char *, char *, char *); | |
80 | quad_t login_getcaptime(login_cap_t *, const char *, quad_t, quad_t); | 80 | quad_t login_getcaptime(login_cap_t *, const char *, quad_t, quad_t); | |
81 | 81 | |||
82 | int setclasscontext(const char *, unsigned); | 82 | int setclasscontext(const char *, unsigned int); | |
83 | #ifndef __LIBC12_SOURCE__ | 83 | #ifndef __LIBC12_SOURCE__ | |
84 | int setusercontext(login_cap_t *, struct passwd *, uid_t, unsigned) | 84 | int setusercontext(login_cap_t *, struct passwd *, uid_t, unsigned int) | |
85 | __RENAME(__setusercontext50); | 85 | __RENAME(__setusercontext50); | |
86 | #endif | 86 | #endif | |
87 | void setuserpath(login_cap_t *, const char *, envfunc_t, void *); | 87 | void setuserpath(login_cap_t *, const char *, envfunc_t, void *); | |
88 | int setuserenv(login_cap_t *, envfunc_t, void *); | 88 | int setuserenv(login_cap_t *, envfunc_t, void *); | |
89 | 89 | |||
90 | __END_DECLS | 90 | __END_DECLS | |
91 | 91 | |||
92 | #endif /* !_LOGIN_CAP_H_ */ | 92 | #endif /* !_LOGIN_CAP_H_ */ |
--- src/lib/libpci/pci.h 2016/01/22 22:22:48 1.7
+++ src/lib/libpci/pci.h 2016/01/23 01:26:14 1.8
@@ -1,65 +1,67 @@ | @@ -1,65 +1,67 @@ | |||
1 | /* $NetBSD: pci.h,v 1.7 2016/01/22 22:22:48 dholland Exp $ */ | 1 | /* $NetBSD: pci.h,v 1.8 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright 2001 Wasabi Systems, Inc. | 4 | * Copyright 2001 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Jason R. Thorpe for Wasabi Systems, Inc. | 7 | * Written by Jason R. Thorpe for Wasabi Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
15 | * notice, this list of conditions and the following disclaimer in the | 15 | * notice, this list of conditions and the following disclaimer in the | |
16 | * documentation and/or other materials provided with the distribution. | 16 | * documentation and/or other materials provided with the distribution. | |
17 | * 3. All advertising materials mentioning features or use of this software | 17 | * 3. All advertising materials mentioning features or use of this software | |
18 | * must display the following acknowledgement: | 18 | * must display the following acknowledgement: | |
19 | * This product includes software developed for the NetBSD Project by | 19 | * This product includes software developed for the NetBSD Project by | |
20 | * Wasabi Systems, Inc. | 20 | * Wasabi Systems, Inc. | |
21 | * 4. The name of Wasabi Systems, Inc. may not be used to endorse | 21 | * 4. The name of Wasabi Systems, Inc. may not be used to endorse | |
22 | * or promote products derived from this software without specific prior | 22 | * or promote products derived from this software without specific prior | |
23 | * written permission. | 23 | * written permission. | |
24 | * | 24 | * | |
25 | * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND | 25 | * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND | |
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | |
29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
35 | * POSSIBILITY OF SUCH DAMAGE. | 35 | * POSSIBILITY OF SUCH DAMAGE. | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #ifndef _PCI_H_ | 38 | #ifndef _PCI_H_ | |
39 | #define _PCI_H_ | 39 | #define _PCI_H_ | |
40 | 40 | |||
41 | #include <stddef.h> | 41 | #include <stddef.h> | |
42 | #include <stdint.h> /* XXX */ | 42 | #include <stdint.h> /* XXX */ | |
43 | 43 | |||
44 | /* | 44 | /* | |
45 | * Interface to the PCI bus for user programs. | 45 | * Interface to the PCI bus for user programs. | |
46 | */ | 46 | */ | |
47 | 47 | |||
48 | typedef uint32_t pcireg_t; /* XXX */ | 48 | typedef uint32_t pcireg_t; /* XXX */ | |
49 | 49 | |||
50 | /* pci_bus.c */ | 50 | /* pci_bus.c */ | |
51 | int pcibus_conf_read(int, unsigned, unsigned, unsigned, unsigned, pcireg_t *); | 51 | int pcibus_conf_read(int, unsigned int, unsigned int, unsigned int, | |
52 | int pcibus_conf_write(int, unsigned, unsigned, unsigned, unsigned, pcireg_t); | 52 | unsigned int, pcireg_t *); | |
53 | int pcibus_conf_write(int, unsigned int, unsigned int, unsigned int, | |||
54 | unsigned int, pcireg_t); | |||
53 | 55 | |||
54 | /* pci_device.c */ | 56 | /* pci_device.c */ | |
55 | int pcidev_conf_read(int, unsigned, pcireg_t *); | 57 | int pcidev_conf_read(int, unsigned int, pcireg_t *); | |
56 | int pcidev_conf_write(int, unsigned, pcireg_t); | 58 | int pcidev_conf_write(int, unsigned int, pcireg_t); | |
57 | 59 | |||
58 | /* pci_drvname.c */ | 60 | /* pci_drvname.c */ | |
59 | int pci_drvname(int, unsigned, unsigned, char *, size_t); | 61 | int pci_drvname(int, unsigned int, unsigned int, char *, size_t); | |
60 | 62 | |||
61 | /* pci_subr.c */ | 63 | /* pci_subr.c */ | |
62 | void pci_devinfo(pcireg_t, pcireg_t, int, char *, size_t); | 64 | void pci_devinfo(pcireg_t, pcireg_t, int, char *, size_t); | |
63 | void pci_conf_print(int, unsigned, unsigned, unsigned); | 65 | void pci_conf_print(int, unsigned int, unsigned int, unsigned int); | |
64 | 66 | |||
65 | #endif /* _PCI_H_ */ | 67 | #endif /* _PCI_H_ */ |
--- src/sys/fs/msdosfs/direntry.h 2016/01/22 22:53:36 1.8
+++ src/sys/fs/msdosfs/direntry.h 2016/01/23 01:26:14 1.9
@@ -1,146 +1,146 @@ | @@ -1,146 +1,146 @@ | |||
1 | /* $NetBSD: direntry.h,v 1.8 2016/01/22 22:53:36 dholland Exp $ */ | 1 | /* $NetBSD: direntry.h,v 1.9 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. | 4 | * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. | |
5 | * Copyright (C) 1994, 1995, 1997 TooLs GmbH. | 5 | * Copyright (C) 1994, 1995, 1997 TooLs GmbH. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). | 7 | * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
15 | * notice, this list of conditions and the following disclaimer in the | 15 | * notice, this list of conditions and the following disclaimer in the | |
16 | * documentation and/or other materials provided with the distribution. | 16 | * documentation and/or other materials provided with the distribution. | |
17 | * 3. All advertising materials mentioning features or use of this software | 17 | * 3. All advertising materials mentioning features or use of this software | |
18 | * must display the following acknowledgement: | 18 | * must display the following acknowledgement: | |
19 | * This product includes software developed by TooLs GmbH. | 19 | * This product includes software developed by TooLs GmbH. | |
20 | * 4. The name of TooLs GmbH may not be used to endorse or promote products | 20 | * 4. The name of TooLs GmbH may not be used to endorse or promote products | |
21 | * derived from this software without specific prior written permission. | 21 | * derived from this software without specific prior written permission. | |
22 | * | 22 | * | |
23 | * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR | 23 | * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR | |
24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
26 | * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 26 | * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
28 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 28 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
29 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 29 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
30 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 30 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
31 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 31 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
32 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | /* | 34 | /* | |
35 | * Written by Paul Popelka (paulp@uts.amdahl.com) | 35 | * Written by Paul Popelka (paulp@uts.amdahl.com) | |
36 | * | 36 | * | |
37 | * You can do anything you want with this software, just don't say you wrote | 37 | * You can do anything you want with this software, just don't say you wrote | |
38 | * it, and don't remove this notice. | 38 | * it, and don't remove this notice. | |
39 | * | 39 | * | |
40 | * This software is provided "as is". | 40 | * This software is provided "as is". | |
41 | * | 41 | * | |
42 | * The author supplies this software to be publicly redistributed on the | 42 | * The author supplies this software to be publicly redistributed on the | |
43 | * understanding that the author is not responsible for the correct | 43 | * understanding that the author is not responsible for the correct | |
44 | * functioning of this software in any circumstances and is not liable for | 44 | * functioning of this software in any circumstances and is not liable for | |
45 | * any damages caused by this software. | 45 | * any damages caused by this software. | |
46 | * | 46 | * | |
47 | * October 1992 | 47 | * October 1992 | |
48 | */ | 48 | */ | |
49 | #ifndef _MSDOSFS_DIRENTRY_H_ | 49 | #ifndef _MSDOSFS_DIRENTRY_H_ | |
50 | #define _MSDOSFS_DIRENTRY_H_ | 50 | #define _MSDOSFS_DIRENTRY_H_ | |
51 | 51 | |||
52 | /* | 52 | /* | |
53 | * Structure of a dos directory entry. | 53 | * Structure of a dos directory entry. | |
54 | */ | 54 | */ | |
55 | struct direntry { | 55 | struct direntry { | |
56 | uint8_t deName[8]; /* filename, blank filled */ | 56 | uint8_t deName[8]; /* filename, blank filled */ | |
57 | #define SLOT_EMPTY 0x00 /* slot has never been used */ | 57 | #define SLOT_EMPTY 0x00 /* slot has never been used */ | |
58 | #define SLOT_E5 0x05 /* the real value is 0xe5 */ | 58 | #define SLOT_E5 0x05 /* the real value is 0xe5 */ | |
59 | #define SLOT_DELETED 0xe5 /* file in this slot deleted */ | 59 | #define SLOT_DELETED 0xe5 /* file in this slot deleted */ | |
60 | uint8_t deExtension[3]; /* extension, blank filled */ | 60 | uint8_t deExtension[3]; /* extension, blank filled */ | |
61 | uint8_t deAttributes; /* file attributes */ | 61 | uint8_t deAttributes; /* file attributes */ | |
62 | #define ATTR_NORMAL 0x00 /* normal file */ | 62 | #define ATTR_NORMAL 0x00 /* normal file */ | |
63 | #define ATTR_READONLY 0x01 /* file is readonly */ | 63 | #define ATTR_READONLY 0x01 /* file is readonly */ | |
64 | #define ATTR_HIDDEN 0x02 /* file is hidden */ | 64 | #define ATTR_HIDDEN 0x02 /* file is hidden */ | |
65 | #define ATTR_SYSTEM 0x04 /* file is a system file */ | 65 | #define ATTR_SYSTEM 0x04 /* file is a system file */ | |
66 | #define ATTR_VOLUME 0x08 /* entry is a volume label */ | 66 | #define ATTR_VOLUME 0x08 /* entry is a volume label */ | |
67 | #define ATTR_DIRECTORY 0x10 /* entry is a directory name */ | 67 | #define ATTR_DIRECTORY 0x10 /* entry is a directory name */ | |
68 | #define ATTR_ARCHIVE 0x20 /* file is new or modified */ | 68 | #define ATTR_ARCHIVE 0x20 /* file is new or modified */ | |
69 | uint8_t deReserved; /* reserved */ | 69 | uint8_t deReserved; /* reserved */ | |
70 | uint8_t deCHundredth; /* hundredth of seconds in CTime */ | 70 | uint8_t deCHundredth; /* hundredth of seconds in CTime */ | |
71 | uint8_t deCTime[2]; /* create time */ | 71 | uint8_t deCTime[2]; /* create time */ | |
72 | uint8_t deCDate[2]; /* create date */ | 72 | uint8_t deCDate[2]; /* create date */ | |
73 | uint8_t deADate[2]; /* access date */ | 73 | uint8_t deADate[2]; /* access date */ | |
74 | uint8_t deHighClust[2]; /* high bytes of cluster number */ | 74 | uint8_t deHighClust[2]; /* high bytes of cluster number */ | |
75 | uint8_t deMTime[2]; /* last update time */ | 75 | uint8_t deMTime[2]; /* last update time */ | |
76 | uint8_t deMDate[2]; /* last update date */ | 76 | uint8_t deMDate[2]; /* last update date */ | |
77 | uint8_t deStartCluster[2]; /* starting cluster of file */ | 77 | uint8_t deStartCluster[2]; /* starting cluster of file */ | |
78 | uint8_t deFileSize[4]; /* size of file in bytes */ | 78 | uint8_t deFileSize[4]; /* size of file in bytes */ | |
79 | }; | 79 | }; | |
80 | 80 | |||
81 | static __inline uint8_t | 81 | static __inline uint8_t | |
82 | msdos_dirchar(const struct direntry *de, size_t i) { | 82 | msdos_dirchar(const struct direntry *de, size_t i) { | |
83 | return i < sizeof(de->deName) ? de->deName[i] : | 83 | return i < sizeof(de->deName) ? de->deName[i] : | |
84 | de->deExtension[i - sizeof(de->deName)]; | 84 | de->deExtension[i - sizeof(de->deName)]; | |
85 | } | 85 | } | |
86 | 86 | |||
87 | /* | 87 | /* | |
88 | * Structure of a Win95 long name directory entry | 88 | * Structure of a Win95 long name directory entry | |
89 | */ | 89 | */ | |
90 | struct winentry { | 90 | struct winentry { | |
91 | uint8_t weCnt; | 91 | uint8_t weCnt; | |
92 | #define WIN_LAST 0x40 | 92 | #define WIN_LAST 0x40 | |
93 | #define WIN_CNT 0x3f | 93 | #define WIN_CNT 0x3f | |
94 | uint8_t wePart1[10]; | 94 | uint8_t wePart1[10]; | |
95 | uint8_t weAttributes; | 95 | uint8_t weAttributes; | |
96 | #define ATTR_WIN95 0x0f | 96 | #define ATTR_WIN95 0x0f | |
97 | uint8_t weReserved1; | 97 | uint8_t weReserved1; | |
98 | uint8_t weChksum; | 98 | uint8_t weChksum; | |
99 | uint8_t wePart2[12]; | 99 | uint8_t wePart2[12]; | |
100 | uint16_t weReserved2; | 100 | uint16_t weReserved2; | |
101 | uint8_t wePart3[4]; | 101 | uint8_t wePart3[4]; | |
102 | }; | 102 | }; | |
103 | #define WIN_CHARS 13 /* Number of chars per winentry */ | 103 | #define WIN_CHARS 13 /* Number of chars per winentry */ | |
104 | 104 | |||
105 | /* | 105 | /* | |
106 | * This is the format of the contents of the deTime field in the direntry | 106 | * This is the format of the contents of the deTime field in the direntry | |
107 | * structure. | 107 | * structure. | |
108 | * We don't use bitfields because we don't know how compilers for | 108 | * We don't use bitfields because we don't know how compilers for | |
109 | * arbitrary machines will lay them out. | 109 | * arbitrary machines will lay them out. | |
110 | */ | 110 | */ | |
111 | #define DT_2SECONDS_MASK 0x1F /* seconds divided by 2 */ | 111 | #define DT_2SECONDS_MASK 0x1F /* seconds divided by 2 */ | |
112 | #define DT_2SECONDS_SHIFT 0 | 112 | #define DT_2SECONDS_SHIFT 0 | |
113 | #define DT_MINUTES_MASK 0x7E0 /* minutes */ | 113 | #define DT_MINUTES_MASK 0x7E0 /* minutes */ | |
114 | #define DT_MINUTES_SHIFT 5 | 114 | #define DT_MINUTES_SHIFT 5 | |
115 | #define DT_HOURS_MASK 0xF800 /* hours */ | 115 | #define DT_HOURS_MASK 0xF800 /* hours */ | |
116 | #define DT_HOURS_SHIFT 11 | 116 | #define DT_HOURS_SHIFT 11 | |
117 | 117 | |||
118 | /* | 118 | /* | |
119 | * This is the format of the contents of the deDate field in the direntry | 119 | * This is the format of the contents of the deDate field in the direntry | |
120 | * structure. | 120 | * structure. | |
121 | */ | 121 | */ | |
122 | #define DD_DAY_MASK 0x1F /* day of month */ | 122 | #define DD_DAY_MASK 0x1F /* day of month */ | |
123 | #define DD_DAY_SHIFT 0 | 123 | #define DD_DAY_SHIFT 0 | |
124 | #define DD_MONTH_MASK 0x1E0 /* month */ | 124 | #define DD_MONTH_MASK 0x1E0 /* month */ | |
125 | #define DD_MONTH_SHIFT 5 | 125 | #define DD_MONTH_SHIFT 5 | |
126 | #define DD_YEAR_MASK 0xFE00 /* year - 1980 */ | 126 | #define DD_YEAR_MASK 0xFE00 /* year - 1980 */ | |
127 | #define DD_YEAR_SHIFT 9 | 127 | #define DD_YEAR_SHIFT 9 | |
128 | 128 | |||
129 | #if defined(_KERNEL) || defined(MAKEFS) | 129 | #if defined(_KERNEL) || defined(MAKEFS) | |
130 | struct dirent; | 130 | struct dirent; | |
131 | void unix2dostime(const struct timespec *tsp, int gmtoff, uint16_t *ddp, | 131 | void unix2dostime(const struct timespec *tsp, int gmtoff, uint16_t *ddp, | |
132 | uint16_t *dtp, uint8_t *dhp); | 132 | uint16_t *dtp, uint8_t *dhp); | |
133 | void dos2unixtime(unsigned dd, unsigned dt, unsigned dh, int gmtoff, | 133 | void dos2unixtime(unsigned int dd, unsigned int dt, unsigned int dh, | |
134 | struct timespec *tsp); | 134 | int gmtoff, struct timespec *tsp); | |
135 | int dos2unixfn(unsigned char dn[11], unsigned char *un, int lower); | 135 | int dos2unixfn(unsigned char dn[11], unsigned char *un, int lower); | |
136 | int unix2dosfn(const unsigned char *un, unsigned char dn[12], int unlen, | 136 | int unix2dosfn(const unsigned char *un, unsigned char dn[12], int unlen, | |
137 | unsigned gen); | 137 | unsigned int gen); | |
138 | int unix2winfn(const unsigned char *un, int unlen, struct winentry *wep, | 138 | int unix2winfn(const unsigned char *un, int unlen, struct winentry *wep, | |
139 | int cnt, int chksum); | 139 | int cnt, int chksum); | |
140 | int winChkName(const unsigned char *un, int unlen, struct winentry *wep, | 140 | int winChkName(const unsigned char *un, int unlen, struct winentry *wep, | |
141 | int chksum); | 141 | int chksum); | |
142 | int win2unixfn(struct winentry *wep, struct dirent *dp, int chksum); | 142 | int win2unixfn(struct winentry *wep, struct dirent *dp, int chksum); | |
143 | uint8_t winChksum(uint8_t *name); | 143 | uint8_t winChksum(uint8_t *name); | |
144 | int winSlotCnt(const unsigned char *un, int unlen); | 144 | int winSlotCnt(const unsigned char *un, int unlen); | |
145 | #endif /* _KERNEL || MAKEFS */ | 145 | #endif /* _KERNEL || MAKEFS */ | |
146 | #endif /* _MSDOSFS_DIRENTRY_H_ */ | 146 | #endif /* _MSDOSFS_DIRENTRY_H_ */ |
--- src/sys/sys/envsys.h 2016/01/22 23:33:42 1.35
+++ src/sys/sys/envsys.h 2016/01/23 01:26:14 1.36
@@ -1,198 +1,198 @@ | @@ -1,198 +1,198 @@ | |||
1 | /* $NetBSD: envsys.h,v 1.35 2016/01/22 23:33:42 dholland Exp $ */ | 1 | /* $NetBSD: envsys.h,v 1.36 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1999, 2007, 2014 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1999, 2007, 2014 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Tim Rightnour, Juan Romero Pardines and Bill Squier. | 8 | * by Tim Rightnour, Juan Romero Pardines and Bill Squier. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright | |
16 | * notice, this list of conditions and the following disclaimer in the | 16 | * notice, this list of conditions and the following disclaimer in the | |
17 | * documentation and/or other materials provided with the distribution. | 17 | * documentation and/or other materials provided with the distribution. | |
18 | * | 18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #ifndef _SYS_ENVSYS_H_ | 32 | #ifndef _SYS_ENVSYS_H_ | |
33 | #define _SYS_ENVSYS_H_ | 33 | #define _SYS_ENVSYS_H_ | |
34 | 34 | |||
35 | #ifndef _KERNEL | 35 | #ifndef _KERNEL | |
36 | #include <stdbool.h> | 36 | #include <stdbool.h> | |
37 | #endif | 37 | #endif | |
38 | 38 | |||
39 | #include <sys/ioccom.h> | 39 | #include <sys/ioccom.h> | |
40 | #include <sys/power.h> | 40 | #include <sys/power.h> | |
41 | #include <sys/queue.h> | 41 | #include <sys/queue.h> | |
42 | 42 | |||
43 | /* | 43 | /* | |
44 | * ENVironmental SYStem version 2 (aka ENVSYS 2) | 44 | * ENVironmental SYStem version 2 (aka ENVSYS 2) | |
45 | */ | 45 | */ | |
46 | 46 | |||
47 | #define ENVSYS_MAXSENSORS 512 | 47 | #define ENVSYS_MAXSENSORS 512 | |
48 | #define ENVSYS_DESCLEN 32 | 48 | #define ENVSYS_DESCLEN 32 | |
49 | 49 | |||
50 | /* sensor units */ | 50 | /* sensor units */ | |
51 | enum envsys_units { | 51 | enum envsys_units { | |
52 | ENVSYS_STEMP = 0, /* Temperature (microkelvins) */ | 52 | ENVSYS_STEMP = 0, /* Temperature (microkelvins) */ | |
53 | ENVSYS_SFANRPM, /* Fan RPM */ | 53 | ENVSYS_SFANRPM, /* Fan RPM */ | |
54 | ENVSYS_SVOLTS_AC, /* AC Volts */ | 54 | ENVSYS_SVOLTS_AC, /* AC Volts */ | |
55 | ENVSYS_SVOLTS_DC, /* DC Volts */ | 55 | ENVSYS_SVOLTS_DC, /* DC Volts */ | |
56 | ENVSYS_SOHMS, /* Ohms */ | 56 | ENVSYS_SOHMS, /* Ohms */ | |
57 | ENVSYS_SWATTS, /* Watts */ | 57 | ENVSYS_SWATTS, /* Watts */ | |
58 | ENVSYS_SAMPS, /* Ampere */ | 58 | ENVSYS_SAMPS, /* Ampere */ | |
59 | ENVSYS_SWATTHOUR, /* Watt hour */ | 59 | ENVSYS_SWATTHOUR, /* Watt hour */ | |
60 | ENVSYS_SAMPHOUR, /* Ampere hour */ | 60 | ENVSYS_SAMPHOUR, /* Ampere hour */ | |
61 | ENVSYS_INDICATOR, /* Indicator */ | 61 | ENVSYS_INDICATOR, /* Indicator */ | |
62 | ENVSYS_INTEGER, /* Integer */ | 62 | ENVSYS_INTEGER, /* Integer */ | |
63 | ENVSYS_DRIVE, /* Drive */ | 63 | ENVSYS_DRIVE, /* Drive */ | |
64 | ENVSYS_BATTERY_CAPACITY, /* Battery capacity */ | 64 | ENVSYS_BATTERY_CAPACITY, /* Battery capacity */ | |
65 | ENVSYS_BATTERY_CHARGE, /* Battery charging/discharging */ | 65 | ENVSYS_BATTERY_CHARGE, /* Battery charging/discharging */ | |
66 | ENVSYS_SRELHUMIDITY, /* relative humidity */ | 66 | ENVSYS_SRELHUMIDITY, /* relative humidity */ | |
67 | ENVSYS_NSENSORS | 67 | ENVSYS_NSENSORS | |
68 | }; | 68 | }; | |
69 | 69 | |||
70 | /* sensor states */ | 70 | /* sensor states */ | |
71 | enum envsys_states { | 71 | enum envsys_states { | |
72 | ENVSYS_SVALID = 10, /* sensor state is valid */ | 72 | ENVSYS_SVALID = 10, /* sensor state is valid */ | |
73 | ENVSYS_SINVALID, /* sensor state is invalid */ | 73 | ENVSYS_SINVALID, /* sensor state is invalid */ | |
74 | ENVSYS_SCRITICAL, /* sensor state is critical */ | 74 | ENVSYS_SCRITICAL, /* sensor state is critical */ | |
75 | ENVSYS_SCRITUNDER, /* sensor state is critical under */ | 75 | ENVSYS_SCRITUNDER, /* sensor state is critical under */ | |
76 | ENVSYS_SCRITOVER, /* sensor state is critical over */ | 76 | ENVSYS_SCRITOVER, /* sensor state is critical over */ | |
77 | ENVSYS_SWARNUNDER, /* sensor state is warn under */ | 77 | ENVSYS_SWARNUNDER, /* sensor state is warn under */ | |
78 | ENVSYS_SWARNOVER /* sensor state is warn over */ | 78 | ENVSYS_SWARNOVER /* sensor state is warn over */ | |
79 | }; | 79 | }; | |
80 | 80 | |||
81 | /* sensor drive states */ | 81 | /* sensor drive states */ | |
82 | enum envsys_drive_states { | 82 | enum envsys_drive_states { | |
83 | ENVSYS_DRIVE_EMPTY = 1, /* drive is empty */ | 83 | ENVSYS_DRIVE_EMPTY = 1, /* drive is empty */ | |
84 | ENVSYS_DRIVE_READY, /* drive is ready */ | 84 | ENVSYS_DRIVE_READY, /* drive is ready */ | |
85 | ENVSYS_DRIVE_POWERUP, /* drive is powered up */ | 85 | ENVSYS_DRIVE_POWERUP, /* drive is powered up */ | |
86 | ENVSYS_DRIVE_ONLINE, /* drive is online */ | 86 | ENVSYS_DRIVE_ONLINE, /* drive is online */ | |
87 | ENVSYS_DRIVE_IDLE, /* drive is idle */ | 87 | ENVSYS_DRIVE_IDLE, /* drive is idle */ | |
88 | ENVSYS_DRIVE_ACTIVE, /* drive is active */ | 88 | ENVSYS_DRIVE_ACTIVE, /* drive is active */ | |
89 | ENVSYS_DRIVE_REBUILD, /* drive is rebuilding */ | 89 | ENVSYS_DRIVE_REBUILD, /* drive is rebuilding */ | |
90 | ENVSYS_DRIVE_POWERDOWN, /* drive is powered down */ | 90 | ENVSYS_DRIVE_POWERDOWN, /* drive is powered down */ | |
91 | ENVSYS_DRIVE_FAIL, /* drive failed */ | 91 | ENVSYS_DRIVE_FAIL, /* drive failed */ | |
92 | ENVSYS_DRIVE_PFAIL, /* drive is degraded */ | 92 | ENVSYS_DRIVE_PFAIL, /* drive is degraded */ | |
93 | ENVSYS_DRIVE_MIGRATING, /* drive is migrating */ | 93 | ENVSYS_DRIVE_MIGRATING, /* drive is migrating */ | |
94 | ENVSYS_DRIVE_OFFLINE, /* drive is offline */ | 94 | ENVSYS_DRIVE_OFFLINE, /* drive is offline */ | |
95 | ENVSYS_DRIVE_BUILD, /* drive is building */ | 95 | ENVSYS_DRIVE_BUILD, /* drive is building */ | |
96 | ENVSYS_DRIVE_CHECK /* drive is checking its state */ | 96 | ENVSYS_DRIVE_CHECK /* drive is checking its state */ | |
97 | }; | 97 | }; | |
98 | 98 | |||
99 | /* sensor battery capacity states */ | 99 | /* sensor battery capacity states */ | |
100 | enum envsys_battery_capacity_states { | 100 | enum envsys_battery_capacity_states { | |
101 | ENVSYS_BATTERY_CAPACITY_NORMAL = 1, /* normal cap in battery */ | 101 | ENVSYS_BATTERY_CAPACITY_NORMAL = 1, /* normal cap in battery */ | |
102 | ENVSYS_BATTERY_CAPACITY_WARNING, /* warning cap in battery */ | 102 | ENVSYS_BATTERY_CAPACITY_WARNING, /* warning cap in battery */ | |
103 | ENVSYS_BATTERY_CAPACITY_CRITICAL, /* critical cap in battery */ | 103 | ENVSYS_BATTERY_CAPACITY_CRITICAL, /* critical cap in battery */ | |
104 | ENVSYS_BATTERY_CAPACITY_HIGH, /* high cap in battery */ | 104 | ENVSYS_BATTERY_CAPACITY_HIGH, /* high cap in battery */ | |
105 | ENVSYS_BATTERY_CAPACITY_MAX, /* maximum cap in battery */ | 105 | ENVSYS_BATTERY_CAPACITY_MAX, /* maximum cap in battery */ | |
106 | ENVSYS_BATTERY_CAPACITY_LOW /* low cap in battery */ | 106 | ENVSYS_BATTERY_CAPACITY_LOW /* low cap in battery */ | |
107 | }; | 107 | }; | |
108 | 108 | |||
109 | /* sensor indicator states */ | 109 | /* sensor indicator states */ | |
110 | enum envsys_indicator_states { | 110 | enum envsys_indicator_states { | |
111 | ENVSYS_INDICATOR_FALSE = 0, | 111 | ENVSYS_INDICATOR_FALSE = 0, | |
112 | ENVSYS_INDICATOR_TRUE = 1 | 112 | ENVSYS_INDICATOR_TRUE = 1 | |
113 | }; | 113 | }; | |
114 | 114 | |||
115 | /* | 115 | /* | |
116 | * IOCTLs | 116 | * IOCTLs | |
117 | */ | 117 | */ | |
118 | #define ENVSYS_GETDICTIONARY _IOWR('E', 0, struct plistref) | 118 | #define ENVSYS_GETDICTIONARY _IOWR('E', 0, struct plistref) | |
119 | #define ENVSYS_SETDICTIONARY _IOWR('E', 1, struct plistref) | 119 | #define ENVSYS_SETDICTIONARY _IOWR('E', 1, struct plistref) | |
120 | #define ENVSYS_REMOVEPROPS _IOWR('E', 2, struct plistref) | 120 | #define ENVSYS_REMOVEPROPS _IOWR('E', 2, struct plistref) | |
121 | 121 | |||
122 | /* | 122 | /* | |
123 | * Compatibility with old interface. Only ENVSYS_GTREDATA | 123 | * Compatibility with old interface. Only ENVSYS_GTREDATA | |
124 | * and ENVSYS_GTREINFO ioctls are supported. | 124 | * and ENVSYS_GTREINFO ioctls are supported. | |
125 | */ | 125 | */ | |
126 | 126 | |||
127 | /* get sensor data */ | 127 | /* get sensor data */ | |
128 | 128 | |||
129 | struct envsys_tre_data { | 129 | struct envsys_tre_data { | |
130 | unsigned sensor; | 130 | unsigned int sensor; | |
131 | union { /* all data is given */ | 131 | union { /* all data is given */ | |
132 | uint32_t data_us; /* in microKelvins, */ | 132 | uint32_t data_us; /* in microKelvins, */ | |
133 | int32_t data_s; /* rpms, volts, amps, */ | 133 | int32_t data_s; /* rpms, volts, amps, */ | |
134 | } cur, min, max, avg; /* ohms, watts, etc */ | 134 | } cur, min, max, avg; /* ohms, watts, etc */ | |
135 | /* see units below */ | 135 | /* see units below */ | |
136 | 136 | |||
137 | uint32_t warnflags; /* warning flags */ | 137 | uint32_t warnflags; /* warning flags */ | |
138 | uint32_t validflags; /* sensor valid flags */ | 138 | uint32_t validflags; /* sensor valid flags */ | |
139 | unsigned units; /* type of sensor */ | 139 | unsigned int units; /* type of sensor */ | |
140 | }; | 140 | }; | |
141 | typedef struct envsys_tre_data envsys_tre_data_t; | 141 | typedef struct envsys_tre_data envsys_tre_data_t; | |
142 | 142 | |||
143 | /* flags for warnflags */ | 143 | /* flags for warnflags */ | |
144 | #define ENVSYS_WARN_OK 0x00000000 /* All is well */ | 144 | #define ENVSYS_WARN_OK 0x00000000 /* All is well */ | |
145 | #define ENVSYS_WARN_UNDER 0x00000001 /* an under condition */ | 145 | #define ENVSYS_WARN_UNDER 0x00000001 /* an under condition */ | |
146 | #define ENVSYS_WARN_CRITUNDER 0x00000002 /* a critical under condition */ | 146 | #define ENVSYS_WARN_CRITUNDER 0x00000002 /* a critical under condition */ | |
147 | #define ENVSYS_WARN_OVER 0x00000004 /* an over condition */ | 147 | #define ENVSYS_WARN_OVER 0x00000004 /* an over condition */ | |
148 | #define ENVSYS_WARN_CRITOVER 0x00000008 /* a critical over condition */ | 148 | #define ENVSYS_WARN_CRITOVER 0x00000008 /* a critical over condition */ | |
149 | 149 | |||
150 | /* drive status */ | 150 | /* drive status */ | |
151 | #define ENVSYS_DRIVE_EMPTY 1 | 151 | #define ENVSYS_DRIVE_EMPTY 1 | |
152 | #define ENVSYS_DRIVE_READY 2 | 152 | #define ENVSYS_DRIVE_READY 2 | |
153 | #define ENVSYS_DRIVE_POWERUP 3 | 153 | #define ENVSYS_DRIVE_POWERUP 3 | |
154 | #define ENVSYS_DRIVE_ONLINE 4 | 154 | #define ENVSYS_DRIVE_ONLINE 4 | |
155 | #define ENVSYS_DRIVE_IDLE 5 | 155 | #define ENVSYS_DRIVE_IDLE 5 | |
156 | #define ENVSYS_DRIVE_ACTIVE 6 | 156 | #define ENVSYS_DRIVE_ACTIVE 6 | |
157 | #define ENVSYS_DRIVE_REBUILD 7 | 157 | #define ENVSYS_DRIVE_REBUILD 7 | |
158 | #define ENVSYS_DRIVE_POWERDOWN 8 | 158 | #define ENVSYS_DRIVE_POWERDOWN 8 | |
159 | #define ENVSYS_DRIVE_FAIL 9 | 159 | #define ENVSYS_DRIVE_FAIL 9 | |
160 | #define ENVSYS_DRIVE_PFAIL 10 | 160 | #define ENVSYS_DRIVE_PFAIL 10 | |
161 | 161 | |||
162 | #ifdef ENVSYSUNITNAMES | 162 | #ifdef ENVSYSUNITNAMES | |
163 | static const char * const envsysunitnames[] = { | 163 | static const char * const envsysunitnames[] = { | |
164 | "degC", "RPM", "VAC", "V", "Ohms", "W", | 164 | "degC", "RPM", "VAC", "V", "Ohms", "W", | |
165 | "A", "Wh", "Ah", "bool", "integer", "drive", "%rH", "Unk" | 165 | "A", "Wh", "Ah", "bool", "integer", "drive", "%rH", "Unk" | |
166 | }; | 166 | }; | |
167 | static const char * const envsysdrivestatus[] = { | 167 | static const char * const envsysdrivestatus[] = { | |
168 | "unknown", "empty", "ready", "powering up", "online", "idle", "active", | 168 | "unknown", "empty", "ready", "powering up", "online", "idle", "active", | |
169 | "rebuilding", "powering down", "failed", "degraded" | 169 | "rebuilding", "powering down", "failed", "degraded" | |
170 | }; | 170 | }; | |
171 | #endif | 171 | #endif | |
172 | 172 | |||
173 | 173 | |||
174 | /* flags for validflags */ | 174 | /* flags for validflags */ | |
175 | #define ENVSYS_FVALID 0x00000001 /* sensor is valid */ | 175 | #define ENVSYS_FVALID 0x00000001 /* sensor is valid */ | |
176 | #define ENVSYS_FCURVALID 0x00000002 /* cur for this sens is valid */ | 176 | #define ENVSYS_FCURVALID 0x00000002 /* cur for this sens is valid */ | |
177 | #define ENVSYS_FMINVALID 0x00000004 /* min for this sens is valid */ | 177 | #define ENVSYS_FMINVALID 0x00000004 /* min for this sens is valid */ | |
178 | #define ENVSYS_FMAXVALID 0x00000008 /* max for this sens is valid */ | 178 | #define ENVSYS_FMAXVALID 0x00000008 /* max for this sens is valid */ | |
179 | #define ENVSYS_FAVGVALID 0x00000010 /* avg for this sens is valid */ | 179 | #define ENVSYS_FAVGVALID 0x00000010 /* avg for this sens is valid */ | |
180 | #define ENVSYS_FFRACVALID 0x00000020 /* display fraction of max */ | 180 | #define ENVSYS_FFRACVALID 0x00000020 /* display fraction of max */ | |
181 | 181 | |||
182 | #define ENVSYS_GTREDATA _IOWR('E', 2, envsys_tre_data_t) | 182 | #define ENVSYS_GTREDATA _IOWR('E', 2, envsys_tre_data_t) | |
183 | 183 | |||
184 | /* set and check sensor info */ | 184 | /* set and check sensor info */ | |
185 | 185 | |||
186 | struct envsys_basic_info { | 186 | struct envsys_basic_info { | |
187 | unsigned sensor; /* sensor number */ | 187 | unsigned int sensor; /* sensor number */ | |
188 | unsigned units; /* type of sensor */ | 188 | unsigned int units; /* type of sensor */ | |
189 | char desc[33]; /* sensor description */ | 189 | char desc[33]; /* sensor description */ | |
190 | unsigned rfact; /* for volts, (int)(factor x 10^4) */ | 190 | unsigned int rfact; /* for volts, (int)(factor x 10^4) */ | |
191 | unsigned rpms; /* for fans, set nominal RPMs */ | 191 | unsigned int rpms; /* for fans, set nominal RPMs */ | |
192 | uint32_t validflags; /* sensor valid flags */ | 192 | uint32_t validflags; /* sensor valid flags */ | |
193 | }; | 193 | }; | |
194 | typedef struct envsys_basic_info envsys_basic_info_t; | 194 | typedef struct envsys_basic_info envsys_basic_info_t; | |
195 | 195 | |||
196 | #define ENVSYS_GTREINFO _IOWR('E', 4, envsys_basic_info_t) | 196 | #define ENVSYS_GTREINFO _IOWR('E', 4, envsys_basic_info_t) | |
197 | 197 | |||
198 | #endif /* _SYS_ENVSYS_H_ */ | 198 | #endif /* _SYS_ENVSYS_H_ */ |
--- src/sys/sys/fdio.h 2016/01/22 23:35:18 1.5
+++ src/sys/sys/fdio.h 2016/01/23 01:26:14 1.6
@@ -1,84 +1,84 @@ | @@ -1,84 +1,84 @@ | |||
1 | /* $NetBSD: fdio.h,v 1.5 2016/01/22 23:35:18 dholland Exp $ */ | 1 | /* $NetBSD: fdio.h,v 1.6 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by John Kohl. | 8 | * by John Kohl. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright | |
16 | * notice, this list of conditions and the following disclaimer in the | 16 | * notice, this list of conditions and the following disclaimer in the | |
17 | * documentation and/or other materials provided with the distribution. | 17 | * documentation and/or other materials provided with the distribution. | |
18 | * | 18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #ifndef _SYS_FDIO_H_ | 32 | #ifndef _SYS_FDIO_H_ | |
33 | #define _SYS_FDIO_H_ | 33 | #define _SYS_FDIO_H_ | |
34 | 34 | |||
35 | #include <sys/ioccom.h> | 35 | #include <sys/ioccom.h> | |
36 | 36 | |||
37 | /* Floppy diskette definitions */ | 37 | /* Floppy diskette definitions */ | |
38 | 38 | |||
39 | enum fdformat_result { | 39 | enum fdformat_result { | |
40 | FDFORMAT_SUCCESS, | 40 | FDFORMAT_SUCCESS, | |
41 | FDFORMAT_MEDIA_ERROR, /* hardware reported a formatting | 41 | FDFORMAT_MEDIA_ERROR, /* hardware reported a formatting | |
42 | error */ | 42 | error */ | |
43 | FDFORMAT_CONFIG_ERROR /* something bogus in parameters */ | 43 | FDFORMAT_CONFIG_ERROR /* something bogus in parameters */ | |
44 | }; | 44 | }; | |
45 | 45 | |||
46 | #define FDFORMAT_VERSION 19961120 | 46 | #define FDFORMAT_VERSION 19961120 | |
47 | 47 | |||
48 | struct fdformat_cmd { | 48 | struct fdformat_cmd { | |
49 | unsigned formatcmd_version; /* FDFORMAT_VERSION */ | 49 | unsigned int formatcmd_version; /* FDFORMAT_VERSION */ | |
50 | int head; /* IN */ | 50 | int head; /* IN */ | |
51 | int cylinder; /* IN */ | 51 | int cylinder; /* IN */ | |
52 | }; | 52 | }; | |
53 | 53 | |||
54 | struct fdformat_parms { | 54 | struct fdformat_parms { | |
55 | /* list of items taken from i386 formatting glop (NEC 765); | 55 | /* list of items taken from i386 formatting glop (NEC 765); | |
56 | should be made the union of support needed for other devices. */ | 56 | should be made the union of support needed for other devices. */ | |
57 | unsigned fdformat_version; /* rev this when needed; write drivers to | 57 | unsigned int fdformat_version;/* rev this when needed; write drivers to | |
58 | allow forward compatibility, please, | 58 | allow forward compatibility, please, | |
59 | and add elements to the end of the | 59 | and add elements to the end of the | |
60 | structure */ | 60 | structure */ | |
61 | unsigned nbps; /* number of bytes per sector */ | 61 | unsigned int nbps; /* number of bytes per sector */ | |
62 | unsigned ncyl; /* number of cylinders */ | 62 | unsigned int ncyl; /* number of cylinders */ | |
63 | unsigned nspt; /* sectors per track */ | 63 | unsigned int nspt; /* sectors per track */ | |
64 | unsigned ntrk; /* number of heads/tracks per cyl */ | 64 | unsigned int ntrk; /* number of heads/tracks per cyl */ | |
65 | unsigned stepspercyl; /* steps per cylinder */ | 65 | unsigned int stepspercyl; /* steps per cylinder */ | |
66 | unsigned gaplen; /* formatting gap length */ | 66 | unsigned int gaplen; /* formatting gap length */ | |
67 | unsigned fillbyte; /* formatting fill byte */ | 67 | unsigned int fillbyte; /* formatting fill byte */ | |
68 | unsigned xfer_rate; /* in bits per second; driver | 68 | unsigned int xfer_rate; /* in bits per second; driver | |
69 | must convert */ | 69 | must convert */ | |
70 | unsigned interleave; /* interleave factor */ | 70 | unsigned int interleave; /* interleave factor */ | |
71 | }; | 71 | }; | |
72 | 72 | |||
73 | 73 | |||
74 | #define FDOPT_NORETRY 0x0001 /* no retries on failure (cleared on close) */ | 74 | #define FDOPT_NORETRY 0x0001 /* no retries on failure (cleared on close) */ | |
75 | #define FDOPT_SILENT 0x0002 /* no error messages (cleared on close) */ | 75 | #define FDOPT_SILENT 0x0002 /* no error messages (cleared on close) */ | |
76 | 76 | |||
77 | #define FDIOCGETOPTS _IOR('d', 114, int) /* drive options, see previous */ | 77 | #define FDIOCGETOPTS _IOR('d', 114, int) /* drive options, see previous */ | |
78 | #define FDIOCSETOPTS _IOW('d', 115, int) | 78 | #define FDIOCSETOPTS _IOW('d', 115, int) | |
79 | 79 | |||
80 | #define FDIOCSETFORMAT _IOW('d', 116, struct fdformat_parms) /* set format parms */ | 80 | #define FDIOCSETFORMAT _IOW('d', 116, struct fdformat_parms) /* set format parms */ | |
81 | #define FDIOCGETFORMAT _IOR('d', 117, struct fdformat_parms) /* get format parms */ | 81 | #define FDIOCGETFORMAT _IOR('d', 117, struct fdformat_parms) /* get format parms */ | |
82 | #define FDIOCFORMAT_TRACK _IOW('d', 118, struct fdformat_cmd) /* do it */ | 82 | #define FDIOCFORMAT_TRACK _IOW('d', 118, struct fdformat_cmd) /* do it */ | |
83 | 83 | |||
84 | #endif /* _SYS_FDIO_H_ */ | 84 | #endif /* _SYS_FDIO_H_ */ |
--- src/sys/sys/wdog.h 2016/01/22 23:47:04 1.4
+++ src/sys/sys/wdog.h 2016/01/23 01:26:14 1.5
@@ -1,109 +1,109 @@ | @@ -1,109 +1,109 @@ | |||
1 | /* $NetBSD: wdog.h,v 1.4 2016/01/22 23:47:04 dholland Exp $ */ | 1 | /* $NetBSD: wdog.h,v 1.5 2016/01/23 01:26:14 dholland Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2000 Zembu Labs, Inc. | 4 | * Copyright (c) 2000 Zembu Labs, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Author: Jason R. Thorpe <thorpej@zembu.com> | 7 | * Author: Jason R. Thorpe <thorpej@zembu.com> | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
15 | * notice, this list of conditions and the following disclaimer in the | 15 | * notice, this list of conditions and the following disclaimer in the | |
16 | * documentation and/or other materials provided with the distribution. | 16 | * documentation and/or other materials provided with the distribution. | |
17 | * 3. All advertising materials mentioning features or use of this software | 17 | * 3. All advertising materials mentioning features or use of this software | |
18 | * must display the following acknowledgement: | 18 | * must display the following acknowledgement: | |
19 | * This product includes software developed by Zembu Labs, Inc. | 19 | * This product includes software developed by Zembu Labs, Inc. | |
20 | * 4. Neither the name of Zembu Labs nor the names of its employees may | 20 | * 4. Neither the name of Zembu Labs nor the names of its employees may | |
21 | * be used to endorse or promote products derived from this software | 21 | * be used to endorse or promote products derived from this software | |
22 | * without specific prior written permission. | 22 | * without specific prior written permission. | |
23 | * | 23 | * | |
24 | * THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS | 24 | * THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS | |
25 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR- | 25 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR- | |
26 | * RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS- | 26 | * RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS- | |
27 | * CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT, | 27 | * CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
29 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 29 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #ifndef _SYS_WDOG_H_ | 36 | #ifndef _SYS_WDOG_H_ | |
37 | #define _SYS_WDOG_H_ | 37 | #define _SYS_WDOG_H_ | |
38 | 38 | |||
39 | #include <sys/ioccom.h> | 39 | #include <sys/ioccom.h> | |
40 | 40 | |||
41 | /* | 41 | /* | |
42 | * Definitions for manipulating watchdog timers. | 42 | * Definitions for manipulating watchdog timers. | |
43 | */ | 43 | */ | |
44 | 44 | |||
45 | /* This must match struct device's "dv_xname" size. */ | 45 | /* This must match struct device's "dv_xname" size. */ | |
46 | #define WDOG_NAMESIZE 16 | 46 | #define WDOG_NAMESIZE 16 | |
47 | 47 | |||
48 | struct wdog_mode { | 48 | struct wdog_mode { | |
49 | char wm_name[WDOG_NAMESIZE]; | 49 | char wm_name[WDOG_NAMESIZE]; | |
50 | int wm_mode; /* timer mode */ | 50 | int wm_mode; /* timer mode */ | |
51 | unsigned wm_period; /* timer period (seconds) */ | 51 | unsigned int wm_period; /* timer period (seconds) */ | |
52 | }; | 52 | }; | |
53 | 53 | |||
54 | /* | 54 | /* | |
55 | * GMODE -- get mode of watchdog specified by wm_name. | 55 | * GMODE -- get mode of watchdog specified by wm_name. | |
56 | * | 56 | * | |
57 | * SMODE -- set mode of watchdog specified by wm_mame. If | 57 | * SMODE -- set mode of watchdog specified by wm_mame. If | |
58 | * wm_mode is not DISARMED, the watchdog is armed, | 58 | * wm_mode is not DISARMED, the watchdog is armed, | |
59 | * if another watchdog is not already running. | 59 | * if another watchdog is not already running. | |
60 | */ | 60 | */ | |
61 | #define WDOGIOC_GMODE _IOWR('w', 0, struct wdog_mode) | 61 | #define WDOGIOC_GMODE _IOWR('w', 0, struct wdog_mode) | |
62 | #define WDOGIOC_SMODE _IOW('w', 1, struct wdog_mode) | 62 | #define WDOGIOC_SMODE _IOW('w', 1, struct wdog_mode) | |
63 | 63 | |||
64 | /* | 64 | /* | |
65 | * WHICH -- returns the mode information of the currently armed | 65 | * WHICH -- returns the mode information of the currently armed | |
66 | * watchdog timer. | 66 | * watchdog timer. | |
67 | */ | 67 | */ | |
68 | #define WDOGIOC_WHICH _IOR('w', 2, struct wdog_mode) | 68 | #define WDOGIOC_WHICH _IOR('w', 2, struct wdog_mode) | |
69 | 69 | |||
70 | /* | 70 | /* | |
71 | * TICKLE -- tickle the currently armed watchdog timer if the | 71 | * TICKLE -- tickle the currently armed watchdog timer if the | |
72 | * mode of that timer is UTICKLE. | 72 | * mode of that timer is UTICKLE. | |
73 | */ | 73 | */ | |
74 | #define WDOGIOC_TICKLE _IO('w', 3) | 74 | #define WDOGIOC_TICKLE _IO('w', 3) | |
75 | 75 | |||
76 | /* | 76 | /* | |
77 | * GTICKLER -- get the PID of the last process to tickle the timer. | 77 | * GTICKLER -- get the PID of the last process to tickle the timer. | |
78 | */ | 78 | */ | |
79 | #define WDOGIOC_GTICKLER _IOR('w', 4, pid_t) | 79 | #define WDOGIOC_GTICKLER _IOR('w', 4, pid_t) | |
80 | 80 | |||
81 | /* | 81 | /* | |
82 | * GWDOGS -- fill in the character array with the names of all of | 82 | * GWDOGS -- fill in the character array with the names of all of | |
83 | * the watchdog timers present on the system. The names | 83 | * the watchdog timers present on the system. The names | |
84 | * will be padded out to WDOG_NAMESIZE. Thus, the argument | 84 | * will be padded out to WDOG_NAMESIZE. Thus, the argument | |
85 | * should be (count * WDOG_NAMESIZE) bytes long. | 85 | * should be (count * WDOG_NAMESIZE) bytes long. | |
86 | */ | 86 | */ | |
87 | struct wdog_conf { | 87 | struct wdog_conf { | |
88 | char *wc_names; | 88 | char *wc_names; | |
89 | int wc_count; | 89 | int wc_count; | |
90 | }; | 90 | }; | |
91 | #define WDOGIOC_GWDOGS _IOWR('w', 5, struct wdog_conf) | 91 | #define WDOGIOC_GWDOGS _IOWR('w', 5, struct wdog_conf) | |
92 | 92 | |||
93 | #define WDOG_MODE_DISARMED 0 /* watchdog is disarmed */ | 93 | #define WDOG_MODE_DISARMED 0 /* watchdog is disarmed */ | |
94 | #define WDOG_MODE_KTICKLE 1 /* kernel tickles watchdog */ | 94 | #define WDOG_MODE_KTICKLE 1 /* kernel tickles watchdog */ | |
95 | #define WDOG_MODE_UTICKLE 2 /* user tickles watchdog */ | 95 | #define WDOG_MODE_UTICKLE 2 /* user tickles watchdog */ | |
96 | #define WDOG_MODE_ETICKLE 3 /* external program tickles watchdog */ | 96 | #define WDOG_MODE_ETICKLE 3 /* external program tickles watchdog */ | |
97 | 97 | |||
98 | #define WDOG_MODE_MASK 0x03 | 98 | #define WDOG_MODE_MASK 0x03 | |
99 | 99 | |||
100 | #define WDOG_FEATURE_ALARM 0x10 /* enable audible alarm on expire */ | 100 | #define WDOG_FEATURE_ALARM 0x10 /* enable audible alarm on expire */ | |
101 | 101 | |||
102 | #define WDOG_FEATURE_MASK 0x10 | 102 | #define WDOG_FEATURE_MASK 0x10 | |
103 | 103 | |||
104 | #define WDOG_PERIOD_DEFAULT ((u_int)-1) | 104 | #define WDOG_PERIOD_DEFAULT ((u_int)-1) | |
105 | 105 | |||
106 | /* Period is expressed in seconds. */ | 106 | /* Period is expressed in seconds. */ | |
107 | #define WDOG_PERIOD_TO_TICKS(period) ((period) * hz) | 107 | #define WDOG_PERIOD_TO_TICKS(period) ((period) * hz) | |
108 | 108 | |||
109 | #endif /* _SYS_WDOG_H_ */ | 109 | #endif /* _SYS_WDOG_H_ */ |