static int arm32_set_tp(struct thread *td, void *args) { #if __ARM_ARCH >= 6 set_tls(args); #else td->td_md.md_tp = (register_t)args; *(register_t *)ARM_TP_ADDRESS = (register_t)args; #endif return (0); }
static int arm32_set_tp(struct thread *td, void *args) { if (td != curthread) td->td_md.md_tp = (register_t)args; else #ifndef ARM_TP_ADDRESS set_tls(args); #else *(register_t *)ARM_TP_ADDRESS = (register_t)args; #endif return (0); }
int cpu_set_user_tls(struct thread *td, void *tls_base) { td->td_md.md_tp = (register_t)tls_base; if (td == curthread) { critical_enter(); #ifdef ARM_TP_ADDRESS *(register_t *)ARM_TP_ADDRESS = (register_t)tls_base; #else set_tls((void *)tls_base); #endif critical_exit(); } return (0); }
void OnStart() { safe_assert(pipe_ != NULL); ConcurrentPipe* concpipe = static_cast<ConcurrentPipe*>(pipe_); concpipe->RegisterShadowThread(this); // set tls data set_tls(this); // MYLOG(1) << "CLIENT: Sending ThreadStart to thread " << tid_; // // send thread start // EventBuffer event; // event.type = ThreadStart; // event.threadid = tid_; // SendRecvContinue(&event); // MYLOG(1) << "CLIENT: Received continue for ThreadStart to thread " << tid_; }
void OnEnd() { MYLOG(1) << "CLIENT: Sending ThreadEnd to thread " << tid_; // send thread end EventBuffer event; event.type = ThreadEnd; event.threadid = tid_; SendRecvContinue(&event); MYLOG(1) << "CLIENT: Received continue for ThreadEnd to thread " << tid_; // clear tls data set_tls(NULL); safe_assert(pipe_ != NULL); ConcurrentPipe* concpipe = static_cast<ConcurrentPipe*>(pipe_); concpipe->UnregisterShadowThread(this); }