This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PA-RISC: Reserving a "thread context" register.

Matt Thomas <matt at 3am-software dot com> wrote:

> As NetBSD is finishing off work on a toolchain for hppa platform
> using the Linux ELF PA-RISC support as a base, someone suggested
> that  it might be worth reserving a register for a thread context.
> If we did so, what would be the best register to use?  Is there a
> better method to do what we want?

I implemented a dedicated register for thread context and trhead local
data as well, for the PowerPC architecture using the EABI specification
(linker sections .sdata2 and .sbss2), both in the ABCD Proto-Kernel(TM)
(soon to be released) with GCC cross-tools and its ancestor using
proprietary compilers.

I don't know if there is a better method than a dedicated register, and
investigation of the newlib version 10.x source code (looking for
library function reentrancy sloutions) didn't convince me to use any
other scheme.

In implementation with the GNU GCC, I had to patch the compiler (which
applied the -G parameter inconditionnally to variables declared with the
__attribute__((section (".sdata2"))), seemingly with good reasons if
optimization alone is driving the small data section usage). In any
event, I much appreciate the free software compiler that allows me to
have fine control of such implementation details.

So, overall, using a dedicated register for thread context and trhead
local data worked well in these two embedded kernel implementations.



- Thierry Moreau

CONNOTECH Experts-conseils inc.
9130 Place de Montgolfier
Montreal, Qc
H2M 2A1

Tel.: (514)385-5691
Fax:  (514)385-5900


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]