| .. | .. |
|---|
| 21 | 21 | #include <limits.h> |
|---|
| 22 | 22 | #include <elf.h> |
|---|
| 23 | 23 | |
|---|
| 24 | | -/* |
|---|
| 25 | | - * To use this vDSO parser, first call one of the vdso_init_* functions. |
|---|
| 26 | | - * If you've already parsed auxv, then pass the value of AT_SYSINFO_EHDR |
|---|
| 27 | | - * to vdso_init_from_sysinfo_ehdr. Otherwise pass auxv to vdso_init_from_auxv. |
|---|
| 28 | | - * Then call vdso_sym for each symbol you want. For example, to look up |
|---|
| 29 | | - * gettimeofday on x86_64, use: |
|---|
| 30 | | - * |
|---|
| 31 | | - * <some pointer> = vdso_sym("LINUX_2.6", "gettimeofday"); |
|---|
| 32 | | - * or |
|---|
| 33 | | - * <some pointer> = vdso_sym("LINUX_2.6", "__vdso_gettimeofday"); |
|---|
| 34 | | - * |
|---|
| 35 | | - * vdso_sym will return 0 if the symbol doesn't exist or if the init function |
|---|
| 36 | | - * failed or was not called. vdso_sym is a little slow, so its return value |
|---|
| 37 | | - * should be cached. |
|---|
| 38 | | - * |
|---|
| 39 | | - * vdso_sym is threadsafe; the init functions are not. |
|---|
| 40 | | - * |
|---|
| 41 | | - * These are the prototypes: |
|---|
| 42 | | - */ |
|---|
| 43 | | -extern void vdso_init_from_auxv(void *auxv); |
|---|
| 44 | | -extern void vdso_init_from_sysinfo_ehdr(uintptr_t base); |
|---|
| 45 | | -extern void *vdso_sym(const char *version, const char *name); |
|---|
| 46 | | - |
|---|
| 24 | +#include "parse_vdso.h" |
|---|
| 47 | 25 | |
|---|
| 48 | 26 | /* And here's the code. */ |
|---|
| 49 | 27 | #ifndef ELF_BITS |
|---|