Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/efi/loader/main.c
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
EFI_STATUS | EFI_STATUS | ||||
main(int argc, CHAR16 *argv[]) | main(int argc, CHAR16 *argv[]) | ||||
{ | { | ||||
char var[128]; | char var[128]; | ||||
EFI_LOADED_IMAGE *img; | EFI_LOADED_IMAGE *img; | ||||
EFI_GUID *guid; | EFI_GUID *guid; | ||||
int i, j, vargood; | int i, j, vargood; | ||||
UINTN k; | |||||
/* | /* | ||||
* 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. | ||||
*/ | */ | ||||
cons_probe(); | cons_probe(); | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | main(int argc, CHAR16 *argv[]) | ||||
setenv("LINES", "24", 1); /* optional */ | setenv("LINES", "24", 1); /* optional */ | ||||
archsw.arch_autoload = efi_autoload; | archsw.arch_autoload = efi_autoload; | ||||
archsw.arch_getdev = efi_getdev; | archsw.arch_getdev = efi_getdev; | ||||
archsw.arch_copyin = efi_copyin; | archsw.arch_copyin = efi_copyin; | ||||
archsw.arch_copyout = efi_copyout; | archsw.arch_copyout = efi_copyout; | ||||
archsw.arch_readin = efi_readin; | archsw.arch_readin = efi_readin; | ||||
for (i = 0; i < ST->NumberOfTableEntries; i++) { | for (k = 0; k < ST->NumberOfTableEntries; k++) { | ||||
guid = &ST->ConfigurationTable[i].VendorGuid; | guid = &ST->ConfigurationTable[k].VendorGuid; | ||||
if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { | if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { | ||||
smbios_detect(ST->ConfigurationTable[i].VendorTable); | smbios_detect(ST->ConfigurationTable[k].VendorTable); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
interact(NULL); /* doesn't return */ | interact(NULL); /* doesn't return */ | ||||
return (EFI_SUCCESS); /* keep compiler happy */ | return (EFI_SUCCESS); /* keep compiler happy */ | ||||
} | } | ||||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", | ||||
guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], | guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], | ||||
guid->Data4[5], guid->Data4[6], guid->Data4[7]); | guid->Data4[5], guid->Data4[6], guid->Data4[7]); | ||||
return (buf); | return (buf); | ||||
} | } | ||||
static int | static int | ||||
command_configuration(int argc, char *argv[]) | command_configuration(int argc, char *argv[]) | ||||
{ | { | ||||
int i; | UINTN i; | ||||
printf("NumberOfTableEntries=%ld\n", ST->NumberOfTableEntries); | printf("NumberOfTableEntries=%ld\n", ST->NumberOfTableEntries); | ||||
for (i = 0; i < ST->NumberOfTableEntries; i++) { | for (i = 0; i < ST->NumberOfTableEntries; i++) { | ||||
EFI_GUID *guid; | EFI_GUID *guid; | ||||
printf(" "); | printf(" "); | ||||
guid = &ST->ConfigurationTable[i].VendorGuid; | guid = &ST->ConfigurationTable[i].VendorGuid; | ||||
if (!memcmp(guid, &mps, sizeof(EFI_GUID))) | if (!memcmp(guid, &mps, sizeof(EFI_GUID))) | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
command_nvram(int argc, char *argv[]) | command_nvram(int argc, char *argv[]) | ||||
{ | { | ||||
CHAR16 var[128]; | CHAR16 var[128]; | ||||
CHAR16 *data; | CHAR16 *data; | ||||
EFI_STATUS status; | EFI_STATUS status; | ||||
EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; | EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; | ||||
UINTN varsz, datasz; | UINTN varsz, datasz, i; | ||||
SIMPLE_TEXT_OUTPUT_INTERFACE *conout; | SIMPLE_TEXT_OUTPUT_INTERFACE *conout; | ||||
int i; | |||||
conout = ST->ConOut; | conout = ST->ConOut; | ||||
/* Initiate the search */ | /* Initiate the search */ | ||||
status = RS->GetNextVariableName(&varsz, NULL, NULL); | status = RS->GetNextVariableName(&varsz, NULL, NULL); | ||||
for (; status != EFI_NOT_FOUND; ) { | for (; status != EFI_NOT_FOUND; ) { | ||||
status = RS->GetNextVariableName(&varsz, var, &varguid); | status = RS->GetNextVariableName(&varsz, var, &varguid); | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |