Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/efi/boot1/boot1.c
Show First 20 Lines • Show All 454 Lines • ▼ Show 20 Lines | efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) | ||||
} | } | ||||
putchar('\n'); | putchar('\n'); | ||||
/* Determine the devpath of our image so we can prefer it. */ | /* Determine the devpath of our image so we can prefer it. */ | ||||
status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); | status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); | ||||
imgpath = NULL; | imgpath = NULL; | ||||
if (status == EFI_SUCCESS) { | if (status == EFI_SUCCESS) { | ||||
text = efi_devpath_name(img->FilePath); | text = efi_devpath_name(img->FilePath); | ||||
if (text != NULL) { | |||||
printf(" Load Path: %S\n", text); | printf(" Load Path: %S\n", text); | ||||
efi_setenv_freebsd_wcs("Boot1Path", text); | efi_setenv_freebsd_wcs("Boot1Path", text); | ||||
efi_free_devpath_name(text); | efi_free_devpath_name(text); | ||||
status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, | status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, | ||||
(void **)&imgpath); | (void **)&imgpath); | ||||
if (status != EFI_SUCCESS) { | if (status != EFI_SUCCESS) { | ||||
DPRINTF("Failed to get image DevicePath (%lu)\n", | DPRINTF("Failed to get image DevicePath (%lu)\n", | ||||
EFI_ERROR_CODE(status)); | EFI_ERROR_CODE(status)); | ||||
} else { | } else { | ||||
text = efi_devpath_name(imgpath); | text = efi_devpath_name(imgpath); | ||||
printf(" Load Device: %S\n", text); | printf(" Load Device: %S\n", text); | ||||
efi_setenv_freebsd_wcs("Boot1Dev", text); | efi_setenv_freebsd_wcs("Boot1Dev", text); | ||||
efi_free_devpath_name(text); | efi_free_devpath_name(text); | ||||
} | } | ||||
} | |||||
} | } | ||||
/* Get all the device handles */ | /* Get all the device handles */ | ||||
hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); | hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); | ||||
handles = malloc(hsize); | handles = malloc(hsize); | ||||
if (handles == NULL) { | if (handles == NULL) { | ||||
printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT); | printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |