Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/libefi/eficom.c
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | while ((char *)node < ep) { | ||||
/* Start of next device path in list. */ | /* Start of next device path in list. */ | ||||
node = NextDevicePathNode(node); | node = NextDevicePathNode(node); | ||||
} | } | ||||
free(buf); | free(buf); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
/* | |||||
* Called from cons_probe() to see if this device is available. | |||||
* Return immediately on x86, except for hyperv, since it interferes with | |||||
* common configurations otherwise (yes, this is just firewalling the bug). | |||||
*/ | |||||
static void | static void | ||||
comc_probe(struct console *sc) | comc_probe(struct console *sc) | ||||
{ | { | ||||
EFI_STATUS status; | EFI_STATUS status; | ||||
EFI_HANDLE handle; | EFI_HANDLE handle; | ||||
char name[20]; | char name[20]; | ||||
char value[20]; | char value[20]; | ||||
unsigned val; | unsigned val; | ||||
char *env, *buf, *ep; | char *env, *buf, *ep; | ||||
size_t sz; | size_t sz; | ||||
#ifdef __amd64__ | |||||
/* | |||||
* This driver tickles issues on a number of different firmware loads. | |||||
* It is only required for HyperV, and is only known to work on HyperV, | |||||
* so only allow it on HyperV. | |||||
*/ | |||||
env = getenv("smbios.bios.version"); | |||||
if (env == NULL || strncmp(env, "Hyper-V", 7) != 0) { | |||||
return; | |||||
} | |||||
#endif | |||||
if (comc_port == NULL) { | if (comc_port == NULL) { | ||||
comc_port = calloc(1, sizeof (struct serial)); | comc_port = calloc(1, sizeof (struct serial)); | ||||
if (comc_port == NULL) | if (comc_port == NULL) | ||||
return; | return; | ||||
} | } | ||||
/* Use defaults from firmware */ | /* Use defaults from firmware */ | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |