On Fri, Aug 28, 2009 at 8:03 PM, Vladimir 'phcoder'
Serbinenko<phco...@gmail.com> wrote:
> On Thu, Aug 27, 2009 at 10:27 AM, Bean<bean12...@gmail.com> 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.

-- 
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

Reply via email to