From owner-svn-src-stable@FreeBSD.ORG Tue Sep 2 22:01:15 2014 Return-Path: Delivered-To: svn-src-stable@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 BE4EEDB0; Tue, 2 Sep 2014 22:01:15 +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 9EA9E1AEB; Tue, 2 Sep 2014 22:01:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82M1F3Y087487; Tue, 2 Sep 2014 22:01:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82M1F4e087482; Tue, 2 Sep 2014 22:01:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409022201.s82M1F4e087482@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Sep 2014 22:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270988 - in stable/10/sys: amd64/amd64 kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 22:01:16 -0000 Author: emaste Date: Tue Sep 2 22:01:14 2014 New Revision: 270988 URL: http://svnweb.freebsd.org/changeset/base/270988 Log: MFC automatic vt(4) selection for UEFI boot r268158: Prefer vt(4) for UEFI boot The UEFI framebuffer driver vt_efifb requires vt(4), so add a mechanism for the startup routine to set the preferred console. This change is ugly because console init happens very early in the boot, making a cleaner interface difficult. This change is intended only to facilitate the sc(4) / vt(4) transition, and can be reverted once vt(4) is the default. r268160: Fix typos in VTY constant names from r268158 r268982: Don't pass null kmdp to preload_search_info On Xen PVH guests kmdp == NULL. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/amd64/amd64/machdep.c stable/10/sys/kern/kern_cons.c stable/10/sys/sys/cons.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Tue Sep 2 21:59:24 2014 (r270987) +++ stable/10/sys/amd64/amd64/machdep.c Tue Sep 2 22:01:14 2014 (r270988) @@ -1909,6 +1909,14 @@ hammer_time(u_int64_t modulep, u_int64_t i8254_init(); /* + * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) + * transition). + */ + if (kmdp != NULL && preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL) + vty_set_preferred(VTY_VT); + + /* * Initialize the console before we print anything out. */ cninit(); Modified: stable/10/sys/kern/kern_cons.c ============================================================================== --- stable/10/sys/kern/kern_cons.c Tue Sep 2 21:59:24 2014 (r270987) +++ stable/10/sys/kern/kern_cons.c Tue Sep 2 22:01:14 2014 (r270988) @@ -652,6 +652,7 @@ sysbeep(int pitch __unused, int period _ /* * Temporary support for sc(4) to vt(4) transition. */ +static unsigned vty_prefer; static char vty_name[16]; SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN, vty_name, 0, "Console vty driver"); @@ -676,6 +677,10 @@ vty_enabled(unsigned vty) break; } #endif + if (vty_prefer != 0) { + vty_selected = vty_prefer; + break; + } #if defined(DEV_SC) vty_selected = VTY_SC; #elif defined(DEV_VT) @@ -691,3 +696,16 @@ vty_enabled(unsigned vty) return ((vty_selected & vty) != 0); } +void +vty_set_preferred(unsigned vty) +{ + + vty_prefer = vty; +#if !defined(DEV_SC) + vty_prefer &= ~VTY_SC; +#endif +#if !defined(DEV_VT) + vty_prefer &= ~VTY_VT; +#endif +} + Modified: stable/10/sys/sys/cons.h ============================================================================== --- stable/10/sys/sys/cons.h Tue Sep 2 21:59:24 2014 (r270987) +++ stable/10/sys/sys/cons.h Tue Sep 2 22:01:14 2014 (r270988) @@ -137,6 +137,7 @@ void constty_clear(void); #define VTY_SC 0x01 #define VTY_VT 0x02 int vty_enabled(unsigned int); +void vty_set_preferred(unsigned int); #endif /* _KERNEL */