lkml.org 
[lkml]   [2001]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Big-endian reading/writing cramfs (vs 2.4.10)
> On Sep 28, 2001  14:58 -0700, Brad wrote:
> > +#define CRAM_SWAB_16(x) ( ( (0x0000FF00 & (x)) >> 8 ) | \
> > + ( (0x000000FF & (x)) << 8 ) )
>
> Why not just use the well-defined le16_to_cpu() and le32_to_cpu() macros?

I did, originally... And it worked in inode.c, but I couldn't get mkcramfs
to compile using those macros. It's outside of __KERNEL__ so I tried
using __cpu_to_le32. The following error occurred:

/tmp/ccoK4KS0.o: In function `write_superblock':
mkcramfs.c(.text+0xefc): undefined reference to `__fswab32'
collect2: ld returned 1 exit status

__fswab32 is defined in include/linux/byteorder/swab.h as:

extern __inline__ __const__ __u32 __fswab32(__u32 x)
{
return __arch__swab32(x);
}

Can you shed some light on the error? I used my own macros to get around
this issue and it worked, but the defined ones would be cleaner...

Thanks,
Brad Bozarth


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:03    [W:0.047 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site