linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: ps3 64-bit kernel: patched prpmc2800.c (fwd)
@ 2007-05-25  6:39 Maik Nijhuis
  2007-06-02 18:39 ` Geoff Levand
  2007-06-03  1:51 ` Paul Mackerras
  0 siblings, 2 replies; 5+ messages in thread
From: Maik Nijhuis @ 2007-05-25  6:39 UTC (permalink / raw)
  To: linuxppc-dev

I had an earlier discussion with Geoff Levand, he suggested me to post it
here.

While compiling a 64-bit kernel for the playstation 3 I noticed that
arch/powerpc/boot/prpmc2800.c doesn't compile. The assembler complains
about a constant that is too big.

When I compile prpmc2800.c this is what 'make V=1' shows:

gcc -m32 -Wp,-MD,arch/powerpc/boot/.prpmc2800.o.d -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -fno-builtin -nostdinc
-isystem /usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.2/include -fPIC
-fno-stack-protector -Iarch/powerpc/boot
-I/usr/src/ps3-linux/arch/powerpc/boot -c -o arch/powerpc/boot/prpmc2800.o
arch/powerpc/boot/prpmc2800.c

And then this error follows:

/tmp/ccYHAOD7.s: Assembler messages:
/tmp/ccYHAOD7.s:9: Error: operand out of range (0xffffffffffff7fff is not
between 0x0000000000000000 and 0x00000000ffffffff)

I managed to fix this issue as follows: At the end of
arch/powerpc/boot/prpmc2800.c, there is an assembly instruction

rlwinm  10,10,0,~(1<<15)

I replaced this by

rlwinm  10,10,0,~(1<<15) & ((1<<32)-1)

I am running 64-bit gentoo linux with binutils 2.17.50.0.16. It has been
compiled on my ps3 using gentoo ebuild scripts.

After downgrading to binutils 2.17 the problem is gone..

In the binutils bugzilla I couldn't find anything when I searched for
'operand out of range'. It seems like an assembler bug: A 64-bit value is
assumed in a 32 bit instruction, even though the assembler runs in 32 bit
mode because of the -m32. As the value is used in an 'and', the high bits
can safely be ignored.

Could you please either fix binutils or apply the above patch?

Maik

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

end of thread, other threads:[~2007-06-04  8:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-25  6:39 ps3 64-bit kernel: patched prpmc2800.c (fwd) Maik Nijhuis
2007-06-02 18:39 ` Geoff Levand
2007-06-03  1:51 ` Paul Mackerras
2007-06-03 23:25   ` Mark A. Greer
2007-06-04  8:14     ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).