summaryrefslogtreecommitdiff
path: root/include/arch/x86_64/asm/vdso.h
blob: 2fb344736623bfec174217f8f3e1c9ff5b05ae7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __ASM_VDSO_H
#define __ASM_VDSO_H

/*
 * vDSO support interface.
 *
 * IMPORTANT:
 * Do not define storage in this header. This header is included by multiple
 * translation units; defining `static` variables here causes each TU to get its
 * own copy, which makes initialization inconsistent and prevents dead-stripping.
 *
 * The actual storage/definitions must live in a single .c file (e.g.
 * `lib/libc/internal/init/vdso.c`), and this header should only declare them.
 */

struct timespec;

#define __VDSO_CLOCK_GETTIME
#define __VDSO_GETCPU
#define __VDSO_TIME

/* Resolved vDSO entry points (set by __init_vdso). */
extern int (*__vdso_clock_gettime)(int, struct timespec *);
extern int (*__vdso_getcpu)(unsigned *, unsigned *, void *);
extern int (*__vdso_time)(long *);

/* Symbol table used by __init_vdso to locate vDSO functions. */
struct __vdso_sym {
	const char *name;
	void *func;
};

extern struct __vdso_sym __vdso_symtab[];

#endif