/* * Core checks for mode already, so this raced against a concurrent * update. Return something. Core will do another round and then * see the mode change and fallback to the syscall.
*/ if (clock_mode != VDSO_CLOCKMODE_ARCHTIMER) return 0;
/* * This isb() is required to prevent that the counter value * is speculated.
*/
isb(); asmvolatile("mrrc p15, 1, %Q0, %R0, c14" : "=r" (res)); /* * This isb() is required to prevent that the seq lock is * speculated.
*/
isb();
/* * This simply puts &_vdso_time_data into ret. The reason why we don't use * `ret = _vdso_time_data` is that the compiler tends to optimise this in a * very suboptimal way: instead of keeping &_vdso_time_data in a register, * it goes through a relocation almost every time _vdso_time_data must be * accessed (even in subfunctions). This is both time and space * consuming: each relocation uses a word in the code section, and it * has to be loaded at runtime. * * This trick hides the assignment from the compiler. Since it cannot * track where the pointer comes from, it will only use one relocation * where __aarch64_get_vdso_u_time_data() is called, and then keep the * result in a register.
*/ asmvolatile("mov %0, %1" : "=r"(ret) : "r"(&vdso_u_time_data));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.