diff options
author | Erik Bosman <ebn310@few.vu.nl> | 2008-04-11 12:54:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:19:55 -0400 |
commit | 8fb402bccf203ecca8f9e0202b8fd3c937dece6f (patch) | |
tree | 4f102f9cc81dedbf9271f728a4b1e6e731a6a174 /kernel/sys.c | |
parent | 5deb45e39b946901ae028ccd3a1d0b35fa387475 (diff) |
generic, x86: add prctl commands PR_GET_TSC and PR_SET_TSC
This patch adds prctl commands that make it possible
to deny the execution of timestamp counters in userspace.
If this is not implemented on a specific architecture,
prctl will return -EINVAL.
ned-off-by: Erik Bosman <ejbosman@cs.vu.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index a626116af5db..6a0cc71ee88d 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -67,6 +67,12 @@ | |||
67 | #ifndef SET_ENDIAN | 67 | #ifndef SET_ENDIAN |
68 | # define SET_ENDIAN(a,b) (-EINVAL) | 68 | # define SET_ENDIAN(a,b) (-EINVAL) |
69 | #endif | 69 | #endif |
70 | #ifndef GET_TSC_CTL | ||
71 | # define GET_TSC_CTL(a) (-EINVAL) | ||
72 | #endif | ||
73 | #ifndef SET_TSC_CTL | ||
74 | # define SET_TSC_CTL(a) (-EINVAL) | ||
75 | #endif | ||
70 | 76 | ||
71 | /* | 77 | /* |
72 | * this is where the system-wide overflow UID and GID are defined, for | 78 | * 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, | |||
1737 | #else | 1743 | #else |
1738 | return -EINVAL; | 1744 | return -EINVAL; |
1739 | #endif | 1745 | #endif |
1740 | 1746 | case PR_GET_TSC: | |
1747 | error = GET_TSC_CTL(arg2); | ||
1748 | break; | ||
1749 | case PR_SET_TSC: | ||
1750 | error = SET_TSC_CTL(arg2); | ||
1751 | break; | ||
1741 | default: | 1752 | default: |
1742 | error = -EINVAL; | 1753 | error = -EINVAL; |
1743 | break; | 1754 | break; |