1570af302Sopenharmony_cistatic inline uintptr_t __get_tp() 2570af302Sopenharmony_ci{ 3570af302Sopenharmony_ci register uintptr_t tp __asm__("r13"); 4570af302Sopenharmony_ci __asm__ ("" : "=r" (tp) ); 5570af302Sopenharmony_ci return tp; 6570af302Sopenharmony_ci} 7570af302Sopenharmony_ci 8570af302Sopenharmony_ci#define TLS_ABOVE_TP 9570af302Sopenharmony_ci#define GAP_ABOVE_TP 0 10570af302Sopenharmony_ci 11570af302Sopenharmony_ci#define TP_OFFSET 0x7000 12570af302Sopenharmony_ci#define DTP_OFFSET 0x8000 13570af302Sopenharmony_ci 14570af302Sopenharmony_ci// the kernel calls the ip "nip", it's the first saved value after the 32 15570af302Sopenharmony_ci// GPRs. 16570af302Sopenharmony_ci#define MC_PC gp_regs[32] 17