Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mh0Yz-0001ZR-TJ for mharc-grub-devel@gnu.org; Fri, 28 Aug 2009 08:28:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mh0Yr-0001Vl-TA for grub-devel@gnu.org; Fri, 28 Aug 2009 08:28:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mh0Ym-0001TA-FC for grub-devel@gnu.org; Fri, 28 Aug 2009 08:28:08 -0400 Received: from [199.232.76.173] (port=55996 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mh0Yl-0001Sr-Tl for grub-devel@gnu.org; Fri, 28 Aug 2009 08:28:03 -0400 Received: from mail-bw0-f222.google.com ([209.85.218.222]:33474) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mh0Yl-0008BP-8U for grub-devel@gnu.org; Fri, 28 Aug 2009 08:28:03 -0400 Received: by bwz22 with SMTP id 22so1850794bwz.42 for ; Fri, 28 Aug 2009 05:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=QXLG+r9pbdJJ0OOJP7H5RGMnuKJjGJhfe1xAXK2H/oA=; b=MfozCKPZHkWMNSsC0zoEnmUKjuHyAlFgs7MT8BX7ZQFWQnEK9qiZF3LFXmxYxw1mKp Rgv0GgOg9vsmZqQbzeNELteMA+DH3f6Lom/Yx15d+AUJgOJoukhOv6+v0lZBgVvYkhnb Fr+EjqHBCCu59+o2euOc85jPXkJAsYO58oA8U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hjV9ugzFfb5hUIkVigxzs9qrne0ptDqMkFqyiorc3+4TS2IYvDgMDIilnDln6VfzuN wnNwxi2sK2r9I4jVDwZbyD5IVc8EKaSVuNpgo4H5+btg3FUvfvTCWmSn04D4SAyG6iDL Rln1eQ6NUGBLSHSL18oIXjIWf4i2SMou6L8L8= MIME-Version: 1.0 Received: by 10.204.10.140 with SMTP id p12mr895409bkp.76.1251462472498; Fri, 28 Aug 2009 05:27:52 -0700 (PDT) In-Reply-To: References: Date: Fri, 28 Aug 2009 14:27:52 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] Detect endian in cpio fs X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2009 12:28:12 -0000 On Fri, Aug 28, 2009 at 2:20 PM, Bean wrote: > On Fri, Aug 28, 2009 at 8:03 PM, Vladimir 'phcoder' > Serbinenko wrote: >> On Thu, Aug 27, 2009 at 10:27 AM, Bean wrote: >>> Hi, >>> >>> This patch allows to access big/little endian cpio archive from >>> big/little endian machine. >> Quick glance showed that you use swap_bytes. Could you use >> grub_*_to_cpu* instead? This would simplify the future maintainability >> if someone decides to port to a very special platform (e.g. >> mixed-endian) since code would be uniform > > Hi, > > Actually it's not correct to use grub_*_to_cpu*. The code works by > first assuming cpio uses the same endian of host cpu, if not, swap it > and try the other endian. This method works for big/little endian cpio > on big/little endian machine. It's possible to achieve the same result > with a combination of #ifdef and grub_*_to_cpu*'s, but it's not as > simple as this and generate more code than necessary. > Why is it more expensive than first try le and then be? What about having 2 modules cpio_le and cpio_be? > -- > Bean > > gitgrub home: http://github.com/grub/grub/ > my fork page: http://github.com/bean123/grub/ > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > -- Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git