All of lore.kernel.org
 help / color / mirror / Atom feed
* Bit operations work differently on MIPS and IA32
@ 2006-07-20 16:02 ` hemanth.venkatesh
  0 siblings, 0 replies; 6+ messages in thread
From: hemanth.venkatesh @ 2006-07-20 16:02 UTC (permalink / raw)
  To: linux-mips

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

Hi All,

 

I ran the below program on an IA32 and AU1100 machine, both being little
endian machines and got different results. Does anyone know what could
be the cause of this behaviour. This problem is blocking us from booting
the cramfs rootfs.

 

#include <stdio.h>

typedef unsigned int u32;

main()

{

struct tmp{

u32 namelen:6,offset:26;

}tmp1;

 

(*(int *)(&tmp1))=0x4c0;

 

printf("%d %d\n",tmp1.namelen,tmp1.offset);

 

}

 

Results on IA32 : 0 19

 

Results on AU1100 (MIPS):  0 1216

 

Thanks

hemanth


[-- Attachment #2: Type: text/html, Size: 4554 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-07-21  6:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-20 16:02 Bit operations work differently on MIPS and IA32 hemanth.venkatesh
2006-07-20 16:02 ` hemanth.venkatesh
2006-07-20 16:18 ` Thiemo Seufer
2006-07-20 17:45 ` Jonathan Day
2006-07-21  6:51   ` hemanth.venkatesh
2006-07-21  6:51     ` hemanth.venkatesh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.