Received: from list by lists.gnu.org with archive (Exim 4.71) id 1erOv0-0003WW-0V for mharc-grub-devel@gnu.org; Thu, 01 Mar 2018 09:10:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erOux-0003UC-CM for grub-devel@gnu.org; Thu, 01 Mar 2018 09:10:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erOus-000422-LQ for grub-devel@gnu.org; Thu, 01 Mar 2018 09:10:43 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:47372) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erOus-00041i-DK for grub-devel@gnu.org; Thu, 01 Mar 2018 09:10:38 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w21E6Qrc103769; Thu, 1 Mar 2018 14:10:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=qVL51i8sj+HfrkaGU+IFV0Fu0IAysLkbXSW9Bhx4S+g=; b=PaL2IwbM3/8/+GAmZf8r+Oq6FTdBOTOT1jQZ4bPOs5+8wmIqF5XY1TxFJdUxMKAf0OMa D/tSsFr20lEfyZlrv5jZM/cYDiGXnskTzbOya9DVxY33kwYodJq4Xi9NJDOHDx5JpynM 7O8qNOVpNiGao1T5TtohhUKnbnAOpA8zrrMIcoZOkYno9VoT2HJUplNz8O+pThzuYIkO zivPCd9ZgZr1Akd022E/BHCThp/krhuBmhhQ8oXVhCgLp5vgUH/aQZ/agG2gY8efDq/V rkFc4DL5+tHKhDoA48j++D1le6RHgnNvdYjIwXFPMPcCNZ7dApDEnJTKaG6l5CAwf4/o 4Q== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2gejkrr74h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Mar 2018 14:10:37 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w21EAa8W029306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Mar 2018 14:10:36 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w21EAZd1002974; Thu, 1 Mar 2018 14:10:36 GMT Received: from olila.local.net-space.pl (/10.175.222.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Mar 2018 06:10:35 -0800 Date: Thu, 1 Mar 2018 15:10:31 +0100 From: Daniel Kiper To: Eric Snowberg Cc: grub-devel@gnu.org, glaubitz@physik.fu-berlin.de Subject: Re: [PATCH 1/7] ieee1275: decode-unit command for 4 addr cell devs Message-ID: <20180301141031.GF20614@olila.local.net-space.pl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8818 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803010179 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 14:10:44 -0000 On Mon, Feb 26, 2018 at 05:34:14PM -0800, Eric Snowberg wrote: > decode-unit ( addr len -- phys.lo ... phys.hi ) > > Convert text unit-string to physical address. > > Convert unit-string, the text string representation, to phys.lo ... phys.hi, > the numerical representation of a physical address within the address space > defined by this device node. The number of cells in the list > phys.lo ... phys.hi is determined by the value of the #address-cells > property of this node. > > This function is for devices with #address-cells == 4 > > Signed-off-by: Eric Snowberg Reviewed-by: Daniel Kiper Just one nit pick below... > --- > grub-core/kern/ieee1275/ieee1275.c | 42 ++++++++++++++++++++++++++++++++++++ > include/grub/ieee1275/ieee1275.h | 8 ++++++ > 2 files changed, 50 insertions(+), 0 deletions(-) > > diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c > index 9821702..4617b36 100644 > --- a/grub-core/kern/ieee1275/ieee1275.c > +++ b/grub-core/kern/ieee1275/ieee1275.c > @@ -483,6 +483,48 @@ grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle) > } > > int > +grub_ieee1275_decode_unit4 (grub_ieee1275_ihandle_t ihandle, > + void *addr, grub_size_t size, > + grub_uint32_t *phy_lo, grub_uint32_t *phy_hi, > + grub_uint32_t *lun_lo, grub_uint32_t *lun_hi) > +{ > + struct decode_args > + { > + struct grub_ieee1275_common_hdr common; > + grub_ieee1275_cell_t method; > + grub_ieee1275_cell_t ihandle; > + grub_ieee1275_cell_t size; > + grub_ieee1275_cell_t addr; > + grub_ieee1275_cell_t catch_result; > + grub_ieee1275_cell_t tgt_h; > + grub_ieee1275_cell_t tgt_l; > + grub_ieee1275_cell_t lun_h; > + grub_ieee1275_cell_t lun_l; > + } > + args; > + > + INIT_IEEE1275_COMMON (&args.common, "call-method", 4, 5); > + args.method = (grub_ieee1275_cell_t) "decode-unit"; > + args.ihandle = ihandle; > + args.size = size; > + args.addr = (grub_ieee1275_cell_t) addr; > + args.catch_result = 1; > + > + if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.catch_result)) > + { > + grub_error (GRUB_ERR_OUT_OF_RANGE, "decode-unit failed\n"); > + return -1; > + } > + > + *phy_lo = args.tgt_l; > + *phy_hi = args.tgt_h; > + *lun_lo = args.lun_l; > + *lun_hi = args.lun_h; > + return 0; > +} > + > + > +int > grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align, > grub_addr_t *result) > { > diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h > index 8e42513..b1940c2 100644 > --- a/include/grub/ieee1275/ieee1275.h > +++ b/include/grub/ieee1275/ieee1275.h > @@ -211,6 +211,14 @@ int EXPORT_FUNC(grub_ieee1275_set_color) (grub_ieee1275_ihandle_t ihandle, > int index, int r, int g, int b); > int EXPORT_FUNC(grub_ieee1275_milliseconds) (grub_uint32_t *msecs); > > +int EXPORT_FUNC(grub_ieee1275_decode_unit4) (grub_ieee1275_ihandle_t ihandle, > + void *addr, grub_size_t size, > + grub_uint32_t *phy_lo, > + grub_uint32_t *phy_hi, > + grub_uint32_t *lun_lo, > + grub_uint32_t *lun_hi); > + > + Too many empty lines. I will fix this during commit. Daniel