From owner-svn-src-releng@FreeBSD.ORG Mon Aug 12 01:21:18 2013 Return-Path: Delivered-To: svn-src-releng@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 ESMTP id 7BD7712B; Mon, 12 Aug 2013 01:21:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51FF320C0; Mon, 12 Aug 2013 01:21:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7C1LI0X028108; Mon, 12 Aug 2013 01:21:18 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7C1LEDM028064; Mon, 12 Aug 2013 01:21:14 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201308120121.r7C1LEDM028064@svn.freebsd.org> From: Devin Teske Date: Mon, 12 Aug 2013 01:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254235 - in releng/9.2/sys/boot: common forth i386/loader ia64/common pc98/loader powerpc/ofw powerpc/ps3 sparc64/loader X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Aug 2013 01:21:18 -0000 Author: dteske Date: Mon Aug 12 01:21:14 2013 New Revision: 254235 URL: http://svnweb.freebsd.org/changeset/base/254235 Log: Synchronize releng/9.2 Forth code with stable/9 via MFS of 2 revisions: First, MFS of SVN r254109: itself an MFC of 22 revisions: 227727, 233941, 235560, 238431, 241310, 241361, 241363, 241365, 241367, 241523, 242667-242669, 242923, 243114, 243660, 244048, 244089, 244158, 253715, 254105, and 254108. This includes critical fixes that sadly should have been merged prior. Namely, SVN r244158 fixes a possible regression. Second, MFS of SVN r254146: Itself an MFC of r242688. Approved by: re (marius) Added: releng/9.2/sys/boot/forth/menusets.4th - copied unchanged from r254109, stable/9/sys/boot/forth/menusets.4th releng/9.2/sys/boot/forth/menusets.4th.8 - copied unchanged from r254109, stable/9/sys/boot/forth/menusets.4th.8 Modified: releng/9.2/sys/boot/common/Makefile.inc releng/9.2/sys/boot/forth/beastie.4th releng/9.2/sys/boot/forth/beastie.4th.8 releng/9.2/sys/boot/forth/brand.4th releng/9.2/sys/boot/forth/brand.4th.8 releng/9.2/sys/boot/forth/check-password.4th releng/9.2/sys/boot/forth/check-password.4th.8 releng/9.2/sys/boot/forth/color.4th releng/9.2/sys/boot/forth/color.4th.8 releng/9.2/sys/boot/forth/delay.4th releng/9.2/sys/boot/forth/delay.4th.8 releng/9.2/sys/boot/forth/frames.4th releng/9.2/sys/boot/forth/loader.4th releng/9.2/sys/boot/forth/loader.4th.8 releng/9.2/sys/boot/forth/loader.conf releng/9.2/sys/boot/forth/loader.conf.5 releng/9.2/sys/boot/forth/loader.rc releng/9.2/sys/boot/forth/menu-commands.4th releng/9.2/sys/boot/forth/menu.4th releng/9.2/sys/boot/forth/menu.4th.8 releng/9.2/sys/boot/forth/menu.rc releng/9.2/sys/boot/forth/shortcuts.4th releng/9.2/sys/boot/forth/support.4th releng/9.2/sys/boot/forth/version.4th releng/9.2/sys/boot/forth/version.4th.8 releng/9.2/sys/boot/i386/loader/Makefile releng/9.2/sys/boot/ia64/common/Makefile releng/9.2/sys/boot/pc98/loader/Makefile releng/9.2/sys/boot/powerpc/ofw/Makefile releng/9.2/sys/boot/powerpc/ps3/Makefile releng/9.2/sys/boot/sparc64/loader/Makefile Directory Properties: releng/9.2/sys/ (props changed) releng/9.2/sys/boot/ (props changed) releng/9.2/sys/boot/forth/ (props changed) releng/9.2/sys/boot/powerpc/ofw/ (props changed) Modified: releng/9.2/sys/boot/common/Makefile.inc ============================================================================== --- releng/9.2/sys/boot/common/Makefile.inc Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/common/Makefile.inc Mon Aug 12 01:21:14 2013 (r254235) @@ -64,6 +64,7 @@ MAN+= ../forth/delay.4th.8 MAN+= ../forth/loader.conf.5 MAN+= ../forth/loader.4th.8 MAN+= ../forth/menu.4th.8 +MAN+= ../forth/menusets.4th.8 MAN+= ../forth/version.4th.8 .endif Modified: releng/9.2/sys/boot/forth/beastie.4th ============================================================================== --- releng/9.2/sys/boot/forth/beastie.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/beastie.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -1,6 +1,6 @@ \ Copyright (c) 2003 Scott Long \ Copyright (c) 2003 Aleksander Fafula -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2013 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -28,7 +28,6 @@ marker task-beastie.4th -include /boot/color.4th include /boot/delay.4th variable logoX @@ -182,8 +181,8 @@ variable logoY \ beastie Color ``Helper Daemon'' mascot (19 rows x 34 columns) \ beastiebw B/W ``Helper Daemon'' mascot (19 rows x 34 columns) \ fbsdbw "FreeBSD" logo in B/W (13 rows x 21 columns) -\ orb Color ``Orb'' mascot (15 rows x 30 columns) -\ orbbw B/W ``Orb'' mascot (15 rows x 32 columns) (default) +\ orb Color ``Orb'' mascot (15 rows x 30 columns) (default) +\ orbbw B/W ``Orb'' mascot (15 rows x 32 columns) \ \ NOTE: Setting `loader_logo' to an undefined value (such as "none") will \ prevent beastie from being drawn. Modified: releng/9.2/sys/boot/forth/beastie.4th.8 ============================================================================== --- releng/9.2/sys/boot/forth/beastie.4th.8 Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/beastie.4th.8 Mon Aug 12 01:21:14 2013 (r254235) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2012 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -94,8 +94,9 @@ The variable can be configured in .Xr loader.conf 5 to the number of seconds you would like to delay loading the boot menu. -During the delay the user can press Ctrl-C to fall back to autoboot or ENTER -to proceed. +During the delay the user can press Ctrl-C to fall back to +.Ic autoboot +or ENTER to proceed. The default behavior is to not delay. .El .Pp @@ -168,4 +169,4 @@ set of commands was written by .An Scott Long Aq scottl@FreeBSD.org , .An Aleksander Fafula Aq alex@fafula.com and -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: releng/9.2/sys/boot/forth/brand.4th ============================================================================== --- releng/9.2/sys/boot/forth/brand.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/brand.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: releng/9.2/sys/boot/forth/brand.4th.8 ============================================================================== --- releng/9.2/sys/boot/forth/brand.4th.8 Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/brand.4th.8 Mon Aug 12 01:21:14 2013 (r254235) @@ -122,4 +122,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: releng/9.2/sys/boot/forth/check-password.4th ============================================================================== --- releng/9.2/sys/boot/forth/check-password.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/check-password.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2012 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -74,7 +74,7 @@ variable readlen \ input length again ; -: read ( -- String prompt ) +: read ( String prompt -- ) 0 25 at-xy \ Move the cursor to the bottom-left dup 1+ read-start ! \ Store X offset after the prompt @@ -134,23 +134,37 @@ variable readlen \ input length : check-password ( -- ) - \ Exit if a password was not set - s" password" getenv dup -1 = if - drop exit + \ Do not allow the user to proceed beyond this point if a boot-lock + \ password has been set (preventing even boot from proceeding) + s" bootlock_password" getenv dup -1 <> if + begin + s" Boot Password: " read ( prompt -- ) + 2dup readval readlen @ compare 0<> + while + 3000 ms ." loader: incorrect password" 10 emit + repeat + 2drop ( c-addr/u ) + else + drop ( -1 ) \ getenv cruft then - begin \ Loop as long as it takes to get the right password + \ Exit if a password was not set + s" password" getenv -1 = if exit else drop then + + \ We should prevent the user from visiting the menu or dropping to the + \ interactive loader(8) prompt, but still allow the machine to boot... - s" Password: " \ Output a prompt for a password - read \ Read the user's input until Enter + 0 autoboot + \ Only reached if autoboot fails for any reason (including if/when + \ the user aborts/escapes the countdown sequence leading to boot). + + s" password" getenv + begin + s" Password: " read ( prompt -- ) 2dup readval readlen @ compare 0= if 2drop exit \ Correct password then - - \ Bad Password - 3000 ms - ." loader: incorrect password" 10 emit - - again \ Not the right password; repeat + 3000 ms ." loader: incorrect password" 10 emit + again ; Modified: releng/9.2/sys/boot/forth/check-password.4th.8 ============================================================================== --- releng/9.2/sys/boot/forth/check-password.4th.8 Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/check-password.4th.8 Mon Aug 12 01:21:14 2013 (r254235) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2012 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2011 +.Dd December 10, 2012 .Dt CHECK-PASSWORD.4TH 8 .Os .Sh NAME @@ -33,7 +33,8 @@ .Sh DESCRIPTION The file that goes by the name of .Nm -is a set of commands designed to prevent booting without the proper password. +is a set of commands designed to either prevent booting or prevent modification +of boot options without an appropriately configured password. The commands of .Nm by themselves are not enough for most uses. @@ -57,30 +58,36 @@ The commands provided by it are: .Pp .Bl -tag -width disable-module_module -compact -offset indent .It Ic check-password -Once called, the user cannot continue until the correct password is entered. -If the user enters the correct password the function returns. +Dual-purpose function that can either protect the interactive boot menu or +prevent boot without password (separately). .Pp -The password that is required is configured by setting the -.Ic password -variable in -.Xr loader.conf 5 . -.Pp -Subsequent calls after a successful password -has been entered will not cause reprompting -\(em the function will silently return. +First checks +.Va bootlock_password +and if-set, the user cannot continue until the correct password is entered. +.Pp +Next checks +.Va password +and if-set, tries to +.Ic autoboot +and only prompts for password on failure or user-interrupt. +See +.Xr loader.conf 5 +for additional information. .El .Pp The environment variables that effect its behavior are: -.Bl -tag -width bootfile -offset indent +.Bl -tag -width bootlock_password -offset indent +.It Va bootlock_password +Sets the bootlock password (up to 16 characters long) that is required by +.Ic check-password +to be entered before the system is allowed to boot. .It Va password Sets the password (up to 16 characters long) that is required by .Ic check-password -to be entered before the system is allowed to boot. If unset (default) or NULL, -.Ic check-password -will silently abort. +before the user is allowed to visit the boot menu. .El .Sh FILES -.Bl -tag -width /boot/loader.4th -compact +.Bl -tag -width /boot/check-password.4th -compact .It Pa /boot/loader The .Xr loader 8 . @@ -101,11 +108,20 @@ check-password .Ed .Pp Set a password in -.Xr loader.conf 5 : +.Xr loader.conf 5 +to prevent modification of boot options: .Pp .Bd -literal -offset indent -compact password="abc123" .Ed +.Pp +Set a password in +.Xr loader.conf 5 +to prevent booting without password: +.Pp +.Bd -literal -offset indent -compact +bootlock_password="boot" +.Ed .Sh SEE ALSO .Xr loader.conf 5 , .Xr loader 8 , @@ -120,4 +136,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: releng/9.2/sys/boot/forth/color.4th ============================================================================== --- releng/9.2/sys/boot/forth/color.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/color.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -1,4 +1,4 @@ -\ Copyright (c) 2011 Devin Teske +\ Copyright (c) 2011-2013 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -26,23 +26,24 @@ marker task-color.4th -\ This function returns TRUE if the `loader_color' environment variable is set -\ to YES, yes, or 1. Otherwise, FALSE is returned. +\ This function returns FALSE if the `loader_color' environment variable is set +\ to NO, no, or 0. Otherwise, TRUE is returned (unless booting serial). \ : loader_color? ( -- N ) s" loader_color" getenv dup -1 <> if - 2dup s" YES" compare-insensitive 0= if + 2dup s" NO" compare-insensitive 0= if 2drop - TRUE exit + FALSE exit then - 2dup s" 1" compare 0= if + 2dup s" 0" compare 0= if 2drop - TRUE exit + FALSE exit then drop then + drop - drop FALSE exit + boot_serial? if FALSE else TRUE then ; Modified: releng/9.2/sys/boot/forth/color.4th.8 ============================================================================== --- releng/9.2/sys/boot/forth/color.4th.8 Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/color.4th.8 Mon Aug 12 01:21:14 2013 (r254235) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2013 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2011 +.Dd August 6, 2013 .Dt COLOR.4TH 8 .Os .Sh NAME @@ -50,33 +50,33 @@ through the command: .Dl include color.4th .Pp This line is present in -.Pa /boot/beastie.4th +.Pa /boot/loader.4th file, so it is not needed (and should not be re-issued) in a normal setup. .Pp The commands provided by it are: .Pp .Bl -tag -width disable-module_module -compact -offset indent .It Ic loader_color? -Returns TRUE if the +Returns FALSE if the .Ic loader_color environment variable is set to -.Dq YES +.Dq NO (case-insensitive) or -.Dq 1 . -Otherwise returns FALSE. +.Dq 0 . +Otherwise returns TRUE +.Pq unless booting serial . .El .Pp The environment variables that effect its behavior are: .Bl -tag -width bootfile -offset indent .It Va loader_color If set to -.Dq YES +.Dq NO (case-insensitive) or -.Dq 1 , +.Dq 0 , causes .Ic loader_color? -to return TRUE, indicating to many other modules that color should be used -whenever/wherever possible. +to return FALSE, indicating to many modules that color should not be used. .El .Sh FILES .Bl -tag -width /boot/loader.4th -compact @@ -102,7 +102,6 @@ loader_color="YES" .Sh SEE ALSO .Xr loader.conf 5 , .Xr loader 8 , -.Xr beastie.4th 8 , .Xr loader.4th 8 .Sh HISTORY The @@ -114,4 +113,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: releng/9.2/sys/boot/forth/delay.4th ============================================================================== --- releng/9.2/sys/boot/forth/delay.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/delay.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -1,4 +1,4 @@ -\ Copyright (c) 2008-2011 Devin Teske +\ Copyright (c) 2008-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: releng/9.2/sys/boot/forth/delay.4th.8 ============================================================================== --- releng/9.2/sys/boot/forth/delay.4th.8 Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/delay.4th.8 Mon Aug 12 01:21:14 2013 (r254235) @@ -123,4 +123,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: releng/9.2/sys/boot/forth/frames.4th ============================================================================== --- releng/9.2/sys/boot/forth/frames.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/frames.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -12,6 +12,11 @@ variable rt_el variable rb_el variable fill +\ ASCII frames (used when serial console is detected) + 45 constant ascii_dash +124 constant ascii_pipe + 43 constant ascii_plus + s" arch-pc98" environment? [if] \ Single frames 149 constant sh_el @@ -63,7 +68,17 @@ s" arch-pc98" environment? [if] loop ; +: f_ascii ( -- ) ( -- ) \ set frames to ascii + ascii_dash h_el ! + ascii_pipe v_el ! + ascii_plus lt_el ! + ascii_plus lb_el ! + ascii_plus rt_el ! + ascii_plus rb_el ! +; + : f_single ( -- ) \ set frames to single + boot_serial? if f_ascii exit then sh_el h_el ! sv_el v_el ! slt_el lt_el ! @@ -73,6 +88,7 @@ s" arch-pc98" environment? [if] ; : f_double ( -- ) \ set frames to double + boot_serial? if f_ascii exit then dh_el h_el ! dv_el v_el ! dlt_el lt_el ! Modified: releng/9.2/sys/boot/forth/loader.4th ============================================================================== --- releng/9.2/sys/boot/forth/loader.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/loader.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -40,6 +40,7 @@ s" arch-i386" environment? [if] [if] 2048 dictincrease ! \ 2048 additional cells each time include /boot/support.4th +include /boot/color.4th only forth also support-functions also builtins definitions @@ -59,11 +60,23 @@ only forth also support-functions also b else drop then + s" menusets-unset" + sfind if + execute + else + drop + then ; : boot 0= if ( interpreted ) get_arguments then + loader_color? if + ." Booting..." cr + else + ." Booting..." cr + then + \ Unload only if a path was passed dup if >r over r> swap Modified: releng/9.2/sys/boot/forth/loader.4th.8 ============================================================================== --- releng/9.2/sys/boot/forth/loader.4th.8 Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/loader.4th.8 Mon Aug 12 01:21:14 2013 (r254235) @@ -99,7 +99,7 @@ This is the command used in the default .Pa /boot/loader.rc file, and it uses the -.Pa autoboot +.Ic autoboot command (see .Xr loader 8 ) , so it can be stopped for further interaction with Modified: releng/9.2/sys/boot/forth/loader.conf ============================================================================== --- releng/9.2/sys/boot/forth/loader.conf Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/loader.conf Mon Aug 12 01:21:14 2013 (r254235) @@ -48,7 +48,7 @@ bitmap_type="splash_image_data" # and pl # escape to the loader prompt, set to # "NO" to disable autobooting #beastie_disable="NO" # Turn the beastie boot menu on and off -#loader_logo="fbsdbw" # Desired logo: fbsdbw, beastiebw, beastie, none +#loader_logo="orbbw" # Desired logo: orbbw, orb, fbsdbw, beastiebw, beastie, none #comconsole_speed="9600" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device Modified: releng/9.2/sys/boot/forth/loader.conf.5 ============================================================================== --- releng/9.2/sys/boot/forth/loader.conf.5 Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/loader.conf.5 Mon Aug 12 01:21:14 2013 (r254235) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd July 20, 2011 +.Dd August 6, 2013 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -113,8 +113,23 @@ that contains a kernel. .It Ar kernel_options Flags to be passed to the kernel. .It Ar password +Protect boot menu with a password without interrupting +.Ic autoboot +process. +The password should be in clear text format. +If a password is set, boot menu will not appear until any key is pressed during +countdown period specified by +.Va autoboot_delay +variable or +.Ic autoboot +process fails. +In both cases user should provide specified password to be able to access boot +menu. +.It Ar bootlock_password Provides a password to be required by check-password before execution is allowed to continue. +The password should be in clear text format. +If a password is set, the user must provide specified password to boot. .It Ar verbose_loading If set to .Dq YES , @@ -230,8 +245,8 @@ and .Dq Li none . .It Va loader_color If set to -.Dq YES , -the beastie boot menu will be displayed using ANSI coloring where possible. +.Dq NO , +the beastie boot menu will be displayed without ANSI coloring. .El .Sh FILES .Bl -tag -width /boot/defaults/loader.conf -compact Modified: releng/9.2/sys/boot/forth/loader.rc ============================================================================== --- releng/9.2/sys/boot/forth/loader.rc Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/loader.rc Mon Aug 12 01:21:14 2013 (r254235) @@ -10,5 +10,9 @@ start \ Tests for password -- executes autoboot first if a password was defined check-password +\ Uncomment to enable boot menu +\ include /boot/beastie.4th +\ beastie-start + \ Unless set otherwise, autoboot is automatic at this point Modified: releng/9.2/sys/boot/forth/menu-commands.4th ============================================================================== --- releng/9.2/sys/boot/forth/menu-commands.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/menu-commands.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2012 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -26,6 +26,60 @@ marker task-menu-commands.4th +include /boot/menusets.4th + +variable kernel_state +variable root_state + +\ +\ Boot +\ + +: init_boot ( N -- N ) + dup + s" boot_single" getenv -1 <> if + drop ( n n c-addr -- n n ) \ unused + toggle_menuitem ( n n -- n n ) + s" set menu_keycode[N]=115" \ base command to execute + else + s" set menu_keycode[N]=98" \ base command to execute + then + 17 +c! \ replace 'N' with ASCII numeral + evaluate +; + +\ +\ Alternate Boot +\ + +: init_altboot ( N -- N ) + dup + s" boot_single" getenv -1 <> if + drop ( n c-addr -- n ) \ unused + toggle_menuitem ( n -- n ) + s" set menu_keycode[N]=109" \ base command to execute + else + s" set menu_keycode[N]=115" \ base command to execute + then + 17 +c! \ replace 'N' with ASCII numeral + evaluate +; + +: altboot ( -- ) + s" boot_single" 2dup getenv -1 <> if + drop ( c-addr/u c-addr -- c-addr/u ) \ unused + unsetenv ( c-addr/u -- ) + else + 2drop ( c-addr/u -- ) \ unused + s" set boot_single=YES" evaluate + then + 0 boot ( state -- ) +; + +\ +\ ACPI +\ + : acpi_enable ( -- ) s" set acpi_load=YES" evaluate \ XXX deprecated but harmless s" set hint.acpi.0.disabled=0" evaluate @@ -53,39 +107,51 @@ marker task-menu-commands.4th TRUE \ loop menu again ; +\ +\ Safe Mode +\ + +: safemode_enabled? ( -- flag ) + s" kern.smp.disabled" getenv -1 <> dup if + swap drop ( c-addr flag -- flag ) + then +; + +: safemode_enable ( -- ) + s" set kern.smp.disabled=1" evaluate + s" set hw.ata.ata_dma=0" evaluate + s" set hw.ata.atapi_dma=0" evaluate + s" set hw.ata.wc=0" evaluate + s" set hw.eisa_slots=0" evaluate + s" set kern.eventtimer.periodic=1" evaluate + s" set kern.geom.part.check_integrity=0" evaluate +; + +: safemode_disable ( -- ) + s" kern.smp.disabled" unsetenv + s" hw.ata.ata_dma" unsetenv + s" hw.ata.atapi_dma" unsetenv + s" hw.ata.wc" unsetenv + s" hw.eisa_slots" unsetenv + s" kern.eventtimer.periodic" unsetenv + s" kern.geom.part.check_integrity" unsetenv +; + +: init_safemode ( N -- N ) + safemode_enabled? if + toggle_menuitem ( n -- n ) + then +; + : toggle_safemode ( N -- N TRUE ) toggle_menuitem \ Now we're going to make the change effective - s" toggle_stateN @" \ base name of toggle state var - -rot 2dup 12 + c! rot \ replace 'N' with ASCII numeral - - evaluate 0= if - s" hint.apic.0.disabled" unsetenv - s" hw.ata.ata_dma" unsetenv - s" hw.ata.atapi_dma" unsetenv - s" hw.ata.wc" unsetenv - s" hw.eisa_slots" unsetenv - s" hint.kbdmux.0.disabled" unsetenv - else - \ - \ Toggle ACPI elements if necessary - \ - acpipresent? if acpienabled? if - menuacpi @ dup 0<> if - toggle_menuitem ( N -- N ) - then - drop - acpi_disable - then then - - s" set hint.apic.0.disabled=1" evaluate - s" set hw.ata.ata_dma=0" evaluate - s" set hw.ata.atapi_dma=0" evaluate - s" set hw.ata.wc=0" evaluate - s" set hw.eisa_slots=0" evaluate - s" set hint.kbdmux.0.disabled=1" evaluate + dup toggle_stateN @ 0= if + safemode_disable + else + safemode_enable then menu-redraw @@ -93,42 +159,88 @@ marker task-menu-commands.4th TRUE \ loop menu again ; +\ +\ Single User Mode +\ + +: singleuser_enabled? ( -- flag ) + s" boot_single" getenv -1 <> dup if + swap drop ( c-addr flag -- flag ) + then +; + +: singleuser_enable ( -- ) + s" set boot_single=YES" evaluate +; + +: singleuser_disable ( -- ) + s" boot_single" unsetenv +; + +: init_singleuser ( N -- N ) + singleuser_enabled? if + toggle_menuitem ( n -- n ) + then +; + : toggle_singleuser ( N -- N TRUE ) toggle_menuitem menu-redraw \ Now we're going to make the change effective - s" toggle_stateN @" \ base name of toggle state var - -rot 2dup 12 + c! rot \ replace 'N' with ASCII numeral - - evaluate 0= if - s" boot_single" unsetenv + dup toggle_stateN @ 0= if + singleuser_disable else - s" set boot_single=YES" evaluate + singleuser_enable then TRUE \ loop menu again ; +\ +\ Verbose Boot +\ + +: verbose_enabled? ( -- flag ) + s" boot_verbose" getenv -1 <> dup if + swap drop ( c-addr flag -- flag ) + then +; + +: verbose_enable ( -- ) + s" set boot_verbose=YES" evaluate +; + +: verbose_disable ( -- ) + s" boot_verbose" unsetenv +; + +: init_verbose ( N -- N ) + verbose_enabled? if + toggle_menuitem ( n -- n ) + then +; + : toggle_verbose ( N -- N TRUE ) toggle_menuitem menu-redraw \ Now we're going to make the change effective - s" toggle_stateN @" \ base name of toggle state var - -rot 2dup 12 + c! rot \ replace 'N' with ASCII numeral - - evaluate 0= if - s" boot_verbose" unsetenv + dup toggle_stateN @ 0= if + verbose_disable else - s" set boot_verbose=YES" evaluate + verbose_enable then TRUE \ loop menu again ; +\ +\ Escape to Prompt +\ + : goto_prompt ( N -- N FALSE ) s" set autoboot_delay=NO" evaluate @@ -141,50 +253,94 @@ marker task-menu-commands.4th FALSE \ exit the menu ; +\ +\ Cyclestate (used by kernel/root below) +\ + +: init_cyclestate ( N K -- N ) + over cycle_stateN ( n k -- n k addr ) + begin + tuck @ ( n k addr -- n addr k c ) + over <> ( n addr k c -- n addr k 0|-1 ) + while + rot ( n addr k -- addr k n ) + cycle_menuitem + swap rot ( addr k n -- n k addr ) + repeat + 2drop ( n k addr -- n ) +; + +\ +\ Kernel +\ + +: init_kernel ( N -- N ) + kernel_state @ ( n -- n k ) + init_cyclestate ( n k -- n ) +; + : cycle_kernel ( N -- N TRUE ) cycle_menuitem menu-redraw \ Now we're going to make the change effective - s" cycle_stateN" \ base name of array state var - -rot 2dup 11 + c! rot \ replace 'N' with ASCII numeral - evaluate \ translate name into address - @ \ dereference address into value + dup cycle_stateN @ + dup kernel_state ! \ save a copy for re-initialization 48 + \ convert to ASCII numeral - \ Since we are [in this file] going to override the standard `boot' - \ routine with a custom one, you should know that we use $kernel - \ when referencing the desired kernel. Set $kernel below. - s" set kernel=${kernel_prefix}${kernel[N]}${kernel_suffix}" - \ command to assemble full kernel-path - -rot tuck 36 + c! swap \ replace 'N' with array index value - evaluate \ sets $kernel to full kernel-path + 36 +c! \ replace 'N' with ASCII numeral + evaluate \ sets $kernel to full kernel-path TRUE \ loop menu again ; +\ +\ Root +\ + +: init_root ( N -- N ) + root_state @ ( n -- n k ) + init_cyclestate ( n k -- n ) +; + : cycle_root ( N -- N TRUE ) cycle_menuitem menu-redraw \ Now we're going to make the change effective - s" cycle_stateN" \ base name of array state var - -rot 2dup 11 + c! rot \ replace 'N' with ASCII numeral - evaluate \ translate name into address - @ \ dereference address into value + dup cycle_stateN @ + dup root_state ! \ save a copy for re-initialization 48 + \ convert to ASCII numeral - \ Since we are [in this file] going to override the standard `boot' - \ routine with a custom one, you should know that we use $root when - \ booting. Set $root below. - - s" set root=${root_prefix}${root[N]}${root_prefix}" - \ command to assemble full kernel-path - -rot tuck 30 + c! swap \ replace 'N' with array index value - evaluate \ sets $kernel to full kernel-path + s" set root=${root_prefix}${root[N]}${root_suffix}" + 30 +c! \ replace 'N' with ASCII numeral + evaluate \ sets $root to full root-path TRUE \ loop menu again ; + +\ +\ Menusets +\ + +: goto_menu ( N M -- N TRUE ) + menu-unset + menuset-loadsetnum ( n m -- n ) + menu-redraw + TRUE \ Loop menu again +; + +\ +\ Defaults +\ + +: set_default_boot_options ( N -- N TRUE ) + acpi_enable + safemode_disable + singleuser_disable + verbose_disable + 2 goto_menu +; Modified: releng/9.2/sys/boot/forth/menu.4th ============================================================================== --- releng/9.2/sys/boot/forth/menu.4th Mon Aug 12 00:38:47 2013 (r254234) +++ releng/9.2/sys/boot/forth/menu.4th Mon Aug 12 01:21:14 2013 (r254235) @@ -1,6 +1,6 @@ \ Copyright (c) 2003 Scott Long \ Copyright (c) 2003 Aleksander Fafula -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2013 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -35,6 +35,8 @@ f_double \ Set frames to double ( \ f_single if you want single frames. 46 constant dot \ ASCII definition of a period (in decimal) + 5 constant menu_default_x \ default column position of timeout +10 constant menu_default_y \ default row position of timeout msg 4 constant menu_timeout_default_x \ default column position of timeout 23 constant menu_timeout_default_y \ default row position of timeout msg 10 constant menu_timeout_default \ default timeout (in seconds) @@ -76,6 +78,16 @@ variable menu_timeout \ determin variable menu_timeout_x \ column position of timeout message variable menu_timeout_y \ row position of timeout message +\ Menu initialization status variables +variable init_state1 +variable init_state2 +variable init_state3 +variable init_state4 +variable init_state5 +variable init_state6 +variable init_state7 +variable init_state8 + \ Boolean option status variables variable toggle_state1 variable toggle_state2 @@ -106,6 +118,52 @@ create init_text6 255 allot create init_text7 255 allot create init_text8 255 allot +: +c! ( N C-ADDR/U K -- C-ADDR/U ) + 3 pick 3 pick ( n c-addr/u k -- n c-addr/u k n c-addr ) + rot + c! ( n c-addr/u k n c-addr -- n c-addr/u ) + rot drop ( n c-addr/u -- c-addr/u ) +; + +: menukeyN ( N -- ADDR ) s" menukeyN" 7 +c! evaluate ; +: init_stateN ( N -- ADDR ) s" init_stateN" 10 +c! evaluate ; +: toggle_stateN ( N -- ADDR ) s" toggle_stateN" 12 +c! evaluate ; +: cycle_stateN ( N -- ADDR ) s" cycle_stateN" 11 +c! evaluate ; +: init_textN ( N -- C-ADDR ) s" init_textN" 9 +c! evaluate ; + +: str_loader_menu_frame ( -- C-ADDR/U ) s" loader_menu_frame" ; +: str_loader_menu_title ( -- C-ADDR/U ) s" loader_menu_title" ; +: str_loader_menu_title_align ( -- C-ADDR/U ) s" loader_menu_title_align" ; +: str_loader_menu_x ( -- C-ADDR/U ) s" loader_menu_x" ; +: str_loader_menu_y ( -- C-ADDR/U ) s" loader_menu_y" ; +: str_loader_menu_timeout_x ( -- C-ADDR/U ) s" loader_menu_timeout_x" ; +: str_loader_menu_timeout_y ( -- C-ADDR/U ) s" loader_menu_timeout_y" ; +: str_menu_init ( -- C-ADDR/U ) s" menu_init" ; +: str_menu_timeout_command ( -- C-ADDR/U ) s" menu_timeout_command" ; +: str_menu_reboot ( -- C-ADDR/U ) s" menu_reboot" ; +: str_menu_acpi ( -- C-ADDR/U ) s" menu_acpi" ; +: str_menu_options ( -- C-ADDR/U ) s" menu_options" ; +: str_menu_optionstext ( -- C-ADDR/U ) s" menu_optionstext" ; + +: str_menu_init[x] ( -- C-ADDR/U ) s" menu_init[x]" ; +: str_menu_command[x] ( -- C-ADDR/U ) s" menu_command[x]" ; +: str_menu_caption[x] ( -- C-ADDR/U ) s" menu_caption[x]" ; +: str_ansi_caption[x] ( -- C-ADDR/U ) s" ansi_caption[x]" ; +: str_menu_keycode[x] ( -- C-ADDR/U ) s" menu_keycode[x]" ; +: str_toggled_text[x] ( -- C-ADDR/U ) s" toggled_text[x]" ; +: str_toggled_ansi[x] ( -- C-ADDR/U ) s" toggled_ansi[x]" ; +: str_menu_caption[x][y] ( -- C-ADDR/U ) s" menu_caption[x][y]" ; +: str_ansi_caption[x][y] ( -- C-ADDR/U ) s" ansi_caption[x][y]" ; + +: menu_init[x] ( N -- C-ADDR/U ) str_menu_init[x] 10 +c! ; +: menu_command[x] ( N -- C-ADDR/U ) str_menu_command[x] 13 +c! ; +: menu_caption[x] ( N -- C-ADDR/U ) str_menu_caption[x] 13 +c! ; +: ansi_caption[x] ( N -- C-ADDR/U ) str_ansi_caption[x] 13 +c! ; +: menu_keycode[x] ( N -- C-ADDR/U ) str_menu_keycode[x] 13 +c! ; +: toggled_text[x] ( N -- C-ADDR/U ) str_toggled_text[x] 13 +c! ; +: toggled_ansi[x] ( N -- C-ADDR/U ) str_toggled_ansi[x] 13 +c! ; +: menu_caption[x][y] ( N M -- C-ADDR/U ) str_menu_caption[x][y] 16 +c! 13 +c! ; +: ansi_caption[x][y] ( N M -- C-ADDR/U ) str_ansi_caption[x][y] 16 +c! 13 +c! ; + : arch-i386? ( -- BOOL ) \ Returns TRUE (-1) on i386, FALSE (0) otherwise. s" arch-i386" environment? dup if drop @@ -162,30 +220,24 @@ create init_text8 255 allot \ ASCII numeral equal to user-selected menu item must be on the stack. \ We do not modify the stack, so the ASCII numeral is left on top. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-releng@FreeBSD.ORG Wed Aug 14 06:06:40 2013 Return-Path: Delivered-To: svn-src-releng@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 ESMTP id 1AFB25AE; Wed, 14 Aug 2013 06:06:40 +0000 (UTC) (envelope-from erwin@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 05CA920E4; Wed, 14 Aug 2013 06:06:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7E66d8v020114; Wed, 14 Aug 2013 06:06:39 GMT (envelope-from erwin@svn.freebsd.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7E66dh7020113; Wed, 14 Aug 2013 06:06:39 GMT (envelope-from erwin@svn.freebsd.org) Message-Id: <201308140606.r7E66dh7020113@svn.freebsd.org> From: Erwin Lansing Date: Wed, 14 Aug 2013 06:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254316 - releng/9.2/etc/namedb X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2013 06:06:40 -0000 Author: erwin Date: Wed Aug 14 06:06:39 2013 New Revision: 254316 URL: http://svnweb.freebsd.org/changeset/base/254316 Log: MFC 254132, 254270: Add empty zones for Shared Address Space (RFC 6598) Approved by: re (glebius), delphij (mentor) Sponsored by: DK Hostmaster A/S Modified: releng/9.2/etc/namedb/named.conf Directory Properties: releng/9.2/etc/ (props changed) Modified: releng/9.2/etc/namedb/named.conf ============================================================================== --- releng/9.2/etc/namedb/named.conf Wed Aug 14 04:24:25 2013 (r254315) +++ releng/9.2/etc/namedb/named.conf Wed Aug 14 06:06:39 2013 (r254316) @@ -153,6 +153,72 @@ zone "30.172.in-addr.arpa" { type master zone "31.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "168.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +// Shared Address Space (RFC 6598) +zone "64.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "65.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "66.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "67.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "68.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "69.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "70.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "71.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "72.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "73.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "74.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "75.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "76.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "77.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "78.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "79.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "80.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "81.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "82.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "83.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "84.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "85.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "86.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "87.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "88.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "89.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "90.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "91.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "92.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "93.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "94.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "95.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "96.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "97.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "98.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "99.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "100.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "101.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "102.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "103.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "104.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "105.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "106.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "107.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "108.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "109.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "110.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "111.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "112.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "113.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "114.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "115.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "116.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "117.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "118.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "119.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "120.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "121.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "122.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "123.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "124.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "125.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "126.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "127.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; + // Link-local/APIPA (RFCs 3927, 5735 and 6303) zone "254.169.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; From owner-svn-src-releng@FreeBSD.ORG Thu Aug 15 01:31:32 2013 Return-Path: Delivered-To: svn-src-releng@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5722A6A9; Thu, 15 Aug 2013 01:31:32 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 449EE291E; Thu, 15 Aug 2013 01:31:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7F1VW2k067090; Thu, 15 Aug 2013 01:31:32 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7F1VWKZ067089; Thu, 15 Aug 2013 01:31:32 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201308150131.r7F1VWKZ067089@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 15 Aug 2013 01:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254346 - releng/9.2/contrib/sendmail/include/sm/os X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 01:31:32 -0000 Author: gshapiro Date: Thu Aug 15 01:31:31 2013 New Revision: 254346 URL: http://svnweb.freebsd.org/changeset/base/254346 Log: MFC: Temporarily revert sendmail 8.14.7 change to getipnodebyname() flags to prevent problems between the resolver and Microsoft DNS servers with AAAA lookups. The upstream open source project will work on a more permanent fix for the next release. Issue noted by Pavel Timofeev. Approved by: re (glebius) Modified: releng/9.2/contrib/sendmail/include/sm/os/sm_os_freebsd.h Directory Properties: releng/9.2/contrib/sendmail/ (props changed) Modified: releng/9.2/contrib/sendmail/include/sm/os/sm_os_freebsd.h ============================================================================== --- releng/9.2/contrib/sendmail/include/sm/os/sm_os_freebsd.h Thu Aug 15 00:17:31 2013 (r254345) +++ releng/9.2/contrib/sendmail/include/sm/os/sm_os_freebsd.h Thu Aug 15 01:31:31 2013 (r254346) @@ -39,3 +39,7 @@ #ifndef SM_CONF_MSG # define SM_CONF_MSG 1 #endif /* SM_CONF_MSG */ + +#ifndef SM_IPNODEBYNAME_FLAGS +# define SM_IPNODEBYNAME_FLAGS AI_DEFAULT|AI_ALL +#endif /* SM_IPNODEBYNAME_FLAGS */ From owner-svn-src-releng@FreeBSD.ORG Thu Aug 15 05:14:21 2013 Return-Path: Delivered-To: svn-src-releng@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 15C5FF26; Thu, 15 Aug 2013 05:14:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03B262327; Thu, 15 Aug 2013 05:14:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7F5EK8A052364; Thu, 15 Aug 2013 05:14:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7F5EKbK052363; Thu, 15 Aug 2013 05:14:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201308150514.r7F5EKbK052363@svn.freebsd.org> From: Michael Tuexen Date: Thu, 15 Aug 2013 05:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254355 - releng/9.2/sys/netinet X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 05:14:21 -0000 Author: tuexen Date: Thu Aug 15 05:14:20 2013 New Revision: 254355 URL: http://svnweb.freebsd.org/changeset/base/254355 Log: MFC r254352: Don't send uninitialized memory (two instances of 4 bytes) in every cookie on the wire. This bug was reported in https://bugzilla.mozilla.org/show_bug.cgi?id=905080 Approved by: re@ Modified: releng/9.2/sys/netinet/sctp_output.c Directory Properties: releng/9.2/sys/ (props changed) Modified: releng/9.2/sys/netinet/sctp_output.c ============================================================================== --- releng/9.2/sys/netinet/sctp_output.c Thu Aug 15 04:35:25 2013 (r254354) +++ releng/9.2/sys/netinet/sctp_output.c Thu Aug 15 05:14:20 2013 (r254355) @@ -5410,6 +5410,14 @@ do_a_abort: } SCTP_BUF_LEN(m) = sizeof(struct sctp_init_chunk); + /* + * We might not overwrite the identification[] completely and on + * some platforms time_entered will contain some padding. Therefore + * zero out the cookie to avoid putting uninitialized memory on the + * wire. + */ + memset(&stc, 0, sizeof(struct sctp_state_cookie)); + /* the time I built cookie */ (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); From owner-svn-src-releng@FreeBSD.ORG Thu Aug 15 08:12:17 2013 Return-Path: Delivered-To: svn-src-releng@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6EE5E5DC; Thu, 15 Aug 2013 08:12:17 +0000 (UTC) (envelope-from jlh@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1F42E5E; Thu, 15 Aug 2013 08:12:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7F8CHNn020526; Thu, 15 Aug 2013 08:12:17 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7F8CHUl020520; Thu, 15 Aug 2013 08:12:17 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201308150812.r7F8CHUl020520@svn.freebsd.org> From: Jeremie Le Hen Date: Thu, 15 Aug 2013 08:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254357 - releng/9.2/etc X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 08:12:17 -0000 Author: jlh Date: Thu Aug 15 08:12:16 2013 New Revision: 254357 URL: http://svnweb.freebsd.org/changeset/base/254357 Log: MFC r253853: Include /usr/local/etc/libmap.d/ by default. PR: 180568 Reviewed by: bapt Obtained from: kib Approved by: re (delphij) Added: releng/9.2/etc/libmap.conf - copied unchanged from r254332, stable/9/etc/libmap.conf Modified: releng/9.2/etc/Makefile Directory Properties: releng/9.2/etc/ (props changed) Modified: releng/9.2/etc/Makefile ============================================================================== --- releng/9.2/etc/Makefile Thu Aug 15 07:54:31 2013 (r254356) +++ releng/9.2/etc/Makefile Thu Aug 15 08:12:16 2013 (r254357) @@ -22,6 +22,7 @@ BIN1= crontab \ hosts.equiv \ inetd.conf \ libalias.conf \ + libmap.conf \ login.access \ login.conf \ mac.conf \ Copied: releng/9.2/etc/libmap.conf (from r254332, stable/9/etc/libmap.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/9.2/etc/libmap.conf Thu Aug 15 08:12:16 2013 (r254357, copy of r254332, stable/9/etc/libmap.conf) @@ -0,0 +1,2 @@ +# $FreeBSD$ +includedir /usr/local/etc/libmap.d From owner-svn-src-releng@FreeBSD.ORG Thu Aug 15 10:38:11 2013 Return-Path: Delivered-To: svn-src-releng@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 83DC3617; Thu, 15 Aug 2013 10:38:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 713D425C6; Thu, 15 Aug 2013 10:38:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7FAcB14073813; Thu, 15 Aug 2013 10:38:11 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7FAcBoE073812; Thu, 15 Aug 2013 10:38:11 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308151038.r7FAcBoE073812@svn.freebsd.org> From: Glen Barber Date: Thu, 15 Aug 2013 10:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254361 - releng/9.2/usr.sbin/bsdinstall/scripts X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 10:38:11 -0000 Author: gjb Date: Thu Aug 15 10:38:10 2013 New Revision: 254361 URL: http://svnweb.freebsd.org/changeset/base/254361 Log: MFC r254265: Make sure bootonly.iso for -BETAs and -RCs use the releases/ directory on the FTP mirrors to fetch distributions, since these are always pushed to releases/ during the release cycle. Approved by: re (marius) Modified: releng/9.2/usr.sbin/bsdinstall/scripts/mirrorselect Directory Properties: releng/9.2/usr.sbin/bsdinstall/scripts/ (props changed) Modified: releng/9.2/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- releng/9.2/usr.sbin/bsdinstall/scripts/mirrorselect Thu Aug 15 10:31:31 2013 (r254360) +++ releng/9.2/usr.sbin/bsdinstall/scripts/mirrorselect Thu Aug 15 10:38:10 2013 (r254361) @@ -162,7 +162,7 @@ exec 3>&- _UNAME_R=`uname -r` case ${_UNAME_R} in - *-CURRENT|*-STABLE|*-BETA*|*-PRERELEASE|*-RC*) + *-CURRENT|*-STABLE|*-PRERELEASE) RELDIR="snapshots" ;; *) From owner-svn-src-releng@FreeBSD.ORG Thu Aug 15 12:19:24 2013 Return-Path: Delivered-To: svn-src-releng@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 ESMTP id C2C2B687; Thu, 15 Aug 2013 12:19:24 +0000 (UTC) (envelope-from scottl@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD1FA2BC6; Thu, 15 Aug 2013 12:19:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7FCJOkZ012772; Thu, 15 Aug 2013 12:19:24 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7FCJGpI012717; Thu, 15 Aug 2013 12:19:16 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201308151219.r7FCJGpI012717@svn.freebsd.org> From: Scott Long Date: Thu, 15 Aug 2013 12:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254364 - in releng/9.2/sys: dev/aacraid dev/advansys dev/aic7xxx dev/amr dev/an dev/arcmsr dev/asr dev/ata dev/bktr dev/buslogic dev/dpt dev/e1000 dev/fatm dev/firewire dev/fxp dev/hat... X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 12:19:24 -0000 Author: scottl Date: Thu Aug 15 12:19:16 2013 New Revision: 254364 URL: http://svnweb.freebsd.org/changeset/base/254364 Log: Merge r254306: Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, adrian, achim Approved by: re Modified: releng/9.2/sys/dev/aacraid/aacraid_pci.c releng/9.2/sys/dev/advansys/adw_pci.c releng/9.2/sys/dev/aic7xxx/ahc_pci.c releng/9.2/sys/dev/aic7xxx/ahd_pci.c releng/9.2/sys/dev/amr/amr_pci.c releng/9.2/sys/dev/an/if_an_pci.c releng/9.2/sys/dev/arcmsr/arcmsr.c releng/9.2/sys/dev/asr/asr.c releng/9.2/sys/dev/ata/ata-pci.c releng/9.2/sys/dev/bktr/bktr_os.c releng/9.2/sys/dev/buslogic/bt_pci.c releng/9.2/sys/dev/dpt/dpt_pci.c releng/9.2/sys/dev/e1000/if_em.c releng/9.2/sys/dev/e1000/if_igb.c releng/9.2/sys/dev/e1000/if_lem.c releng/9.2/sys/dev/fatm/if_fatm.c releng/9.2/sys/dev/firewire/fwohci_pci.c releng/9.2/sys/dev/fxp/if_fxp.c releng/9.2/sys/dev/hatm/if_hatm.c releng/9.2/sys/dev/ida/ida_pci.c releng/9.2/sys/dev/ips/ips_pci.c releng/9.2/sys/dev/isp/isp_pci.c releng/9.2/sys/dev/iwn/if_iwn.c releng/9.2/sys/dev/ixgb/if_ixgb.c releng/9.2/sys/dev/ixgbe/ixv.c releng/9.2/sys/dev/mfi/mfi_pci.c releng/9.2/sys/dev/mlx/mlx_pci.c releng/9.2/sys/dev/mly/mly.c releng/9.2/sys/dev/mn/if_mn.c releng/9.2/sys/dev/mps/mps_pci.c releng/9.2/sys/dev/mpt/mpt_pci.c releng/9.2/sys/dev/mwl/if_mwl_pci.c releng/9.2/sys/dev/mxge/if_mxge.c releng/9.2/sys/dev/pccbb/pccbb_pci.c releng/9.2/sys/dev/pst/pst-pci.c releng/9.2/sys/dev/rp/rp_pci.c releng/9.2/sys/dev/safe/safe.c releng/9.2/sys/dev/sound/pci/als4000.c releng/9.2/sys/dev/sound/pci/aureal.c releng/9.2/sys/dev/sound/pci/cmi.c releng/9.2/sys/dev/sound/pci/cs4281.c releng/9.2/sys/dev/sound/pci/csa.c releng/9.2/sys/dev/sound/pci/ds1.c releng/9.2/sys/dev/sound/pci/emu10k1.c releng/9.2/sys/dev/sound/pci/emu10kx.c releng/9.2/sys/dev/sound/pci/envy24.c releng/9.2/sys/dev/sound/pci/envy24ht.c releng/9.2/sys/dev/sound/pci/es137x.c releng/9.2/sys/dev/sound/pci/fm801.c releng/9.2/sys/dev/sound/pci/hdspe.c releng/9.2/sys/dev/sound/pci/maestro.c releng/9.2/sys/dev/sound/pci/maestro3.c releng/9.2/sys/dev/sound/pci/neomagic.c releng/9.2/sys/dev/sound/pci/solo.c releng/9.2/sys/dev/sound/pci/t4dwave.c releng/9.2/sys/dev/sound/pci/via82c686.c releng/9.2/sys/dev/sound/pci/vibes.c releng/9.2/sys/dev/stge/if_stge.c releng/9.2/sys/dev/sym/sym_hipd.c releng/9.2/sys/dev/tdfx/tdfx_pci.c releng/9.2/sys/dev/twa/tw_osl_freebsd.c releng/9.2/sys/dev/tws/tws.c releng/9.2/sys/dev/ubsec/ubsec.c releng/9.2/sys/dev/wi/if_wi_pci.c releng/9.2/sys/pci/ncr.c Directory Properties: releng/9.2/sys/ (props changed) releng/9.2/sys/dev/ (props changed) releng/9.2/sys/dev/e1000/ (props changed) releng/9.2/sys/dev/isp/ (props changed) releng/9.2/sys/dev/ixgbe/ (props changed) Modified: releng/9.2/sys/dev/aacraid/aacraid_pci.c ============================================================================== --- releng/9.2/sys/dev/aacraid/aacraid_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/aacraid/aacraid_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -169,18 +169,12 @@ aacraid_pci_attach(device_t dev) /* * Verify that the adapter is correctly set up in PCI space. */ - command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); + pci_enable_busmaster(dev); command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); if (!(command & PCIM_CMD_BUSMASTEREN)) { device_printf(sc->aac_dev, "can't enable bus-master feature\n"); goto out; } - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(sc->aac_dev, "memory window not available\n"); - goto out; - } /* * Detect the hardware interface version, set up the bus interface Modified: releng/9.2/sys/dev/advansys/adw_pci.c ============================================================================== --- releng/9.2/sys/dev/advansys/adw_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/advansys/adw_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -199,14 +199,13 @@ adw_pci_attach(device_t dev) { struct adw_softc *adw; struct adw_pci_identity *entry; - u_int32_t command; + u_int16_t command; struct resource *regs; int regs_type; int regs_id; int error; int zero; - command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); entry = adw_find_pci_device(dev); if (entry == NULL) return (ENXIO); @@ -214,14 +213,11 @@ adw_pci_attach(device_t dev) regs_type = 0; regs_id = 0; #ifdef ADW_ALLOW_MEMIO - if ((command & PCIM_CMD_MEMEN) != 0) { - regs_type = SYS_RES_MEMORY; - regs_id = ADW_PCI_MEMBASE; - regs = bus_alloc_resource_any(dev, regs_type, - ®s_id, RF_ACTIVE); - } + regs_type = SYS_RES_MEMORY; + regs_id = ADW_PCI_MEMBASE; + regs = bus_alloc_resource_any(dev, regs_type, ®s_id, RF_ACTIVE); #endif - if (regs == NULL && (command & PCIM_CMD_PORTEN) != 0) { + if (regs == NULL) { regs_type = SYS_RES_IOPORT; regs_id = ADW_PCI_IOBASE; regs = bus_alloc_resource_any(dev, regs_type, @@ -296,6 +292,7 @@ adw_pci_attach(device_t dev) * 'control_flag' CONTROL_FLAG_IGNORE_PERR flag to tell the microcode * to ignore DMA parity errors. */ + command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/2); if ((command & PCIM_CMD_PERRESPEN) == 0) adw_lram_write_16(adw, ADW_MC_CONTROL_FLAG, adw_lram_read_16(adw, ADW_MC_CONTROL_FLAG) Modified: releng/9.2/sys/dev/aic7xxx/ahc_pci.c ============================================================================== --- releng/9.2/sys/dev/aic7xxx/ahc_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/aic7xxx/ahc_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -139,12 +139,10 @@ int ahc_pci_map_registers(struct ahc_softc *ahc) { struct resource *regs; - u_int command; int regs_type; int regs_id; int allow_memio; - command = aic_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/1); regs = NULL; regs_type = 0; regs_id = 0; @@ -166,7 +164,7 @@ ahc_pci_map_registers(struct ahc_softc * #endif } - if ((allow_memio != 0) && (command & PCIM_CMD_MEMEN) != 0) { + if (allow_memio != 0) { regs_type = SYS_RES_MEMORY; regs_id = AHC_PCI_MEMADDR; @@ -190,16 +188,11 @@ ahc_pci_map_registers(struct ahc_softc * bus_release_resource(ahc->dev_softc, regs_type, regs_id, regs); regs = NULL; - } else { - command &= ~PCIM_CMD_PORTEN; - aic_pci_write_config(ahc->dev_softc, - PCIR_COMMAND, - command, /*bytes*/1); } } } - if (regs == NULL && (command & PCIM_CMD_PORTEN) != 0) { + if (regs == NULL) { regs_type = SYS_RES_IOPORT; regs_id = AHC_PCI_IOADDR; regs = bus_alloc_resource_any(ahc->dev_softc, regs_type, @@ -217,11 +210,6 @@ ahc_pci_map_registers(struct ahc_softc * bus_release_resource(ahc->dev_softc, regs_type, regs_id, regs); regs = NULL; - } else { - command &= ~PCIM_CMD_MEMEN; - aic_pci_write_config(ahc->dev_softc, - PCIR_COMMAND, - command, /*bytes*/1); } } } Modified: releng/9.2/sys/dev/aic7xxx/ahd_pci.c ============================================================================== --- releng/9.2/sys/dev/aic7xxx/ahd_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/aic7xxx/ahd_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -143,13 +143,11 @@ ahd_pci_map_registers(struct ahd_softc * { struct resource *regs; struct resource *regs2; - u_int command; int regs_type; int regs_id; int regs_id2; int allow_memio; - command = aic_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/1); regs = NULL; regs2 = NULL; regs_type = 0; @@ -165,8 +163,7 @@ ahd_pci_map_registers(struct ahd_softc * allow_memio = 1; } - if ((command & PCIM_CMD_MEMEN) != 0 - && (ahd->bugs & AHD_PCIX_MMAPIO_BUG) == 0 + if ((ahd->bugs & AHD_PCIX_MMAPIO_BUG) == 0 && allow_memio != 0) { regs_type = SYS_RES_MEMORY; @@ -199,15 +196,10 @@ ahd_pci_map_registers(struct ahd_softc * regs_id, regs); regs = NULL; AHD_CORRECTABLE_ERROR(ahd); - } else { - command &= ~PCIM_CMD_PORTEN; - aic_pci_write_config(ahd->dev_softc, - PCIR_COMMAND, - command, /*bytes*/1); } } } - if (regs == NULL && (command & PCIM_CMD_PORTEN) != 0) { + if (regs == NULL) { regs_type = SYS_RES_IOPORT; regs_id = AHD_PCI_IOADDR0; regs = bus_alloc_resource_any(ahd->dev_softc, regs_type, @@ -233,9 +225,6 @@ ahd_pci_map_registers(struct ahd_softc * } ahd->tags[1] = rman_get_bustag(regs2); ahd->bshs[1] = rman_get_bushandle(regs2); - command &= ~PCIM_CMD_MEMEN; - aic_pci_write_config(ahd->dev_softc, PCIR_COMMAND, - command, /*bytes*/1); ahd->platform_data->regs_res_type[1] = regs_type; ahd->platform_data->regs_res_id[1] = regs_id2; ahd->platform_data->regs[1] = regs2; Modified: releng/9.2/sys/dev/amr/amr_pci.c ============================================================================== --- releng/9.2/sys/dev/amr/amr_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/amr/amr_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -184,7 +184,6 @@ amr_pci_attach(device_t dev) struct amr_softc *sc; struct amr_ident *id; int rid, rtype, error; - u_int32_t command; debug_called(1); @@ -204,24 +203,8 @@ amr_pci_attach(device_t dev) if ((id = amr_find_ident(dev)) == NULL) return (ENXIO); - command = pci_read_config(dev, PCIR_COMMAND, 1); if (id->flags & AMR_ID_QUARTZ) { - /* - * Make sure we are going to be able to talk to this board. - */ - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "memory window not available\n"); - return (ENXIO); - } sc->amr_type |= AMR_TYPE_QUARTZ; - } else { - /* - * Make sure we are going to be able to talk to this board. - */ - if ((command & PCIM_CMD_PORTEN) == 0) { - device_printf(dev, "I/O window not available\n"); - return (ENXIO); - } } if ((amr_force_sg32 == 0) && (id->flags & AMR_ID_DO_SG64) && @@ -231,11 +214,7 @@ amr_pci_attach(device_t dev) } /* force the busmaster enable bit on */ - if (!(command & PCIM_CMD_BUSMASTEREN)) { - device_printf(dev, "busmaster bit not set, enabling\n"); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); - } + pci_enable_busmaster(dev); /* * Allocate the PCI register window. Modified: releng/9.2/sys/dev/an/if_an_pci.c ============================================================================== --- releng/9.2/sys/dev/an/if_an_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/an/if_an_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -141,7 +141,6 @@ static int an_attach_pci(dev) device_t dev; { - u_int32_t command; struct an_softc *sc; int flags, error = 0; @@ -153,19 +152,6 @@ an_attach_pci(dev) sc->mpi350 = 1; sc->port_rid = PCIR_BAR(0); } else { - /* - * Map control/status registers. - */ - command = pci_read_config(dev, PCIR_COMMAND, 4); - command |= PCIM_CMD_PORTEN; - pci_write_config(dev, PCIR_COMMAND, command, 4); - command = pci_read_config(dev, PCIR_COMMAND, 4); - - if (!(command & PCIM_CMD_PORTEN)) { - device_printf(dev, "failed to enable I/O ports!\n"); - error = ENXIO; - goto fail; - } sc->port_rid = AN_PCI_LOIO; } error = an_alloc_port(dev, sc->port_rid, 1); Modified: releng/9.2/sys/dev/arcmsr/arcmsr.c ============================================================================== --- releng/9.2/sys/dev/arcmsr/arcmsr.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/arcmsr/arcmsr.c Thu Aug 15 12:19:16 2013 (r254364) @@ -4102,8 +4102,7 @@ static u_int32_t arcmsr_initialize(devic pci_command |= PCIM_CMD_BUSMASTEREN; pci_command |= PCIM_CMD_PERRESPEN; pci_command |= PCIM_CMD_MWRICEN; - /* Enable Busmaster/Mem */ - pci_command |= PCIM_CMD_MEMEN; + /* Enable Busmaster */ pci_write_config(dev, PCIR_COMMAND, pci_command, 2); switch(acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { Modified: releng/9.2/sys/dev/asr/asr.c ============================================================================== --- releng/9.2/sys/dev/asr/asr.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/asr/asr.c Thu Aug 15 12:19:16 2013 (r254364) @@ -2428,9 +2428,7 @@ asr_attach(device_t dev) return(ENXIO); } /* Enable if not formerly enabled */ - pci_write_config(dev, PCIR_COMMAND, - pci_read_config(dev, PCIR_COMMAND, sizeof(char)) | - PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN, sizeof(char)); + pci_enable_busmaster(dev); sc->ha_pciBusNum = pci_get_bus(dev); sc->ha_pciDeviceNum = (pci_get_slot(dev) << 3) | pci_get_function(dev); Modified: releng/9.2/sys/dev/ata/ata-pci.c ============================================================================== --- releng/9.2/sys/dev/ata/ata-pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/ata/ata-pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -99,11 +99,8 @@ ata_pci_attach(device_t dev) ctlr->dev = dev; /* if needed try to enable busmastering */ + pci_enable_busmaster(dev); cmd = pci_read_config(dev, PCIR_COMMAND, 2); - if (!(cmd & PCIM_CMD_BUSMASTEREN)) { - pci_write_config(dev, PCIR_COMMAND, cmd | PCIM_CMD_BUSMASTEREN, 2); - cmd = pci_read_config(dev, PCIR_COMMAND, 2); - } /* if busmastering mode "stuck" use it */ if ((cmd & PCIM_CMD_BUSMASTEREN) == PCIM_CMD_BUSMASTEREN) { Modified: releng/9.2/sys/dev/bktr/bktr_os.c ============================================================================== --- releng/9.2/sys/dev/bktr/bktr_os.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/bktr/bktr_os.c Thu Aug 15 12:19:16 2013 (r254364) @@ -318,7 +318,6 @@ bktr_attach( device_t dev ) { u_long latency; u_long fun; - u_long val; unsigned int rev; unsigned int unit; int error = 0; @@ -336,9 +335,7 @@ bktr_attach( device_t dev ) /* * Enable bus mastering and Memory Mapped device */ - val = pci_read_config(dev, PCIR_COMMAND, 4); - val |= (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); - pci_write_config(dev, PCIR_COMMAND, val, 4); + pci_enable_busmaster(dev); /* * Map control/status registers. Modified: releng/9.2/sys/dev/buslogic/bt_pci.c ============================================================================== --- releng/9.2/sys/dev/buslogic/bt_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/buslogic/bt_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -57,24 +57,19 @@ __FBSDID("$FreeBSD$"); static int bt_pci_alloc_resources(device_t dev) { - int command, type = 0, rid, zero; + int type = 0, rid, zero; struct resource *regs = 0; struct resource *irq = 0; - command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); #if 0 /* XXX Memory Mapped I/O seems to cause problems */ - if (command & PCIM_CMD_MEMEN) { - type = SYS_RES_MEMORY; - rid = BT_PCI_MEMADDR; - regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); - } + type = SYS_RES_MEMORY; + rid = BT_PCI_MEMADDR; + regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); #else - if (!regs && (command & PCIM_CMD_PORTEN)) { - type = SYS_RES_IOPORT; - rid = BT_PCI_IOADDR; - regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); - } + type = SYS_RES_IOPORT; + rid = BT_PCI_IOADDR; + regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); #endif if (!regs) return (ENOMEM); Modified: releng/9.2/sys/dev/dpt/dpt_pci.c ============================================================================== --- releng/9.2/sys/dev/dpt/dpt_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/dpt/dpt_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -77,23 +77,17 @@ dpt_pci_attach (device_t dev) dpt_softc_t * dpt; int error = 0; - u_int32_t command; - dpt = device_get_softc(dev); dpt->dev = dev; dpt_alloc(dev); - command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); - #ifdef DPT_ALLOW_MMIO - if ((command & PCIM_CMD_MEMEN) != 0) { - dpt->io_rid = DPT_PCI_MEMADDR; - dpt->io_type = SYS_RES_MEMORY; - dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type, - &dpt->io_rid, RF_ACTIVE); - } + dpt->io_rid = DPT_PCI_MEMADDR; + dpt->io_type = SYS_RES_MEMORY; + dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type, + &dpt->io_rid, RF_ACTIVE); #endif - if (dpt->io_res == NULL && (command & PCIM_CMD_PORTEN) != 0) { + if (dpt->io_res == NULL) { dpt->io_rid = DPT_PCI_IOADDR; dpt->io_type = SYS_RES_IOPORT; dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type, Modified: releng/9.2/sys/dev/e1000/if_em.c ============================================================================== --- releng/9.2/sys/dev/e1000/if_em.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/e1000/if_em.c Thu Aug 15 12:19:16 2013 (r254364) @@ -2442,16 +2442,8 @@ em_identify_hardware(struct adapter *ada device_t dev = adapter->dev; /* Make sure our PCI config space has the necessary stuff set */ + pci_enable_busmaster(dev); adapter->hw.bus.pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2); - if (!((adapter->hw.bus.pci_cmd_word & PCIM_CMD_BUSMASTEREN) && - (adapter->hw.bus.pci_cmd_word & PCIM_CMD_MEMEN))) { - device_printf(dev, "Memory Access and/or Bus Master bits " - "were not set!\n"); - adapter->hw.bus.pci_cmd_word |= - (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); - pci_write_config(dev, PCIR_COMMAND, - adapter->hw.bus.pci_cmd_word, 2); - } /* Save off the information about this board */ adapter->hw.vendor_id = pci_get_vendor(dev); Modified: releng/9.2/sys/dev/e1000/if_igb.c ============================================================================== --- releng/9.2/sys/dev/e1000/if_igb.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/e1000/if_igb.c Thu Aug 15 12:19:16 2013 (r254364) @@ -2410,16 +2410,8 @@ igb_identify_hardware(struct adapter *ad device_t dev = adapter->dev; /* Make sure our PCI config space has the necessary stuff set */ + pci_enable_busmaster(dev); adapter->hw.bus.pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2); - if (!((adapter->hw.bus.pci_cmd_word & PCIM_CMD_BUSMASTEREN) && - (adapter->hw.bus.pci_cmd_word & PCIM_CMD_MEMEN))) { - INIT_DEBUGOUT("Memory Access and/or Bus Master " - "bits were not set!\n"); - adapter->hw.bus.pci_cmd_word |= - (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); - pci_write_config(dev, PCIR_COMMAND, - adapter->hw.bus.pci_cmd_word, 2); - } /* Save off the information about this board */ adapter->hw.vendor_id = pci_get_vendor(dev); Modified: releng/9.2/sys/dev/e1000/if_lem.c ============================================================================== --- releng/9.2/sys/dev/e1000/if_lem.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/e1000/if_lem.c Thu Aug 15 12:19:16 2013 (r254364) @@ -2119,16 +2119,8 @@ lem_identify_hardware(struct adapter *ad device_t dev = adapter->dev; /* Make sure our PCI config space has the necessary stuff set */ + pci_enable_busmaster(dev); adapter->hw.bus.pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2); - if (!((adapter->hw.bus.pci_cmd_word & PCIM_CMD_BUSMASTEREN) && - (adapter->hw.bus.pci_cmd_word & PCIM_CMD_MEMEN))) { - device_printf(dev, "Memory Access and/or Bus Master bits " - "were not set!\n"); - adapter->hw.bus.pci_cmd_word |= - (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); - pci_write_config(dev, PCIR_COMMAND, - adapter->hw.bus.pci_cmd_word, 2); - } /* Save off the information about this board */ adapter->hw.vendor_id = pci_get_vendor(dev); Modified: releng/9.2/sys/dev/fatm/if_fatm.c ============================================================================== --- releng/9.2/sys/dev/fatm/if_fatm.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/fatm/if_fatm.c Thu Aug 15 12:19:16 2013 (r254364) @@ -2829,21 +2829,13 @@ fatm_attach(device_t dev) ifp->if_linkmiblen = sizeof(IFP2IFATM(sc->ifp)->mib); /* - * Enable memory and bustmaster + * Enable busmaster */ - cfg = pci_read_config(dev, PCIR_COMMAND, 2); - cfg |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, cfg, 2); + pci_enable_busmaster(dev); /* * Map memory */ - cfg = pci_read_config(dev, PCIR_COMMAND, 2); - if (!(cfg & PCIM_CMD_MEMEN)) { - if_printf(ifp, "failed to enable memory mapping\n"); - error = ENXIO; - goto fail; - } sc->memid = 0x10; sc->memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, RF_ACTIVE); Modified: releng/9.2/sys/dev/firewire/fwohci_pci.c ============================================================================== --- releng/9.2/sys/dev/firewire/fwohci_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/firewire/fwohci_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -242,7 +242,7 @@ fwohci_pci_init(device_t self) uint16_t cmd; cmd = pci_read_config(self, PCIR_COMMAND, 2); - cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN; + cmd |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN; #if 1 /* for broken hardware */ cmd &= ~PCIM_CMD_MWRICEN; #endif Modified: releng/9.2/sys/dev/fxp/if_fxp.c ============================================================================== --- releng/9.2/sys/dev/fxp/if_fxp.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/fxp/if_fxp.c Thu Aug 15 12:19:16 2013 (r254364) @@ -452,7 +452,6 @@ fxp_attach(device_t dev) * Enable bus mastering. */ pci_enable_busmaster(dev); - val = pci_read_config(dev, PCIR_COMMAND, 2); /* * Figure out which we should try first - memory mapping or i/o mapping? @@ -610,6 +609,7 @@ fxp_attach(device_t dev) * is a valid cacheline size (8 or 16 dwords), then tell * the board to turn on MWI. */ + val = pci_read_config(dev, PCIR_COMMAND, 2); if (val & PCIM_CMD_MWRICEN && pci_read_config(dev, PCIR_CACHELNSZ, 1) != 0) sc->flags |= FXP_FLAG_MWI_ENABLE; Modified: releng/9.2/sys/dev/hatm/if_hatm.c ============================================================================== --- releng/9.2/sys/dev/hatm/if_hatm.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/hatm/if_hatm.c Thu Aug 15 12:19:16 2013 (r254364) @@ -1686,7 +1686,7 @@ hatm_attach(device_t dev) * 4.2 BIOS Configuration */ v = pci_read_config(dev, PCIR_COMMAND, 2); - v |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN; + v |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN; pci_write_config(dev, PCIR_COMMAND, v, 2); /* @@ -1702,12 +1702,6 @@ hatm_attach(device_t dev) /* * Map memory */ - v = pci_read_config(dev, PCIR_COMMAND, 2); - if (!(v & PCIM_CMD_MEMEN)) { - device_printf(dev, "failed to enable memory\n"); - error = ENXIO; - goto failed; - } sc->memid = PCIR_BAR(0); sc->memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, RF_ACTIVE); Modified: releng/9.2/sys/dev/ida/ida_pci.c ============================================================================== --- releng/9.2/sys/dev/ida/ida_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/ida/ida_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -236,19 +236,8 @@ ida_pci_attach(device_t dev) struct ida_board *board = ida_pci_match(dev); u_int32_t id = pci_get_devid(dev); struct ida_softc *ida; - u_int command; int error, rid; - command = pci_read_config(dev, PCIR_COMMAND, 1); - - /* - * it appears that this board only does MEMIO access. - */ - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "Only memory mapped I/O is supported\n"); - return (ENXIO); - } - ida = (struct ida_softc *)device_get_softc(dev); ida->dev = dev; ida->cmd = *board->accessor; Modified: releng/9.2/sys/dev/ips/ips_pci.c ============================================================================== --- releng/9.2/sys/dev/ips/ips_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/ips/ips_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -59,7 +59,6 @@ static int ips_pci_probe(device_t dev) static int ips_pci_attach(device_t dev) { - u_int32_t command; ips_softc_t *sc; @@ -95,22 +94,18 @@ static int ips_pci_attach(device_t dev) } else goto error; /* make sure busmastering is on */ - command = pci_read_config(dev, PCIR_COMMAND, 1); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 1); + pci_enable_busmaster(dev); /* seting up io space */ sc->iores = NULL; - if(command & PCIM_CMD_MEMEN){ - PRINTF(10, "trying MEMIO\n"); - if(pci_get_device(dev) == IPS_COPPERHEAD_DEVICE_ID) - sc->rid = PCIR_BAR(1); - else - sc->rid = PCIR_BAR(0); - sc->iotype = SYS_RES_MEMORY; - sc->iores = bus_alloc_resource_any(dev, sc->iotype, - &sc->rid, RF_ACTIVE); - } - if(!sc->iores && command & PCIM_CMD_PORTEN){ + PRINTF(10, "trying MEMIO\n"); + if(pci_get_device(dev) == IPS_COPPERHEAD_DEVICE_ID) + sc->rid = PCIR_BAR(1); + else + sc->rid = PCIR_BAR(0); + sc->iotype = SYS_RES_MEMORY; + sc->iores = bus_alloc_resource_any(dev, sc->iotype, &sc->rid, + RF_ACTIVE); + if(!sc->iores){ PRINTF(10, "trying PORTIO\n"); sc->rid = PCIR_BAR(0); sc->iotype = SYS_RES_IOPORT; Modified: releng/9.2/sys/dev/isp/isp_pci.c ============================================================================== --- releng/9.2/sys/dev/isp/isp_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/isp/isp_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -706,13 +706,10 @@ isp_pci_attach(device_t dev) pcs->irq = pcs->regs = NULL; pcs->rgd = pcs->rtp = pcs->iqd = 0; - cmd = pci_read_config(dev, PCIR_COMMAND, 2); - if (cmd & m1) { - pcs->rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; - pcs->rgd = (m1 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; - pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE); - } - if (pcs->regs == NULL && (cmd & m2)) { + pcs->rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; + pcs->rgd = (m1 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; + pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE); + if (pcs->regs == NULL) { pcs->rtp = (m2 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; pcs->rgd = (m2 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE); @@ -891,6 +888,7 @@ isp_pci_attach(device_t dev) /* * Make sure that SERR, PERR, WRITE INVALIDATE and BUSMASTER are set. */ + cmd = pci_read_config(dev, PCIR_COMMAND, 2); cmd |= PCIM_CMD_SEREN | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_INVEN; if (IS_2300(isp)) { /* per QLogic errata */ cmd &= ~PCIM_CMD_INVEN; Modified: releng/9.2/sys/dev/iwn/if_iwn.c ============================================================================== --- releng/9.2/sys/dev/iwn/if_iwn.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/iwn/if_iwn.c Thu Aug 15 12:19:16 2013 (r254364) @@ -455,12 +455,12 @@ iwn_attach(device_t dev) pci_write_config(dev, 0x41, 0, 1); /* Hardware bug workaround. */ - reg = pci_read_config(dev, PCIR_COMMAND, 1); + reg = pci_read_config(dev, PCIR_COMMAND, 2); if (reg & PCIM_CMD_INTxDIS) { DPRINTF(sc, IWN_DEBUG_RESET, "%s: PCIe INTx Disable set\n", __func__); reg &= ~PCIM_CMD_INTxDIS; - pci_write_config(dev, PCIR_COMMAND, reg, 1); + pci_write_config(dev, PCIR_COMMAND, reg, 2); } /* Enable bus-mastering. */ Modified: releng/9.2/sys/dev/ixgb/if_ixgb.c ============================================================================== --- releng/9.2/sys/dev/ixgb/if_ixgb.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/ixgb/if_ixgb.c Thu Aug 15 12:19:16 2013 (r254364) @@ -1209,15 +1209,9 @@ ixgb_identify_hardware(struct adapter * device_t dev = adapter->dev; /* Make sure our PCI config space has the necessary stuff set */ + pci_enable_busmaster(dev); adapter->hw.pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2); - if (!((adapter->hw.pci_cmd_word & PCIM_CMD_BUSMASTEREN) && - (adapter->hw.pci_cmd_word & PCIM_CMD_MEMEN))) { - device_printf(dev, - "Memory Access and/or Bus Master bits were not set!\n"); - adapter->hw.pci_cmd_word |= - (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); - pci_write_config(dev, PCIR_COMMAND, adapter->hw.pci_cmd_word, 2); - } + /* Save off the information about this board */ adapter->hw.vendor_id = pci_get_vendor(dev); adapter->hw.device_id = pci_get_device(dev); Modified: releng/9.2/sys/dev/ixgbe/ixv.c ============================================================================== --- releng/9.2/sys/dev/ixgbe/ixv.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/ixgbe/ixv.c Thu Aug 15 12:19:16 2013 (r254364) @@ -1561,14 +1561,8 @@ ixv_identify_hardware(struct adapter *ad ** Make sure BUSMASTER is set, on a VM under ** KVM it may not be and will break things. */ + pci_enable_busmaster(dev); pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2); - if (!((pci_cmd_word & PCIM_CMD_BUSMASTEREN) && - (pci_cmd_word & PCIM_CMD_MEMEN))) { - INIT_DEBUGOUT("Memory Access and/or Bus Master " - "bits were not set!\n"); - pci_cmd_word |= (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); - pci_write_config(dev, PCIR_COMMAND, pci_cmd_word, 2); - } /* Save off the information about this board */ adapter->hw.vendor_id = pci_get_vendor(dev); Modified: releng/9.2/sys/dev/mfi/mfi_pci.c ============================================================================== --- releng/9.2/sys/dev/mfi/mfi_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/mfi/mfi_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -187,7 +187,6 @@ mfi_pci_attach(device_t dev) { struct mfi_softc *sc; struct mfi_ident *m; - uint32_t command; int count, error; sc = device_get_softc(dev); @@ -196,19 +195,8 @@ mfi_pci_attach(device_t dev) m = mfi_find_ident(dev); sc->mfi_flags = m->flags; - /* Verify that the adapter can be set up in PCI space */ - command = pci_read_config(dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); - command = pci_read_config(dev, PCIR_COMMAND, 2); - if ((command & PCIM_CMD_BUSMASTEREN) == 0) { - device_printf(dev, "Can't enable PCI busmaster\n"); - return (ENXIO); - } - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "PCI memory window not available\n"); - return (ENXIO); - } + /* Ensure busmastering is enabled */ + pci_enable_busmaster(dev); /* Allocate PCI registers */ if ((sc->mfi_flags & MFI_FLAGS_1064R) || Modified: releng/9.2/sys/dev/mlx/mlx_pci.c ============================================================================== --- releng/9.2/sys/dev/mlx/mlx_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/mlx/mlx_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -113,21 +113,11 @@ mlx_pci_attach(device_t dev) { struct mlx_softc *sc; int i, error; - u_int32_t command; debug_called(1); - /* - * Make sure we are going to be able to talk to this board. - */ - command = pci_read_config(dev, PCIR_COMMAND, 2); - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "memory window not available\n"); - return(ENXIO); - } /* force the busmaster enable bit on */ - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); + pci_enable_busmaster(dev); /* * Initialise softc. Modified: releng/9.2/sys/dev/mly/mly.c ============================================================================== --- releng/9.2/sys/dev/mly/mly.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/mly/mly.c Thu Aug 15 12:19:16 2013 (r254364) @@ -333,7 +333,6 @@ static int mly_pci_attach(struct mly_softc *sc) { int i, error; - u_int32_t command; debug_called(1); @@ -342,21 +341,8 @@ mly_pci_attach(struct mly_softc *sc) /* * Verify that the adapter is correctly set up in PCI space. - * - * XXX we shouldn't do this; the PCI code should. */ - command = pci_read_config(sc->mly_dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(sc->mly_dev, PCIR_COMMAND, command, 2); - command = pci_read_config(sc->mly_dev, PCIR_COMMAND, 2); - if (!(command & PCIM_CMD_BUSMASTEREN)) { - mly_printf(sc, "can't enable busmaster feature\n"); - goto fail; - } - if ((command & PCIM_CMD_MEMEN) == 0) { - mly_printf(sc, "memory window not available\n"); - goto fail; - } + pci_enable_busmaster(sc->mly_dev); /* * Allocate the PCI register window. Modified: releng/9.2/sys/dev/mn/if_mn.c ============================================================================== --- releng/9.2/sys/dev/mn/if_mn.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/mn/if_mn.c Thu Aug 15 12:19:16 2013 (r254364) @@ -1364,9 +1364,9 @@ mn_attach (device_t self) return(ENXIO); } - u = pci_read_config(self, PCIR_COMMAND, 1); + u = pci_read_config(self, PCIR_COMMAND, 2); printf("%x\n", u); - pci_write_config(self, PCIR_COMMAND, u | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN, 1); + pci_write_config(self, PCIR_COMMAND, u | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN, 2); #if 0 pci_write_config(self, PCIR_COMMAND, 0x02800046, 4); #endif Modified: releng/9.2/sys/dev/mps/mps_pci.c ============================================================================== --- releng/9.2/sys/dev/mps/mps_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/mps/mps_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -183,7 +183,6 @@ mps_pci_attach(device_t dev) { struct mps_softc *sc; struct mps_ident *m; - uint16_t command; int error; sc = device_get_softc(dev); @@ -193,18 +192,7 @@ mps_pci_attach(device_t dev) sc->mps_flags = m->flags; /* Twiddle basic PCI config bits for a sanity check */ - command = pci_read_config(dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); - command = pci_read_config(dev, PCIR_COMMAND, 2); - if ((command & PCIM_CMD_BUSMASTEREN) == 0) { - device_printf(dev, "Cannot enable PCI busmaster\n"); - return (ENXIO); - } - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "PCI memory window not available\n"); - return (ENXIO); - } + pci_enable_busmaster(dev); /* Allocate the System Interface Register Set */ sc->mps_regs_rid = PCIR_BAR(1); Modified: releng/9.2/sys/dev/mpt/mpt_pci.c ============================================================================== --- releng/9.2/sys/dev/mpt/mpt_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/mpt/mpt_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -394,16 +394,11 @@ mpt_pci_attach(device_t dev) /* Print INFO level (if any) if bootverbose is set */ mpt->verbose += (bootverbose != 0)? 1 : 0; } - /* Make sure memory access decoders are enabled */ - cmd = pci_read_config(dev, PCIR_COMMAND, 2); - if ((cmd & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "Memory accesses disabled"); - return (ENXIO); - } /* * Make sure that SERR, PERR, WRITE INVALIDATE and BUSMASTER are set. */ + cmd = pci_read_config(dev, PCIR_COMMAND, 2); cmd |= PCIM_CMD_SERRESPEN | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN; Modified: releng/9.2/sys/dev/mwl/if_mwl_pci.c ============================================================================== --- releng/9.2/sys/dev/mwl/if_mwl_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/mwl/if_mwl_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -120,29 +120,6 @@ mwl_pci_probe(device_t dev) return ENXIO; } -static u_int32_t -mwl_pci_setup(device_t dev) -{ - u_int32_t cmd; - - /* - * Enable memory mapping and bus mastering. - */ - cmd = pci_read_config(dev, PCIR_COMMAND, 4); - cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, cmd, 4); - cmd = pci_read_config(dev, PCIR_COMMAND, 4); - if ((cmd & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "failed to enable memory mapping\n"); - return 0; - } - if ((cmd & PCIM_CMD_BUSMASTEREN) == 0) { - device_printf(dev, "failed to enable bus mastering\n"); - return 0; - } - return 1; -} - static int mwl_pci_attach(device_t dev) { @@ -152,11 +129,8 @@ mwl_pci_attach(device_t dev) sc->sc_dev = dev; - /* - * Enable memory mapping and bus mastering. - */ - if (!mwl_pci_setup(dev)) - return 0; + pci_enable_busmaster(dev); + /* * Setup memory-mapping of PCI registers. */ @@ -285,8 +259,7 @@ mwl_pci_resume(device_t dev) { struct mwl_pci_softc *psc = device_get_softc(dev); - if (!mwl_pci_setup(dev)) - return ENXIO; + pci_enable_busmaster(dev); mwl_resume(&psc->sc_sc); Modified: releng/9.2/sys/dev/mxge/if_mxge.c ============================================================================== --- releng/9.2/sys/dev/mxge/if_mxge.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/mxge/if_mxge.c Thu Aug 15 12:19:16 2013 (r254364) @@ -3826,7 +3826,7 @@ mxge_setup_cfg_space(mxge_softc_t *sc) { device_t dev = sc->dev; int reg; - uint16_t cmd, lnk, pectl; + uint16_t lnk, pectl; /* find the PCIe link width and set max read request to 4KB*/ if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) { @@ -3846,9 +3846,6 @@ mxge_setup_cfg_space(mxge_softc_t *sc) /* Enable DMA and Memory space access */ pci_enable_busmaster(dev); - cmd = pci_read_config(dev, PCIR_COMMAND, 2); - cmd |= PCIM_CMD_MEMEN; - pci_write_config(dev, PCIR_COMMAND, cmd, 2); } static uint32_t Modified: releng/9.2/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- releng/9.2/sys/dev/pccbb/pccbb_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/pccbb/pccbb_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -471,10 +471,7 @@ cbb_chipinit(struct cbb_softc *sc) pci_write_config(sc->dev, PCIR_SUBBUS_2, sc->subbus, 1); /* Enable memory access */ - PCI_MASK_CONFIG(sc->dev, PCIR_COMMAND, - | PCIM_CMD_MEMEN - | PCIM_CMD_PORTEN - | PCIM_CMD_BUSMASTEREN, 2); + pci_enable_busmaster(sc->dev); /* disable Legacy IO */ switch (sc->chipset) { Modified: releng/9.2/sys/dev/pst/pst-pci.c ============================================================================== --- releng/9.2/sys/dev/pst/pst-pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/pst/pst-pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -88,9 +88,7 @@ iop_pci_attach(device_t dev) RF_SHAREABLE | RF_ACTIVE); /* now setup the infrastructure to talk to the device */ - pci_write_config(dev, PCIR_COMMAND, - pci_read_config(dev, PCIR_COMMAND, 1) | - PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN, 1); + pci_enable_busmaster(dev); sc->ibase = rman_get_virtual(sc->r_mem); sc->reg = (struct i2o_registers *)sc->ibase; Modified: releng/9.2/sys/dev/rp/rp_pci.c ============================================================================== --- releng/9.2/sys/dev/rp/rp_pci.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/rp/rp_pci.c Thu Aug 15 12:19:16 2013 (r254364) @@ -151,7 +151,6 @@ rp_pciattach(device_t dev) CONTROLLER_t *ctlp; int unit; int retval; - u_int32_t stcmd; ctlp = device_get_softc(dev); bzero(ctlp, sizeof(*ctlp)); @@ -161,13 +160,6 @@ rp_pciattach(device_t dev) ctlp->aiop2off = rp_pci_aiop2off; ctlp->ctlmask = rp_pci_ctlmask; - /* Wake up the device. */ - stcmd = pci_read_config(dev, PCIR_COMMAND, 4); - if ((stcmd & PCIM_CMD_PORTEN) == 0) { - stcmd |= (PCIM_CMD_PORTEN); - pci_write_config(dev, PCIR_COMMAND, 4, stcmd); - } - /* The IO ports of AIOPs for a PCI controller are continuous. */ ctlp->io_num = 1; ctlp->io_rid = malloc(sizeof(*(ctlp->io_rid)) * ctlp->io_num, M_DEVBUF, M_NOWAIT | M_ZERO); Modified: releng/9.2/sys/dev/safe/safe.c ============================================================================== --- releng/9.2/sys/dev/safe/safe.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/safe/safe.c Thu Aug 15 12:19:16 2013 (r254364) @@ -220,28 +220,15 @@ safe_attach(device_t dev) { struct safe_softc *sc = device_get_softc(dev); u_int32_t raddr; - u_int32_t cmd, i, devinfo; + u_int32_t i, devinfo; int rid; bzero(sc, sizeof (*sc)); sc->sc_dev = dev; /* XXX handle power management */ - - cmd = pci_read_config(dev, PCIR_COMMAND, 4); - cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, cmd, 4); - cmd = pci_read_config(dev, PCIR_COMMAND, 4); - if (!(cmd & PCIM_CMD_MEMEN)) { - device_printf(dev, "failed to enable memory mapping\n"); - goto bad; - } - - if (!(cmd & PCIM_CMD_BUSMASTEREN)) { - device_printf(dev, "failed to enable bus mastering\n"); - goto bad; - } + pci_enable_busmaster(dev); /* * Setup memory-mapping of PCI registers. Modified: releng/9.2/sys/dev/sound/pci/als4000.c ============================================================================== --- releng/9.2/sys/dev/sound/pci/als4000.c Thu Aug 15 11:41:53 2013 (r254363) +++ releng/9.2/sys/dev/sound/pci/als4000.c Thu Aug 15 12:19:16 2013 (r254364) @@ -806,16 +806,13 @@ static int als_pci_attach(device_t dev) { struct sc_info *sc; - u_int32_t data; char status[SND_STATUSLEN]; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_als4000 softc"); sc->dev = dev; - data = pci_read_config(dev, PCIR_COMMAND, 2); - data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); - pci_write_config(dev, PCIR_COMMAND, data, 2); + pci_enable_busmaster(dev); /* * By default the power to the various components on the * ALS4000 is entirely controlled by the pci powerstate. We *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-releng@FreeBSD.ORG Thu Aug 15 14:33:10 2013 Return-Path: Delivered-To: svn-src-releng@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 ESMTP id 30D9D524; Thu, 15 Aug 2013 14:33:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1672401; Thu, 15 Aug 2013 14:33:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7FEX93Z064123; Thu, 15 Aug 2013 14:33:09 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7FEX9A9064122; Thu, 15 Aug 2013 14:33:09 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201308151433.r7FEX9A9064122@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 15 Aug 2013 14:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254367 - releng/9.2/sys/boot/common X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 14:33:10 -0000 Author: ae Date: Thu Aug 15 14:33:09 2013 New Revision: 254367 URL: http://svnweb.freebsd.org/changeset/base/254367 Log: Merge r254366: Make the check for number of entries less strict. Some partitioning tools can create GPT with number of entries less than 128. Approved by: re (marius) Modified: releng/9.2/sys/boot/common/part.c Directory Properties: releng/9.2/sys/ (props changed) releng/9.2/sys/boot/ (props changed) Modified: releng/9.2/sys/boot/common/part.c ============================================================================== --- releng/9.2/sys/boot/common/part.c Thu Aug 15 13:09:58 2013 (r254366) +++ releng/9.2/sys/boot/common/part.c Thu Aug 15 14:33:09 2013 (r254367) @@ -181,7 +181,7 @@ gpt_checkhdr(struct gpt_hdr *hdr, uint64 } hdr->hdr_entries = le32toh(hdr->hdr_entries); hdr->hdr_entsz = le32toh(hdr->hdr_entsz); - if (hdr->hdr_entries < 128 || + if (hdr->hdr_entries == 0 || hdr->hdr_entsz < sizeof(struct gpt_ent) || sectorsize % hdr->hdr_entsz != 0) { DEBUG("invalid entry size or number of entries"); @@ -203,11 +203,14 @@ gpt_checktbl(const struct gpt_hdr *hdr, int i, cnt; cnt = size / hdr->hdr_entsz; - /* Check CRC only when buffer size is enough for table. */ - if (hdr->hdr_entries <= cnt && - crc32(tbl, size) != hdr->hdr_crc_table) { - DEBUG("GPT table's CRC doesn't match"); - return (-1); + if (hdr->hdr_entries <= cnt) { + cnt = hdr->hdr_entries; + /* Check CRC only when buffer size is enough for table. */ + if (hdr->hdr_crc_table != + crc32(tbl, hdr->hdr_entries * hdr->hdr_entsz)) { + DEBUG("GPT table's CRC doesn't match"); + return (-1); + } } ent = (struct gpt_ent *)tbl; for (i = 0; i < cnt; i++, ent++) { From owner-svn-src-releng@FreeBSD.ORG Thu Aug 15 14:41:40 2013 Return-Path: Delivered-To: svn-src-releng@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 ESMTP id 0B49997E; Thu, 15 Aug 2013 14:41:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ECA9C2495; Thu, 15 Aug 2013 14:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7FEfdPv067527; Thu, 15 Aug 2013 14:41:39 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7FEfdMD067525; Thu, 15 Aug 2013 14:41:39 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308151441.r7FEfdMD067525@svn.freebsd.org> From: Glen Barber Date: Thu, 15 Aug 2013 14:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254368 - in releng/9.2: release sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 14:41:40 -0000 Author: gjb Date: Thu Aug 15 14:41:39 2013 New Revision: 254368 URL: http://svnweb.freebsd.org/changeset/base/254368 Log: Update releng/9.2 to -RC2. Approved by: re (implicit) Modified: releng/9.2/release/Makefile.sysinstall releng/9.2/sys/conf/newvers.sh Modified: releng/9.2/release/Makefile.sysinstall ============================================================================== --- releng/9.2/release/Makefile.sysinstall Thu Aug 15 14:33:09 2013 (r254367) +++ releng/9.2/release/Makefile.sysinstall Thu Aug 15 14:41:39 2013 (r254368) @@ -24,7 +24,7 @@ # Set these, release builder! # # Fixed version: -#BUILDNAME=9.2-RC1 +#BUILDNAME=9.2-RC2 # # Automatic SNAP versioning: DATE != date +%Y%m%d Modified: releng/9.2/sys/conf/newvers.sh ============================================================================== --- releng/9.2/sys/conf/newvers.sh Thu Aug 15 14:33:09 2013 (r254367) +++ releng/9.2/sys/conf/newvers.sh Thu Aug 15 14:41:39 2013 (r254368) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.2" -BRANCH="RC1" +BRANCH="RC2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-releng@FreeBSD.ORG Thu Aug 15 15:34:26 2013 Return-Path: Delivered-To: svn-src-releng@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 ESMTP id C9F777B5; Thu, 15 Aug 2013 15:34:26 +0000 (UTC) (envelope-from dteske@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7FDA27A4; Thu, 15 Aug 2013 15:34:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7FFYQZc086842; Thu, 15 Aug 2013 15:34:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7FFYQHK086841; Thu, 15 Aug 2013 15:34:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201308151534.r7FFYQHK086841@svn.freebsd.org> From: Devin Teske Date: Thu, 15 Aug 2013 15:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254370 - releng/9.2/sys/boot/forth X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 15:34:26 -0000 Author: dteske Date: Thu Aug 15 15:34:26 2013 New Revision: 254370 URL: http://svnweb.freebsd.org/changeset/base/254370 Log: MFS9 SVN r254331: Add optional support for default override of standard setup; but only if corresponding functions are provided. If override function does not exist, boot remains unmodified. This patch should not result in any changes. This includes changes to take advantage of the new functionality. Approved by: re (marius) Modified: releng/9.2/sys/boot/forth/beastie.4th Directory Properties: releng/9.2/sys/ (props changed) releng/9.2/sys/boot/ (props changed) releng/9.2/sys/boot/forth/ (props changed) Modified: releng/9.2/sys/boot/forth/beastie.4th ============================================================================== --- releng/9.2/sys/boot/forth/beastie.4th Thu Aug 15 15:12:14 2013 (r254369) +++ releng/9.2/sys/boot/forth/beastie.4th Thu Aug 15 15:34:26 2013 (r254370) @@ -123,6 +123,76 @@ variable logoY 0 25 at-xy ; +: tribute-art ( x y -- ) \ see tribute[bw]-logo + + \ Disable the brand art (we're going to use that space) + s" set loader_brand=none" evaluate + + \ Blank out the frame of the menu and move the title to left + s" set loader_menu_title=" evaluate + s" set loader_menu_frame=none" evaluate + + \ Move the menu to the center of the screen + s" set loader_menu_x=26" evaluate + s" set loader_menu_y=13" evaluate + s" set loader_menu_timeout_x=21" evaluate + s" set loader_menu_timeout_y=24" evaluate + + 2 - swap 39 - swap \ top-left (see `fbsdbw-logo' comments above) + + 2dup at-xy 11 spaces ." ,d b." 1+ + 2dup at-xy ." ,d88] [88b." 1+ + 2dup at-xy ." ,d888P" 34 emit ." ,d88b. " 34 emit ." Y888b." 1+ + 2dup at-xy ." , <888P" 34 emit ." ,dP" 34 emit ." ,db." 34 emit + ." Yb. " 34 emit ." Y888> ," 1+ + 2dup at-xy ." <88b.~ ,d888 " 34 emit ." YP" 34 emit + ." 888b. ~,d88>" 1+ + 2dup at-xy ." ," 34 emit ." Y888888P" 34 emit ." ,db.,db." 34 emit + ." Y888888P" 34 emit ." ," 1+ + 2dup at-xy ." <88b." 34 emit ." YP" 34 emit ." _ " 34 emit + ." YP" 34 emit 34 emit ." YP" 34 emit ." _ " 34 emit + ." YP" 34 emit ." ,d88>" 1+ + 2dup at-xy ." " 34 emit ." Y88b.,dP Yb.,d88P" 34 emit 1+ + at-xy ." " 34 emit ." YP" 34 emit ." " 34 emit + ." YP" 34 emit ." " +; + +: tribute-text ( x y -- ) \ see tribute[bw]-logo + + swap 2 - swap \ beastie adjustment (see `fbsdbw-logo' comments above) + + 2dup at-xy ." CEO Workstation" 1+ + 1+ + 2dup at-xy ." Nakatomi Socrates FreeBSD 9.2" 1+ + 2dup at-xy ." Z-Level Central Core" 1+ + 1+ + at-xy ." Preliminary Clearance Approved." +; + +: tribute-logo ( x y -- ) \ color Socrates tribute (16 rows x 32 columns) + + \ Produce the tribute art in bright green + 2dup at-xy ." " 2dup tribute-art ." " + + \ Produce the tribute text in regular green + 2dup at-xy ." " 2dup tribute-text ." " + + \ Distinguish the ``Free'' in tribute-text + 2 + swap 16 + swap at-xy ." Free" + + \ Put the cursor back at the bottom + 0 25 at-xy +; + +: tributebw-logo ( x y -- ) \ Socrates tribute (16 rows x 32 columns) + + \ Produce the tribute art and text + 2dup tribute-art tribute-text + + \ Put the cursor back at the bottom + 0 25 at-xy +; + : orb-logo ( x y -- ) \ color Orb mascot (15 rows x 30 columns) 3 + \ beastie adjustment (see `fbsdbw-logo' comments above) @@ -181,8 +251,10 @@ variable logoY \ beastie Color ``Helper Daemon'' mascot (19 rows x 34 columns) \ beastiebw B/W ``Helper Daemon'' mascot (19 rows x 34 columns) \ fbsdbw "FreeBSD" logo in B/W (13 rows x 21 columns) -\ orb Color ``Orb'' mascot (15 rows x 30 columns) (default) +\ orb Color ``Orb'' mascot (15 rows x 30 columns) (2nd default) \ orbbw B/W ``Orb'' mascot (15 rows x 32 columns) +\ tribute Color ``Tribute'' (must fit 19 rows x 34 columns) (default) +\ tributebw B/W ``Tribute'' (must fit 19 rows x 34 columns) \ \ NOTE: Setting `loader_logo' to an undefined value (such as "none") will \ prevent beastie from being drawn. @@ -203,9 +275,21 @@ variable logoY s" loader_logo" getenv dup -1 = if logoX @ logoY @ loader_color? if - orb-logo + s" tribute-logo" + sfind if + execute + else + drop + orb-logo + then else - orbbw-logo + s" tributebw-logo" + sfind if + execute + else + drop + orbbw-logo + then then drop exit then @@ -230,6 +314,24 @@ variable logoY logoX @ logoY @ orbbw-logo 2drop exit then + 2dup s" tribute" compare-insensitive 0= if + logoX @ logoY @ + s" tribute-logo" sfind if + execute + else + orb-logo + then + 2drop exit + then + 2dup s" tributebw" compare-insensitive 0= if + logoX @ logoY @ + s" tributebw-logo" sfind if + execute + else + orbbw-logo + then + 2drop exit + then 2drop ;