I am trying to use Thread Local Storage, understand the usage on riscv
Questions :I was not sure what should $tp (thread pointer) be assigned to ?How to find out the start of thread control block area ?
You may find example in riscv-test.
To init tp and sp, https://github.com/riscv/riscv-tests/blob/master/benchmarks/common/crt.S#L119
To copy tls data for each hart: https://github.com/riscv/riscv-tests/blob/master/benchmarks/common/syscalls.c#L96
From: Jim Wilson <ji...@sifive.com>
Sent: 2021年7月7日 7:12
To: Anitha Quest <anitha....@gmail.com>
Cc: RISC-V SW Dev <sw-...@groups.riscv.org>
Subject: Re: [sw-dev] Using Thread Local Storage on riscv
|
External email: Use caution opening links or attachments |
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit
https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAFyWVaZsWt8Cc8_E2NsPbJXoPwN9XZYkDQUnPTRrSK26Zun-gQ%40mail.gmail.com.
Of different TLS models mentioned - https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#thread-local-storageLocal Exec , Initial Exec ..., what is the default TLS model when no compiler flag is specified ? i am guessing its Local Exec as i using static linking ?
When you said "global exec" did you actually mean "global dynamic"?