diff options
Diffstat (limited to 'Documentation/prctl/disable-tsc-test.c')
-rw-r--r-- | Documentation/prctl/disable-tsc-test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/prctl/disable-tsc-test.c b/Documentation/prctl/disable-tsc-test.c index 843c81eac235..2541e65cb64b 100644 --- a/Documentation/prctl/disable-tsc-test.c +++ b/Documentation/prctl/disable-tsc-test.c | |||
@@ -29,14 +29,15 @@ const char *tsc_names[] = | |||
29 | [PR_TSC_SIGSEGV] = "PR_TSC_SIGSEGV", | 29 | [PR_TSC_SIGSEGV] = "PR_TSC_SIGSEGV", |
30 | }; | 30 | }; |
31 | 31 | ||
32 | uint64_t rdtsc() { | 32 | static uint64_t rdtsc(void) |
33 | { | ||
33 | uint32_t lo, hi; | 34 | uint32_t lo, hi; |
34 | /* We cannot use "=A", since this would use %rax on x86_64 */ | 35 | /* We cannot use "=A", since this would use %rax on x86_64 */ |
35 | __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); | 36 | __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); |
36 | return (uint64_t)hi << 32 | lo; | 37 | return (uint64_t)hi << 32 | lo; |
37 | } | 38 | } |
38 | 39 | ||
39 | void sigsegv_cb(int sig) | 40 | static void sigsegv_cb(int sig) |
40 | { | 41 | { |
41 | int tsc_val = 0; | 42 | int tsc_val = 0; |
42 | 43 | ||