Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / config / config.c
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2, or (at
5  * your option) any later version.
6  */
7
8 FILE_LICENCE ( GPL2_OR_LATER );
9
10 #include <config/general.h>
11 #include <config/console.h>
12 #include <config/sideband.h>
13 #include <config/settings.h>
14
15 /** @file
16  *
17  * Configuration options
18  *
19  * This file contains macros that pull various objects into the link
20  * based on definitions in configuration header files. Ideally it
21  * should be the only place in iPXE where one might need to use #ifdef
22  * for compile-time options.
23  *
24  * In the fairly common case where an object should only be considered
25  * for inclusion if the subsystem it depends on is present, its
26  * configuration macros should be placed in a file named
27  * <tt>config_<i>subsystem</i>.c</tt>, where @e subsystem is the
28  * object basename of the main source file for that subsystem. The
29  * build system will pull in that file if @c subsystem.c is included
30  * in the final iPXE executable built.
31  */
32
33 /*
34  * Build ID string calculations
35  *
36  */
37 #undef XSTR
38 #undef STR
39 #define XSTR(s) STR(s)
40 #define STR(s) #s
41
42 #ifdef BUILD_SERIAL
43 #include "config/.buildserial.h"
44 #define BUILD_SERIAL_STR " #" XSTR(BUILD_SERIAL_NUM)
45 #else
46 #define BUILD_SERIAL_STR ""
47 #endif
48
49 #ifdef BUILD_ID
50 #define BUILD_ID_STR " " BUILD_ID
51 #else
52 #define BUILD_ID_STR ""
53 #endif
54
55 #if defined(BUILD_ID) || defined(BUILD_SERIAL)
56 #define BUILD_STRING " [build" BUILD_ID_STR BUILD_SERIAL_STR "]"
57 #else
58 #define BUILD_STRING ""
59 #endif
60
61 /*
62  * Drag in all requested console types
63  *
64  */
65
66 #ifdef CONSOLE_PCBIOS
67 REQUIRE_OBJECT ( bios_console );
68 #endif
69 #ifdef CONSOLE_SERIAL
70 REQUIRE_OBJECT ( serial_console );
71 #endif
72 #ifdef CONSOLE_DIRECT_VGA
73 REQUIRE_OBJECT ( video_subr );
74 #endif
75 #ifdef CONSOLE_PC_KBD
76 REQUIRE_OBJECT ( pc_kbd );
77 #endif
78 #ifdef CONSOLE_SYSLOG
79 REQUIRE_OBJECT ( syslog );
80 #endif
81 #ifdef CONSOLE_SYSLOGS
82 REQUIRE_OBJECT ( syslogs );
83 #endif
84 #ifdef CONSOLE_EFI
85 REQUIRE_OBJECT ( efi_console );
86 #endif
87 #ifdef CONSOLE_LINUX
88 REQUIRE_OBJECT ( linux_console );
89 #endif
90 #ifdef CONSOLE_VMWARE
91 REQUIRE_OBJECT ( vmconsole );
92 #endif
93 #ifdef CONSOLE_DEBUGCON
94 REQUIRE_OBJECT ( debugcon );
95 #endif
96 #ifdef CONSOLE_VESAFB
97 REQUIRE_OBJECT ( vesafb );
98 #endif
99
100 /*
101  * Drag in all requested network protocols
102  *
103  */
104 #ifdef NET_PROTO_IPV4
105 REQUIRE_OBJECT ( ipv4 );
106 #endif
107 #ifdef NET_PROTO_IPV6
108 REQUIRE_OBJECT ( ipv6 );
109 #endif
110
111 /*
112  * Drag in all requested PXE support
113  *
114  */
115 #ifdef PXE_MENU
116 REQUIRE_OBJECT ( pxemenu );
117 #endif
118 #ifdef PXE_STACK
119 REQUIRE_OBJECT ( pxe_call );
120 #endif
121
122 /*
123  * Drag in all requested download protocols
124  *
125  */
126 #ifdef DOWNLOAD_PROTO_TFTP
127 REQUIRE_OBJECT ( tftp );
128 #endif
129 #ifdef DOWNLOAD_PROTO_HTTP
130 REQUIRE_OBJECT ( http );
131 #endif
132 #ifdef DOWNLOAD_PROTO_HTTPS
133 REQUIRE_OBJECT ( https );
134 #endif
135 #ifdef DOWNLOAD_PROTO_FTP
136 REQUIRE_OBJECT ( ftp );
137 #endif
138 #ifdef DOWNLOAD_PROTO_NFS
139 REQUIRE_OBJECT ( nfs_open );
140 #endif
141 #ifdef DOWNLOAD_PROTO_SLAM
142 REQUIRE_OBJECT ( slam );
143 #endif
144
145 /*
146  * Drag in all requested SAN boot protocols
147  *
148  */
149 #ifdef SANBOOT_PROTO_ISCSI
150 REQUIRE_OBJECT ( iscsi );
151 #endif
152
153 /*
154  * Drag in all requested resolvers
155  *
156  */
157 #ifdef DNS_RESOLVER
158 REQUIRE_OBJECT ( dns );
159 #endif
160
161 /*
162  * Drag in all requested image formats
163  *
164  */
165 #ifdef IMAGE_NBI
166 REQUIRE_OBJECT ( nbi );
167 #endif
168 #ifdef IMAGE_ELF
169 REQUIRE_OBJECT ( elfboot );
170 #endif
171 #ifdef IMAGE_MULTIBOOT
172 REQUIRE_OBJECT ( multiboot );
173 #endif
174 #ifdef IMAGE_PXE
175 REQUIRE_OBJECT ( pxe_image );
176 #endif
177 #ifdef IMAGE_SCRIPT
178 REQUIRE_OBJECT ( script );
179 #endif
180 #ifdef IMAGE_BZIMAGE
181 REQUIRE_OBJECT ( bzimage );
182 #endif
183 #ifdef IMAGE_ELTORITO
184 REQUIRE_OBJECT ( eltorito );
185 #endif
186 #ifdef IMAGE_COMBOOT
187 REQUIRE_OBJECT ( comboot );
188 REQUIRE_OBJECT ( com32 );
189 REQUIRE_OBJECT ( comboot_call );
190 REQUIRE_OBJECT ( com32_call );
191 REQUIRE_OBJECT ( com32_wrapper );
192 REQUIRE_OBJECT ( comboot_resolv );
193 #endif
194 #ifdef IMAGE_EFI
195 REQUIRE_OBJECT ( efi_image );
196 #endif
197 #ifdef IMAGE_SDI
198 REQUIRE_OBJECT ( sdi );
199 #endif
200 #ifdef IMAGE_PNM
201 REQUIRE_OBJECT ( pnm );
202 #endif
203 #ifdef IMAGE_PNG
204 REQUIRE_OBJECT ( png );
205 #endif
206
207 /*
208  * Drag in all requested commands
209  *
210  */
211 #ifdef AUTOBOOT_CMD
212 REQUIRE_OBJECT ( autoboot_cmd );
213 #endif
214 #ifdef NVO_CMD
215 REQUIRE_OBJECT ( nvo_cmd );
216 #endif
217 #ifdef CONFIG_CMD
218 REQUIRE_OBJECT ( config_cmd );
219 #endif
220 #ifdef IFMGMT_CMD
221 REQUIRE_OBJECT ( ifmgmt_cmd );
222 #endif
223 /* IWMGMT_CMD is brought in by net80211.c if requested */
224 #ifdef ROUTE_CMD
225 REQUIRE_OBJECT ( route_cmd );
226 #endif
227 #ifdef IMAGE_CMD
228 REQUIRE_OBJECT ( image_cmd );
229 #endif
230 #ifdef IMAGE_TRUST_CMD
231 REQUIRE_OBJECT ( image_trust_cmd );
232 #endif
233 #ifdef DHCP_CMD
234 REQUIRE_OBJECT ( dhcp_cmd );
235 #endif
236 #ifdef SANBOOT_CMD
237 REQUIRE_OBJECT ( sanboot_cmd );
238 #endif
239 #ifdef MENU_CMD
240 REQUIRE_OBJECT ( menu_cmd );
241 #endif
242 #ifdef LOGIN_CMD
243 REQUIRE_OBJECT ( login_cmd );
244 #endif
245 #ifdef TIME_CMD
246 REQUIRE_OBJECT ( time_cmd );
247 #endif
248 #ifdef DIGEST_CMD
249 REQUIRE_OBJECT ( digest_cmd );
250 #endif
251 #ifdef PXE_CMD
252 REQUIRE_OBJECT ( pxe_cmd );
253 #endif
254 #ifdef LOTEST_CMD
255 REQUIRE_OBJECT ( lotest_cmd );
256 #endif
257 #ifdef VLAN_CMD
258 REQUIRE_OBJECT ( vlan_cmd );
259 #endif
260 #ifdef POWEROFF_CMD
261 REQUIRE_OBJECT ( poweroff_cmd );
262 #endif
263 #ifdef REBOOT_CMD
264 REQUIRE_OBJECT ( reboot_cmd );
265 #endif
266 #ifdef CPUID_CMD
267 REQUIRE_OBJECT ( cpuid_cmd );
268 #endif
269 #ifdef SYNC_CMD
270 REQUIRE_OBJECT ( sync_cmd );
271 #endif
272 #ifdef NSLOOKUP_CMD
273 REQUIRE_OBJECT ( nslookup_cmd );
274 #endif
275 #ifdef PCI_CMD
276 REQUIRE_OBJECT ( pci_cmd );
277 #endif
278 #ifdef PARAM_CMD
279 REQUIRE_OBJECT ( param_cmd );
280 #endif
281 #ifdef NEIGHBOUR_CMD
282 REQUIRE_OBJECT ( neighbour_cmd );
283 #endif
284 #ifdef PING_CMD
285 REQUIRE_OBJECT ( ping_cmd );
286 #endif
287 #ifdef CONSOLE_CMD
288 REQUIRE_OBJECT ( console_cmd );
289 #endif
290 #ifdef IPSTAT_CMD
291 REQUIRE_OBJECT ( ipstat_cmd );
292 #endif
293 #ifdef PROFSTAT_CMD
294 REQUIRE_OBJECT ( profstat_cmd );
295 #endif
296
297 /*
298  * Drag in miscellaneous objects
299  *
300  */
301 #ifdef NULL_TRAP
302 REQUIRE_OBJECT ( nulltrap );
303 #endif
304 #ifdef GDBSERIAL
305 REQUIRE_OBJECT ( gdbidt );
306 REQUIRE_OBJECT ( gdbserial );
307 REQUIRE_OBJECT ( gdbstub_cmd );
308 #endif
309 #ifdef GDBUDP
310 REQUIRE_OBJECT ( gdbidt );
311 REQUIRE_OBJECT ( gdbudp );
312 REQUIRE_OBJECT ( gdbstub_cmd );
313 #endif
314
315 /*
316  * Drag in objects that are always required, but not dragged in via
317  * symbol dependencies.
318  *
319  */
320 REQUIRE_OBJECT ( device );
321 REQUIRE_OBJECT ( embedded );
322
323 /* linux drivers aren't picked up by the parserom utility so drag them in here */
324 #ifdef DRIVERS_LINUX
325 REQUIRE_OBJECT ( tap );
326 #endif
327
328 /*
329  * Drag in relevant sideband entry points
330  */
331 #ifdef CONFIG_BOFM
332 #ifdef BOFM_EFI
333 REQUIRE_OBJECT ( efi_bofm );
334 #endif /* BOFM_EFI */
335 #endif /* CONFIG_BOFM */
336
337 /*
338  * Drag in relevant settings sources
339  */
340 #ifdef PCI_SETTINGS
341 REQUIRE_OBJECT ( pci_settings );
342 #endif
343 #ifdef VMWARE_SETTINGS
344 REQUIRE_OBJECT ( guestinfo );
345 #endif
346 #ifdef CPUID_SETTINGS
347 REQUIRE_OBJECT ( cpuid_settings );
348 #endif
349 #ifdef MEMMAP_SETTINGS
350 REQUIRE_OBJECT ( memmap_settings );
351 #endif
352
353 /*
354  * Drag in selected keyboard map
355  */
356 #define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
357 #define REQUIRE_KEYMAP( _map ) REQUIRE_KEYMAP_OBJECT ( _map )
358 REQUIRE_KEYMAP ( KEYBOARD_MAP );