Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: Pete Popov <ppopov@mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-mips <linux-mips@oss.sgi.com>
Subject: Re: reiserfs
Date: Mon, 29 Apr 2002 10:35:54 -0700	[thread overview]
Message-ID: <3CCD847A.8050905@mvista.com> (raw)
In-Reply-To: 1019937954.1260.22.camel@localhost.localdomain

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

Pete Popov wrote:

> On Sat, 2002-04-27 at 13:19, Alan Cox wrote:
> 
>>>Has anyone been able to run reiserfs on big endian systems?
>>>
>>Should work on newer 2.4 kernels
>>
> 
> Yes, it does. I sent an email yesterday explaining what the problem
> was.  The 2.95.3 toolchain is miscompiling the cpu_to_le16 and
> le16_to_cpu functions. The problem appears to be fixed in 2.96 and 3.x
> so reiserfs is looking good for both, LE and BE mips systems.
> 


Here is the test case that reveals the toolchain problem.  Brave souls are 
welcome to look into it.

Apparently the bug only happens on be tools with 2.95.x.

Jun



[-- Attachment #2: gcc-2.95-le16-to-cpu.bug.c --]
[-- Type: text/plain, Size: 1217 bytes --]

#if 0

compile instructions:

/opt/hardhat/devkit/mips/fp_be/bin/mips_fp_be-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -g -G 0 -mno-abicalls -fno-pic -mcpu=r4600 -mips2 -Wa,--trap -pipe    -c -o try.o try.c

#endif

typedef	unsigned short __u16;
typedef	unsigned __u32;

#define ___swab16_new(x) \
({ \
        __u32 __x = (x); \
        __x = ((__u32)( \
                ((__u32)(__x) << 8) | \
                (((__u32)(__x) & (__u16)0xff00U) >> 8) )); \
        (__u16)(__x & 0xffff); \
})

#define ___swab16(x) \
({ \
        __u16 __x = (x); \
        ((__u16)( \
                (((__u16)(__x) & (__u16)0x00ffU) << 8) | \
                (((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
})

#  define __swab16(x) \
(__builtin_constant_p((__u16)(x)) ? \
  ___swab16((x)) : \
   __fswab16((x)))

#ifndef __arch__swab16
#  define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
#endif

static __inline__ __const__ __u16 __fswab16(__u16 x)
{
	        return __arch__swab16(x);
}

#define __le16_to_cpu(x) __swab16((x))
#define le16_to_cpu __le16_to_cpu

extern __u16 x;
extern __u16 y;

void foo_old(void)
{
	if (le16_to_cpu(x) > y) 
		y = x;
}

  reply	other threads:[~2002-04-29 17:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-24 23:13 reiserfs Pete Popov
2002-04-25  7:51 ` reiserfs Ralf Baechle
2002-04-25  8:11   ` reiserfs Geert Uytterhoeven
2002-04-25 16:08     ` reiserfs Pete Popov
2002-04-25 16:17     ` reiserfs George Gensure
2002-04-26 18:34     ` reiserfs Pete Popov
2002-04-27 20:19 ` reiserfs Alan Cox
2002-04-27 20:05   ` reiserfs Pete Popov
2002-04-29 17:35     ` Jun Sun [this message]
2002-04-30  1:04       ` reiserfs Hiroyuki Machida
2002-04-27 20:19   ` reiserfs Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CCD847A.8050905@mvista.com \
    --to=jsun@mvista.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-mips@oss.sgi.com \
    --cc=ppopov@mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox