MCPcopy Create free account
hub / github.com/F-Stack/f-stack / timehands_update32

Function timehands_update32

freebsd/kern/kern_sharedpage.c:178–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176
177#ifdef COMPAT_FREEBSD32
178static void
179timehands_update32(struct vdso_sv_tk *svtk)
180{
181 struct vdso_timehands32 th;
182 struct vdso_timekeep32 *tk;
183 uint32_t enabled, idx;
184
185 enabled = tc_fill_vdso_timehands32(&th);
186 th.th_gen = 0;
187 idx = svtk->sv_timekeep_curr;
188 if (++idx >= VDSO_TH_NUM)
189 idx = 0;
190 svtk->sv_timekeep_curr = idx;
191 if (++svtk->sv_timekeep_gen == 0)
192 svtk->sv_timekeep_gen = 1;
193
194 tk = (struct vdso_timekeep32 *)(shared_page_mapping +
195 svtk->sv_timekeep_off);
196 tk->tk_th[idx].th_gen = 0;
197 atomic_thread_fence_rel();
198 if (enabled)
199 tk->tk_th[idx] = th;
200 atomic_store_rel_32(&tk->tk_th[idx].th_gen, svtk->sv_timekeep_gen);
201 atomic_store_rel_32(&tk->tk_current, idx);
202 tk->tk_enabled = enabled;
203}
204#endif
205
206/*

Callers 1

timekeep_push_vdsoFunction · 0.85

Calls 3

tc_fill_vdso_timehands32Function · 0.85
atomic_store_rel_32Function · 0.85
atomic_thread_fence_relFunction · 0.50

Tested by

no test coverage detected