Deleted Added
full compact
main.c (281114) main.c (281138)
1/*-
2 * Copyright (c) 2008-2010 Rui Paulo
3 * Copyright (c) 2006 Marcel Moolenaar
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008-2010 Rui Paulo
3 * Copyright (c) 2006 Marcel Moolenaar
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/boot/efi/loader/main.c 281114 2015-04-05 18:37:39Z andrew $");
29__FBSDID("$FreeBSD: head/sys/boot/efi/loader/main.c 281138 2015-04-06 06:55:47Z rpaulo $");
30
31#include <stand.h>
32#include <string.h>
33#include <setjmp.h>
34
35#include <efi.h>
36#include <efilib.h>
37
38#include <bootstrap.h>
30
31#include <stand.h>
32#include <string.h>
33#include <setjmp.h>
34
35#include <efi.h>
36#include <efilib.h>
37
38#include <bootstrap.h>
39#include <smbios.h>
40
39#include "loader_efi.h"
40
41extern char bootprog_name[];
42extern char bootprog_rev[];
43extern char bootprog_date[];
44extern char bootprog_maker[];
45
46struct devdesc currdev; /* our current device */

--- 11 unchanged lines hidden (view full) ---

58EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID;
59EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID;
60
61EFI_STATUS
62main(int argc, CHAR16 *argv[])
63{
64 char vendor[128];
65 EFI_LOADED_IMAGE *img;
41#include "loader_efi.h"
42
43extern char bootprog_name[];
44extern char bootprog_rev[];
45extern char bootprog_date[];
46extern char bootprog_maker[];
47
48struct devdesc currdev; /* our current device */

--- 11 unchanged lines hidden (view full) ---

60EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID;
61EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID;
62
63EFI_STATUS
64main(int argc, CHAR16 *argv[])
65{
66 char vendor[128];
67 EFI_LOADED_IMAGE *img;
68 EFI_GUID *guid;
66 int i;
67
68 /*
69 * XXX Chicken-and-egg problem; we want to have console output
70 * early, but some console attributes may depend on reading from
71 * eg. the boot device, which we can't do yet. We can use
72 * printf() etc. once this is done.
73 */

--- 49 unchanged lines hidden (view full) ---

123 setenv("LINES", "24", 1); /* optional */
124
125 archsw.arch_autoload = efi_autoload;
126 archsw.arch_getdev = efi_getdev;
127 archsw.arch_copyin = efi_copyin;
128 archsw.arch_copyout = efi_copyout;
129 archsw.arch_readin = efi_readin;
130
69 int i;
70
71 /*
72 * XXX Chicken-and-egg problem; we want to have console output
73 * early, but some console attributes may depend on reading from
74 * eg. the boot device, which we can't do yet. We can use
75 * printf() etc. once this is done.
76 */

--- 49 unchanged lines hidden (view full) ---

126 setenv("LINES", "24", 1); /* optional */
127
128 archsw.arch_autoload = efi_autoload;
129 archsw.arch_getdev = efi_getdev;
130 archsw.arch_copyin = efi_copyin;
131 archsw.arch_copyout = efi_copyout;
132 archsw.arch_readin = efi_readin;
133
134 for (i = 0; i < ST->NumberOfTableEntries; i++) {
135 guid = &ST->ConfigurationTable[i].VendorGuid;
136 if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) {
137 smbios_detect(ST->ConfigurationTable[i].VendorTable);
138 break;
139 }
140 }
141
131 interact(NULL); /* doesn't return */
132
133 return (EFI_SUCCESS); /* keep compiler happy */
134}
135
136COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
137
138static int

--- 270 unchanged lines hidden ---
142 interact(NULL); /* doesn't return */
143
144 return (EFI_SUCCESS); /* keep compiler happy */
145}
146
147COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
148
149static int

--- 270 unchanged lines hidden ---