Linux MIPS Architecture development
 help / color / mirror / Atom feed
* problem about the tool chain for R3000
@ 2007-08-29 23:09 guo guo
  2007-08-29 23:51 ` David Daney
  0 siblings, 1 reply; 4+ messages in thread
From: guo guo @ 2007-08-29 23:09 UTC (permalink / raw)
  To: linux-mips

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 592 bytes --]

Dear All,

I'm trying to build tool chain with gcc4.2, binutils2.17 and glibc2.5
for mips r3000 chip.
During configure gcc I add ¨Cmabi=32 ¨Cmarch=r3000 ¨Cmtune=r3000. and
during building glibc, I add CFLAGS= -O2 ¨Cmabi=32 ¨Cmarch=r3000
¨Cmtune=r3000,
Then I dissembled the libc-2.5.90.so to check the instructions. I
found it has two instructions rdhwr(0x7c03e83b) and sync(0x0000000f)
that don't belongs to mips r3000.
I see some engineers use kernel to trap rdhwr but it may cost to more
resource.
Can it avoid there two instructions by special configuration or patch?

Best regards,
Tony

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

* Re: problem about the tool chain for R3000
  2007-08-29 23:09 problem about the tool chain for R3000 guo guo
@ 2007-08-29 23:51 ` David Daney
  2007-08-30  1:08   ` guo guo
  0 siblings, 1 reply; 4+ messages in thread
From: David Daney @ 2007-08-29 23:51 UTC (permalink / raw)
  To: guo guo; +Cc: linux-mips

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 956 bytes --]

guo guo wrote:
> Dear All,
> 
> I'm trying to build tool chain with gcc4.2, binutils2.17 and glibc2.5
> for mips r3000 chip.
> During configure gcc I add ¨Cmabi=32 ¨Cmarch=r3000 ¨Cmtune=r3000. and
> during building glibc, I add CFLAGS= -O2 ¨Cmabi=32 ¨Cmarch=r3000
> ¨Cmtune=r3000,
> Then I dissembled the libc-2.5.90.so to check the instructions. I
> found it has two instructions rdhwr(0x7c03e83b) and sync(0x0000000f)
> that don't belongs to mips r3000.

The rdhwr and sync are used by the NPTL pthread library and must be
emulated by the linux kernel.  Probably you will see ll and sc in there
as well.  If you use glibc2.3.x with Linux threads then the rdhwr will
not be generated.

 Probably if you did not use libpthread you would not need any of the
thread synchronization primitives that cause ll,sc, and sync to be
generated.

But if you want libpthread and your CPU does not support the
instructions, you will have to emulate them.


David Daney

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

* Re: problem about the tool chain for R3000
  2007-08-29 23:51 ` David Daney
@ 2007-08-30  1:08   ` guo guo
  2007-08-30 16:06     ` David Daney
  0 siblings, 1 reply; 4+ messages in thread
From: guo guo @ 2007-08-30  1:08 UTC (permalink / raw)
  To: David Daney; +Cc: linux-mips

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 1379 bytes --]

Dear Daney,
Thank you very much.
Under nptl directory, there are 6 places use rdhwr instruction. What's
difference between rdhwr and move instructions?
Could I use move or other r3000 instructions to replace rdhwr?

And I didn't find ll/sc instructions in libc-2.5.90.so. maybe gcc
avoid them for R3000 chip.

Best regards,
Tony


2007/8/29, David Daney <ddaney@avtrex.com>:
> guo guo wrote:
> > Dear All,
> >
> > I'm trying to build tool chain with gcc4.2, binutils2.17 and glibc2.5
> > for mips r3000 chip.
> > During configure gcc I add ¨Cmabi=32 ¨Cmarch=r3000 ¨Cmtune=r3000. and
> > during building glibc, I add CFLAGS= -O2 ¨Cmabi=32 ¨Cmarch=r3000
> > ¨Cmtune=r3000,
> > Then I dissembled the libc-2.5.90.so to check the instructions. I
> > found it has two instructions rdhwr(0x7c03e83b) and sync(0x0000000f)
> > that don't belongs to mips r3000.
>
> The rdhwr and sync are used by the NPTL pthread library and must be
> emulated by the linux kernel.  Probably you will see ll and sc in there
> as well.  If you use glibc2.3.x with Linux threads then the rdhwr will
> not be generated.
>
>  Probably if you did not use libpthread you would not need any of the
> thread synchronization primitives that cause ll,sc, and sync to be
> generated.
>
> But if you want libpthread and your CPU does not support the
> instructions, you will have to emulate them.
>
>
> David Daney
>

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

* Re: problem about the tool chain for R3000
  2007-08-30  1:08   ` guo guo
@ 2007-08-30 16:06     ` David Daney
  0 siblings, 0 replies; 4+ messages in thread
From: David Daney @ 2007-08-30 16:06 UTC (permalink / raw)
  To: guo guo; +Cc: linux-mips

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 1669 bytes --]

guo guo wrote:
> Dear Daney,
> Thank you very much.
> Under nptl directory, there are 6 places use rdhwr instruction. What's
> difference between rdhwr and move instructions?
> Could I use move or other r3000 instructions to replace rdhwr?

No.  The register that rdhwr is reading is not implemented on any
current processor.  It is always emulated by the kernel.  You cannot
remove it as it performs the critical function of loading the pointer to
the thread local area.

> 
> And I didn't find ll/sc instructions in libc-2.5.90.so. maybe gcc
> avoid them for R3000 chip.
> 
> Best regards,
> Tony
> 
> 
> 2007/8/29, David Daney <ddaney@avtrex.com>:
>> guo guo wrote:
>>> Dear All,
>>>
>>> I'm trying to build tool chain with gcc4.2, binutils2.17 and glibc2.5
>>> for mips r3000 chip.
>>> During configure gcc I add ¨Cmabi=32 ¨Cmarch=r3000 ¨Cmtune=r3000. and
>>> during building glibc, I add CFLAGS= -O2 ¨Cmabi=32 ¨Cmarch=r3000
>>> ¨Cmtune=r3000,
>>> Then I dissembled the libc-2.5.90.so to check the instructions. I
>>> found it has two instructions rdhwr(0x7c03e83b) and sync(0x0000000f)
>>> that don't belongs to mips r3000.
>> The rdhwr and sync are used by the NPTL pthread library and must be
>> emulated by the linux kernel.  Probably you will see ll and sc in there
>> as well.  If you use glibc2.3.x with Linux threads then the rdhwr will
>> not be generated.
>>
>>  Probably if you did not use libpthread you would not need any of the
>> thread synchronization primitives that cause ll,sc, and sync to be
>> generated.
>>
>> But if you want libpthread and your CPU does not support the
>> instructions, you will have to emulate them.
>>
>>
>> David Daney
>>

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

end of thread, other threads:[~2007-08-30 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 23:09 problem about the tool chain for R3000 guo guo
2007-08-29 23:51 ` David Daney
2007-08-30  1:08   ` guo guo
2007-08-30 16:06     ` David Daney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox