Subject: Re: ath hal and reserved register r23
To: Paul Koning <pkoning@equallogic.com>
From: Stephen M. Rumble <stephen.rumble@utoronto.ca>
List: port-mips
Date: 07/24/2007 17:36:04
Quoting Paul Koning <pkoning@equallogic.com>:

>>>>>> "Stephen" == Stephen M Rumble <stephen.rumble@utoronto.ca> writes:
>
>  Stephen> Quoting David Young <dyoung@pobox.com>:
>  >> Apparently the changes from the yamt-idlelwp branch reserve MIPS
>  >> register r23 for curlwp for a kernel size/(speed?) benefit.  The
>  >> Atheros HAL, which we do not have the liberty to recompile, uses
>  >> r23 for its own purposes, which clash with the kernel's.
>  >> Consequently, one cannot use ath(4) on a MIPS box running
>  >> -current.
>  >>
>  >> Is it possible either to use some other register, or to make the
>  >> use of r23 for curlwp a compile-time option, so that development
>  >> in -current on MIPS boxen such as the Meraki Mini[1] can continue?
>
>  Stephen> Isn't the reservation of r23 just a single GCC flag? Since
>  Stephen> Sam builds the HALs for a bunch of platforms anyhow, maybe
>  Stephen> if it's not complicated he'd be willing to add one more
>  Stephen> image to his builds.
>
> r23 is s7, and that has been a "preserved across function calls"
> register in the standard MIPS ABI forever.  I can't think of any
> switch to GCC to treat it differently.  (I'm sure it could be done
> with a change to the code generator, probably a fairly easy one, but I
> wouldn't expect it to be a feature of any standard compiler.)

I think it's just '-ffixed-23'.

> I suppose it would be possible to hack code, or hack the compiler, to
> accommodate someone who is violating this ABI, but if they are so
> badly confused, what else did they get wrong?  Wouldn't it make more
> sense to say "hey, go fix your broken code"?

Since we control (most of) the kernel, we don't really have to follow  
any ABI, no?

Steve