boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

pthread_arch.h (498B)


      1 /* tcc-build riscv64 pthread_arch.h replacement.
      2  *
      3  * Stock musl reads the thread pointer via inline asm with output
      4  * operand: `__asm__ ("mv %0, tp" : "=r"(tp))`. tcc 0.9.26's riscv64
      5  * frontend has no inline-asm operand-substitution path, so route
      6  * through extern __get_tp implemented in
      7  * src/internal/riscv64/get_tp.s. Mirrors the aarch64 override.
      8  */
      9 
     10 extern unsigned long __get_tp(void);
     11 
     12 #define TLS_ABOVE_TP
     13 #define GAP_ABOVE_TP 0
     14 
     15 #define DTP_OFFSET 0x800
     16 
     17 #define MC_PC __gregs[0]