From owner-svn-src-all@FreeBSD.ORG Fri Sep 12 17:32:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25D39B46; Fri, 12 Sep 2014 17:32:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D538F4B; Fri, 12 Sep 2014 17:32:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8CHWTUd060768; Fri, 12 Sep 2014 17:32:29 GMT (envelope-from ambrisko@FreeBSD.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8CHWTm5060762; Fri, 12 Sep 2014 17:32:29 GMT (envelope-from ambrisko@FreeBSD.org) Message-Id: <201409121732.s8CHWTm5060762@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ambrisko set sender to ambrisko@FreeBSD.org using -f From: Doug Ambrisko Date: Fri, 12 Sep 2014 17:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271475 - in head/sys/boot: amd64/efi efi/libefi i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2014 17:32:30 -0000 Author: ambrisko Date: Fri Sep 12 17:32:28 2014 New Revision: 271475 URL: http://svnweb.freebsd.org/changeset/base/271475 Log: Add support for serial and null console to UEFI boot loader. Modified: head/sys/boot/amd64/efi/bootinfo.c head/sys/boot/amd64/efi/conf.c head/sys/boot/efi/libefi/Makefile head/sys/boot/i386/libi386/comconsole.c Modified: head/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- head/sys/boot/amd64/efi/bootinfo.c Fri Sep 12 17:07:19 2014 (r271474) +++ head/sys/boot/amd64/efi/bootinfo.c Fri Sep 12 17:32:28 2014 (r271475) @@ -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: head/sys/boot/amd64/efi/conf.c ============================================================================== --- head/sys/boot/amd64/efi/conf.c Fri Sep 12 17:07:19 2014 (r271474) +++ head/sys/boot/amd64/efi/conf.c Fri Sep 12 17:32:28 2014 (r271475) @@ -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: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Fri Sep 12 17:07:19 2014 (r271474) +++ head/sys/boot/efi/libefi/Makefile Fri Sep 12 17:32:28 2014 (r271475) @@ -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: head/sys/boot/i386/libi386/comconsole.c ============================================================================== --- head/sys/boot/i386/libi386/comconsole.c Fri Sep 12 17:07:19 2014 (r271474) +++ head/sys/boot/i386/libi386/comconsole.c Fri Sep 12 17:32:28 2014 (r271475) @@ -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