From patchwork Fri Jan 11 16:32:27 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Wolf X-Patchwork-Id: 22964 Return-Path: X-Original-To: yaboot-devel@ozlabs.org Delivered-To: yaboot-devel@ozlabs.org Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e3.ny.us.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTP id EC311DE089 for ; Sat, 12 Jan 2008 03:32:34 +1100 (EST) Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e3.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m0BGWT73003119 for ; Fri, 11 Jan 2008 11:32:29 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m0BGWTWt380802 for ; Fri, 11 Jan 2008 11:32:29 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m0BGWTv7025827 for ; Fri, 11 Jan 2008 11:32:29 -0500 Received: from [9.10.86.88] (9-10-86-88.rchland.ibm.com [9.10.86.88]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m0BGWTBI025673 for ; Fri, 11 Jan 2008 11:32:29 -0500 Message-ID: <47879A1B.5080501@linux.vnet.ibm.com> Date: Fri, 11 Jan 2008 10:32:27 -0600 From: Mike Wolf User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: yaboot-devel@ozlabs.org Subject: [PATCH] use public interface to detect CAS reboots X-BeenThere: yaboot-devel@ozlabs.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: mjw@linux.vnet.ibm.com List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2008 16:32:37 -0000 The firmware field used to detect CAS reboots (ibm,fw-nbr-reboots) is really a private field that could change without warning. A new field ibm,#reconfig-reboots will be added as a public interface intended to be used for this detection. The patch will first check for ibm,#reconfig-reboots if that is not found it will see if ibm,fw-nbr-reboots is present and will use that instead. ----- diff --git a/second/yaboot.c b/second/yaboot.c index 5fc1213..b52ced6 100644 --- a/second/yaboot.c +++ b/second/yaboot.c @@ -1694,6 +1694,7 @@ yaboot_main(void) char *endp; int conf_given = 0; char conf_path[1024]; + int ret; if (_machine == _MACH_Pmac) setup_display(); @@ -1702,7 +1703,8 @@ yaboot_main(void) DEBUG_F("/chosen/bootargs = %s\n", bootargs); prom_get_chosen("bootpath", bootdevice, BOOTDEVSZ); DEBUG_F("/chosen/bootpath = %s\n", bootdevice); - prom_get_options("ibm,fw-nbr-reboots",fw_nbr_reboots, FW_NBR_REBOOTSZ); + if (prom_get_options("ibm,#reconfig-reboots",fw_nbr_reboots, FW_NBR_REBOOTSZ) == -1 ) + prom_get_options("ibm,fw-nbr-reboots",fw_nbr_reboots, FW_NBR_REBOOTSZ); fw_reboot_cnt = simple_strtol(fw_nbr_reboots,&endp,10); if (fw_reboot_cnt > 0L) prom_get_options("boot-last-label", bootlastlabel, BOOTLASTSZ);