svn commit: r271880 - in stable/10/sys/boot: amd64/efi efi/libefi i386/libi386
Ed Maste
emaste at FreeBSD.org
Fri Sep 19 21:30:46 UTC 2014
Author: emaste
Date: Fri Sep 19 21:30:45 2014
New Revision: 271880
URL: http://svnweb.freebsd.org/changeset/base/271880
Log:
MFC r271475 by ambrisko:
Add support for serial and null console to UEFI boot loader.
Approved by: re
Modified:
stable/10/sys/boot/amd64/efi/bootinfo.c
stable/10/sys/boot/amd64/efi/conf.c
stable/10/sys/boot/efi/libefi/Makefile
stable/10/sys/boot/i386/libi386/comconsole.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/boot/amd64/efi/bootinfo.c
==============================================================================
--- stable/10/sys/boot/amd64/efi/bootinfo.c Fri Sep 19 18:24:02 2014 (r271879)
+++ stable/10/sys/boot/amd64/efi/bootinfo.c Fri Sep 19 21:30:45 2014 (r271880)
@@ -60,6 +60,7 @@ bi_getboothowto(char *kargs)
{
const char *sw;
char *opts;
+ char *console;
int howto, i;
howto = 0;
@@ -70,6 +71,14 @@ bi_getboothowto(char *kargs)
howto |= howto_names[i].mask;
}
+ console = getenv("console");
+ if (console != NULL) {
+ if (strcmp(console, "comconsole") == 0)
+ howto |= RB_SERIAL;
+ if (strcmp(console, "nullconsole") == 0)
+ howto |= RB_MUTE;
+ }
+
/* Parse kargs */
if (kargs == NULL)
return (howto);
Modified: stable/10/sys/boot/amd64/efi/conf.c
==============================================================================
--- stable/10/sys/boot/amd64/efi/conf.c Fri Sep 19 18:24:02 2014 (r271879)
+++ stable/10/sys/boot/amd64/efi/conf.c Fri Sep 19 21:30:45 2014 (r271880)
@@ -62,8 +62,12 @@ struct file_format *file_formats[] = {
};
extern struct console efi_console;
+extern struct console comconsole;
+extern struct console nullconsole;
struct console *consoles[] = {
&efi_console,
+ &comconsole,
+ &nullconsole,
NULL
};
Modified: stable/10/sys/boot/efi/libefi/Makefile
==============================================================================
--- stable/10/sys/boot/efi/libefi/Makefile Fri Sep 19 18:24:02 2014 (r271879)
+++ stable/10/sys/boot/efi/libefi/Makefile Fri Sep 19 21:30:45 2014 (r271880)
@@ -5,6 +5,8 @@ INTERNALLIB=
SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \
libefi.c time.c
+.PATH: ${.CURDIR}/../../i386/libi386
+SRCS+= nullconsole.c comconsole.c
.if ${MACHINE_ARCH} == "amd64"
CFLAGS+= -fPIC
@@ -16,6 +18,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${.CURDIR}/../../common
+CFLAGS+= -DNO_PCI
+
# Suppress warning from clang for FreeBSD %b and %D formats
CFLAGS+= -fformat-extensions
Modified: stable/10/sys/boot/i386/libi386/comconsole.c
==============================================================================
--- stable/10/sys/boot/i386/libi386/comconsole.c Fri Sep 19 18:24:02 2014 (r271879)
+++ stable/10/sys/boot/i386/libi386/comconsole.c Fri Sep 19 21:30:45 2014 (r271880)
@@ -214,6 +214,9 @@ comc_port_set(struct env_var *ev, int fl
static uint32_t
comc_parse_pcidev(const char *string)
{
+#ifdef NO_PCI
+ return (0);
+#else
char *p, *p1;
uint8_t bus, dev, func, bar;
uint32_t locator;
@@ -247,11 +250,15 @@ comc_parse_pcidev(const char *string)
locator = (bar << 16) | biospci_locator(bus, dev, func);
return (locator);
+#endif
}
static int
comc_pcidev_handle(uint32_t locator)
{
+#ifdef NO_PCI
+ return (CMD_ERROR);
+#else
char intbuf[64];
uint32_t port;
@@ -275,6 +282,7 @@ comc_pcidev_handle(uint32_t locator)
comc_locator = locator;
return (CMD_OK);
+#endif
}
static int
More information about the svn-src-all
mailing list