title: ARM - How to preserve r9 register with armcc
body: <p>Reading ARM AAPCS (ARM EABI), I've found :
  <em>The role of register r9 is platform specific. A virtual platform may assign any role to this register and must document this usage. For example, it may designate it as the static base (SB) in a position-independent data model, or it may designate it as the thread register (TR) in an environment with thread-local storage. The usage of this register may require that the value held is persistent across all calls. A virtual platform that has no need for such a special register may designate r9 as an additional callee-saved variable register, v6.</em></p>
  
  <p>I'd like to use r9 as a PID holder for my specific avionics preemptible OS, but I can't figure out how to preserve it : armcc C compiler always uses it as a variable register, so its value always changes through applicative SW.</p>
  
  <p>Any idea ? Is it possible with armcc ? GCC ? DIAB ?...</p>
  
  <p>Thanks for any help.</p>
  
  <p>Regards</p>
  
  <p>Christophe</p>