xref: /freebsd/stand/efi/loader/conf.c (revision dece5b05f577fc4c6b89af7ad48dfbdf7cc4945c)
1 /*-
2  * Copyright (c) 2006 Marcel Moolenaar
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 #include <stand.h>
28 #include <bootstrap.h>
29 #include <efi.h>
30 #include <efilib.h>
31 #include <efizfs.h>
32 
33 extern struct devsw vdisk_dev;
34 
35 struct devsw *devsw[] = {
36 	&efipart_fddev,
37 	&efipart_cddev,
38 	&efipart_hddev,
39 	&efihttp_dev, /* ordering with efinet_dev matters */
40 #if defined(LOADER_NET_SUPPORT)
41 	&efinet_dev,
42 #endif
43 	&vdisk_dev,
44 #ifdef EFI_ZFS_BOOT
45 	&zfs_dev,
46 #endif
47 #if defined(LOADER_MD_SUPPORT)
48 	&md_dev,
49 #endif
50 	NULL
51 };
52 
53 struct fs_ops *file_system[] = {
54 #ifdef EFI_ZFS_BOOT
55 	&zfs_fsops,
56 	&zstdfs_fsops,
57 #endif
58 	&dosfs_fsops,
59 	&ufs_fsops,
60 	&cd9660_fsops,
61 	&efihttp_fsops,
62 	&tftp_fsops,
63 	&nfs_fsops,
64 	&gzipfs_fsops,
65 	&bzipfs_fsops,
66 	&xzfs_fsops,
67 	NULL
68 };
69 
70 struct netif_driver *netif_drivers[] = {
71 #if defined(LOADER_NET_SUPPORT)
72 	&efinetif,
73 #endif
74 	NULL
75 };
76 
77 extern struct console efi_console;
78 extern struct console eficom;
79 #if defined(__aarch64__) && __FreeBSD_version < 1500000
80 /* Hack for backward compatibility -- but only for a while */
81 extern struct console comconsole;
82 #endif
83 #if defined(__amd64__) || defined(__i386__)
84 extern struct console comconsole;
85 extern struct console nullconsole;
86 extern struct console spinconsole;
87 #endif
88 
89 struct console *consoles[] = {
90 	&efi_console,
91 	&eficom,
92 #if defined(__aarch64__) && __FreeBSD_version < 1500000
93 	&comconsole,
94 #endif
95 #if defined(__amd64__) || defined(__i386__)
96 	&comconsole,
97 	&nullconsole,
98 	&spinconsole,
99 #endif
100 	NULL
101 };
102