risc-v

Definition

tp ( RISC-V)

tp is the RISC-V integer register x4, designated as the thread pointer. It holds a per-thread base address that provides access to thread-local storage (TLS) and thread-specific data.

The value of tp is typically set by the operating system during thread creation to point to a thread-local data block unique to each execution context. This enables efficient access to thread-local variables without the overhead of explicit base address calculation or lookup.