Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/amd64/efirt.c
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
#include <vm/vm_map.h> | #include <vm/vm_map.h> | ||||
#include <vm/vm_object.h> | #include <vm/vm_object.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/vm_pager.h> | #include <vm/vm_pager.h> | ||||
static struct efi_systbl *efi_systbl; | static struct efi_systbl *efi_systbl; | ||||
static struct efi_cfgtbl *efi_cfgtbl; | static struct efi_cfgtbl *efi_cfgtbl; | ||||
static struct efi_rt *efi_runtime; | static struct efi_rt *efi_runtime; | ||||
static struct cdev *efi_cdev; | |||||
static int efi_status2err[25] = { | static int efi_status2err[25] = { | ||||
0, /* EFI_SUCCESS */ | 0, /* EFI_SUCCESS */ | ||||
ENOEXEC, /* EFI_LOAD_ERROR */ | ENOEXEC, /* EFI_LOAD_ERROR */ | ||||
EINVAL, /* EFI_INVALID_PARAMETER */ | EINVAL, /* EFI_INVALID_PARAMETER */ | ||||
ENOSYS, /* EFI_UNSUPPORTED */ | ENOSYS, /* EFI_UNSUPPORTED */ | ||||
EMSGSIZE, /* EFI_BAD_BUFFER_SIZE */ | EMSGSIZE, /* EFI_BAD_BUFFER_SIZE */ | ||||
EOVERFLOW, /* EFI_BUFFER_TOO_SMALL */ | EOVERFLOW, /* EFI_BUFFER_TOO_SMALL */ | ||||
▲ Show 20 Lines • Show All 325 Lines • ▼ Show 20 Lines | efi_runtime = (efi_systbl->st_rt == 0) ? NULL : | ||||
(struct efi_rt *)efi_systbl->st_rt; | (struct efi_rt *)efi_systbl->st_rt; | ||||
if (efi_runtime == NULL) { | if (efi_runtime == NULL) { | ||||
if (bootverbose) | if (bootverbose) | ||||
printf("EFI runtime services table is not present\n"); | printf("EFI runtime services table is not present\n"); | ||||
efi_destroy_1t1_map(); | efi_destroy_1t1_map(); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
return (0); | return (efidev_init(&efi_cdev)); | ||||
} | } | ||||
static void | static void | ||||
efi_uninit(void) | efi_uninit(void) | ||||
{ | { | ||||
efidev_uninit(efi_cdev); | |||||
efi_destroy_1t1_map(); | efi_destroy_1t1_map(); | ||||
efi_systbl = NULL; | efi_systbl = NULL; | ||||
efi_cfgtbl = NULL; | efi_cfgtbl = NULL; | ||||
efi_runtime = NULL; | efi_runtime = NULL; | ||||
mtx_destroy(&efi_lock); | mtx_destroy(&efi_lock); | ||||
▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines |