[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Detect endian in cpio fs

From: Vladimir 'phcoder' Serbinenko
Subject: Re: [PATCH] Detect endian in cpio fs
Date: Fri, 28 Aug 2009 14:27:52 +0200

On Fri, Aug 28, 2009 at 2:20 PM, Bean<address@hidden> wrote:
> On Fri, Aug 28, 2009 at 8:03 PM, Vladimir 'phcoder'
> Serbinenko<address@hidden> wrote:
>> On Thu, Aug 27, 2009 at 10:27 AM, Bean<address@hidden> 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:
> my fork page:
> _______________________________________________
> Grub-devel mailing list
> address@hidden

Vladimir 'phcoder' Serbinenko

Personal git repository:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]