From 03a084364dbd85403313ecd8e07ad2eba7e1f6e8 Mon Sep 17 00:00:00 2001 From: Erik Bosman Date: Fri, 11 Apr 2008 18:54:17 +0200 Subject: [PATCH] --- yaml --- r: 90981 b: refs/heads/master c: 8fb402bccf203ecca8f9e0202b8fd3c937dece6f h: refs/heads/master i: 90979: cb6fb4e2c1ab8ed88c237883d5d716a8c3e01667 v: v3 --- [refs] | 2 +- trunk/include/linux/prctl.h | 6 ++++++ trunk/kernel/sys.c | 13 ++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index fb08ee9a1515..a3bd33b37030 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5deb45e39b946901ae028ccd3a1d0b35fa387475 +refs/heads/master: 8fb402bccf203ecca8f9e0202b8fd3c937dece6f diff --git a/trunk/include/linux/prctl.h b/trunk/include/linux/prctl.h index 3800639775ae..5c80b1939636 100644 --- a/trunk/include/linux/prctl.h +++ b/trunk/include/linux/prctl.h @@ -67,4 +67,10 @@ #define PR_CAPBSET_READ 23 #define PR_CAPBSET_DROP 24 +/* Get/set the process' ability to use the timestamp counter instruction */ +#define PR_GET_TSC 25 +#define PR_SET_TSC 26 +# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */ +# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */ + #endif /* _LINUX_PRCTL_H */ diff --git a/trunk/kernel/sys.c b/trunk/kernel/sys.c index a626116af5db..6a0cc71ee88d 100644 --- a/trunk/kernel/sys.c +++ b/trunk/kernel/sys.c @@ -67,6 +67,12 @@ #ifndef SET_ENDIAN # define SET_ENDIAN(a,b) (-EINVAL) #endif +#ifndef GET_TSC_CTL +# define GET_TSC_CTL(a) (-EINVAL) +#endif +#ifndef SET_TSC_CTL +# define SET_TSC_CTL(a) (-EINVAL) +#endif /* * this is where the system-wide overflow UID and GID are defined, for @@ -1737,7 +1743,12 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, #else return -EINVAL; #endif - + case PR_GET_TSC: + error = GET_TSC_CTL(arg2); + break; + case PR_SET_TSC: + error = SET_TSC_CTL(arg2); + break; default: error = -EINVAL; break;