aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/prctl/disable-tsc-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/prctl/disable-tsc-test.c')
-rw-r--r--Documentation/prctl/disable-tsc-test.c5
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
32uint64_t rdtsc() { 32static uint64_t rdtsc(void)
33{
33uint32_t lo, hi; 34uint32_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));
36return (uint64_t)hi << 32 | lo; 37return (uint64_t)hi << 32 | lo;
37} 38}
38 39
39void sigsegv_cb(int sig) 40static void sigsegv_cb(int sig)
40{ 41{
41 int tsc_val = 0; 42 int tsc_val = 0;
42 43