Changeset View
Changeset View
Standalone View
Standalone View
stable/10/sys/boot/amd64/efi/main.c
Show All 30 Lines | |||||
#include <stand.h> | #include <stand.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <setjmp.h> | #include <setjmp.h> | ||||
#include <efi.h> | #include <efi.h> | ||||
#include <efilib.h> | #include <efilib.h> | ||||
#include <bootstrap.h> | #include <bootstrap.h> | ||||
#include <smbios.h> | |||||
#include "x86_efi.h" | #include "x86_efi.h" | ||||
extern char bootprog_name[]; | extern char bootprog_name[]; | ||||
extern char bootprog_rev[]; | extern char bootprog_rev[]; | ||||
extern char bootprog_date[]; | extern char bootprog_date[]; | ||||
extern char bootprog_maker[]; | extern char bootprog_maker[]; | ||||
struct devdesc currdev; /* our current device */ | struct devdesc currdev; /* our current device */ | ||||
struct arch_switch archsw; /* MI/MD interface boundary */ | struct arch_switch archsw; /* MI/MD interface boundary */ | ||||
EFI_GUID acpi = ACPI_TABLE_GUID; | EFI_GUID acpi = ACPI_TABLE_GUID; | ||||
EFI_GUID acpi20 = ACPI_20_TABLE_GUID; | EFI_GUID acpi20 = ACPI_20_TABLE_GUID; | ||||
EFI_GUID devid = DEVICE_PATH_PROTOCOL; | EFI_GUID devid = DEVICE_PATH_PROTOCOL; | ||||
EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; | EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; | ||||
EFI_GUID mps = MPS_TABLE_GUID; | EFI_GUID mps = MPS_TABLE_GUID; | ||||
EFI_GUID netid = EFI_SIMPLE_NETWORK_PROTOCOL; | EFI_GUID netid = EFI_SIMPLE_NETWORK_PROTOCOL; | ||||
EFI_GUID smbios = SMBIOS_TABLE_GUID; | EFI_GUID smbios = SMBIOS_TABLE_GUID; | ||||
EFI_STATUS | EFI_STATUS | ||||
main(int argc, CHAR16 *argv[]) | main(int argc, CHAR16 *argv[]) | ||||
{ | { | ||||
char vendor[128]; | char vendor[128]; | ||||
EFI_LOADED_IMAGE *img; | EFI_LOADED_IMAGE *img; | ||||
EFI_GUID *guid; | |||||
int i; | int i; | ||||
/* | /* | ||||
* XXX Chicken-and-egg problem; we want to have console output | * XXX Chicken-and-egg problem; we want to have console output | ||||
* early, but some console attributes may depend on reading from | * early, but some console attributes may depend on reading from | ||||
* eg. the boot device, which we can't do yet. We can use | * eg. the boot device, which we can't do yet. We can use | ||||
* printf() etc. once this is done. | * printf() etc. once this is done. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | main(int argc, CHAR16 *argv[]) | ||||
setenv("LINES", "24", 1); /* optional */ | setenv("LINES", "24", 1); /* optional */ | ||||
archsw.arch_autoload = x86_efi_autoload; | archsw.arch_autoload = x86_efi_autoload; | ||||
archsw.arch_getdev = x86_efi_getdev; | archsw.arch_getdev = x86_efi_getdev; | ||||
archsw.arch_copyin = x86_efi_copyin; | archsw.arch_copyin = x86_efi_copyin; | ||||
archsw.arch_copyout = x86_efi_copyout; | archsw.arch_copyout = x86_efi_copyout; | ||||
archsw.arch_readin = x86_efi_readin; | archsw.arch_readin = x86_efi_readin; | ||||
for (i = 0; i < ST->NumberOfTableEntries; i++) { | |||||
guid = &ST->ConfigurationTable[i].VendorGuid; | |||||
if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { | |||||
smbios_detect(ST->ConfigurationTable[i].VendorTable); | |||||
break; | |||||
} | |||||
} | |||||
interact(); /* doesn't return */ | interact(); /* doesn't return */ | ||||
return (EFI_SUCCESS); /* keep compiler happy */ | return (EFI_SUCCESS); /* keep compiler happy */ | ||||
} | } | ||||
COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); | COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |