[PATCH] D61226: [AArch64] Add an option to get the TLS pointer from software

Thomas Guillemard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 10:36:14 PDT 2019


Thog added a comment.

In D61226#1485627 <https://reviews.llvm.org/D61226#1485627>, @efriedma wrote:

> How did you come up with the name __aarch64_read_tp?  I guess it's okay.


That is how devkitPro's fork of GCC calls it. 
There is no standard name for it since AArch64 ABI doesn't define a soft-tp interface.

In D61226#1485627 <https://reviews.llvm.org/D61226#1485627>, @efriedma wrote:

> I don't really understand how this is different from normal ELF TLS; does the offset vary at runtime somehow?


With HardTp model, TPIDR_EL0 points to the TLS region.
With SoftTp model, the TLS region can be anywhere (the __aarch64_read_tp function is ran to find out where it is). 
Under the Horizon kernel and with devkitPro's runtime, the TLS region is at *(TPIDR_EL0 + 0x1F8).
More generally, this allows supporting non-standard TLS regions.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61226/new/

https://reviews.llvm.org/D61226





More information about the llvm-commits mailing list