Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/efidev/efirt.c
Show First 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | efi_leave(void) | ||||
PMAP_UNLOCK(curpmap); | PMAP_UNLOCK(curpmap); | ||||
} | } | ||||
int | int | ||||
efi_get_table(struct uuid *uuid, void **ptr) | efi_get_table(struct uuid *uuid, void **ptr) | ||||
{ | { | ||||
struct efi_cfgtbl *ct; | struct efi_cfgtbl *ct; | ||||
u_long count; | u_long count; | ||||
int error; | |||||
if (efi_cfgtbl == NULL || efi_systbl == NULL) | if (efi_cfgtbl == NULL || efi_systbl == NULL) | ||||
return (ENXIO); | return (ENXIO); | ||||
error = efi_enter(); | |||||
if (error != 0) | |||||
return (error); | |||||
count = efi_systbl->st_entries; | count = efi_systbl->st_entries; | ||||
ct = efi_cfgtbl; | ct = efi_cfgtbl; | ||||
while (count--) { | while (count--) { | ||||
if (!bcmp(&ct->ct_uuid, uuid, sizeof(*uuid))) { | if (!bcmp(&ct->ct_uuid, uuid, sizeof(*uuid))) { | ||||
*ptr = (void *)efi_phys_to_kva(ct->ct_data); | *ptr = ct->ct_data; | ||||
efi_leave(); | |||||
return (0); | return (0); | ||||
} | } | ||||
ct++; | ct++; | ||||
} | } | ||||
efi_leave(); | |||||
return (ENOENT); | return (ENOENT); | ||||
} | } | ||||
static int efi_rt_handle_faults = EFI_RT_HANDLE_FAULTS_DEFAULT; | static int efi_rt_handle_faults = EFI_RT_HANDLE_FAULTS_DEFAULT; | ||||
SYSCTL_INT(_machdep, OID_AUTO, efi_rt_handle_faults, CTLFLAG_RWTUN, | SYSCTL_INT(_machdep, OID_AUTO, efi_rt_handle_faults, CTLFLAG_RWTUN, | ||||
&efi_rt_handle_faults, 0, | &efi_rt_handle_faults, 0, | ||||
"Call EFI RT methods with fault handler wrapper around"); | "Call EFI RT methods with fault handler wrapper around"); | ||||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |