struct elfinfo {
Elf32_Ehdr *hdr; /* ptr to ELF */
Elf32_Sym *dynsym; /* ptr to .dynsym section */ unsignedlong dynsymsize; /* size of .dynsym section */ char *dynstr; /* ptr to .dynstr section */
};
/* Cached result of boot-time check for whether the arch timer exists, * and if so, whether the virtual counter is useable.
*/ bool cntvct_ok __ro_after_init;
/* The arm_arch_timer core should export * arch_timer_use_virtual or similar so we don't have to do * this.
*/
np = of_find_compatible_node(NULL, NULL, "arm,armv7-timer"); if (!np)
np = of_find_compatible_node(NULL, NULL, "arm,armv8-timer"); if (!np) goto out_put;
if (of_property_read_bool(np, "arm,cpu-registers-not-fw-configured")) goto out_put;
/* Grab section headers and strings so we can tell who is who */
sechdrs = (void *)ehdr + ehdr->e_shoff;
secnames = (void *)ehdr + sechdrs[ehdr->e_shstrndx].sh_offset;
/* Find the section they want */ for (i = 1; i < ehdr->e_shnum; i++) { if (strcmp(secnames + sechdrs[i].sh_name, name) == 0) { if (size)
*size = sechdrs[i].sh_size; return (void *)ehdr + sechdrs[i].sh_offset;
}
}
/* If the virtual counter is absent or non-functional we don't * want programs to incur the slight additional overhead of * dispatching through the VDSO only to fall back to syscalls.
*/ if (!cntvct_ok) {
vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");
vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");
vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64");
}
}
staticint __init vdso_init(void)
{ unsignedint text_pages; int i;
if (memcmp(vdso_start, "\177ELF", 4)) {
pr_err("VDSO is not a valid ELF object!\n"); return -ENOEXEC;
}
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.