linux/Documentation/prctl/disable-tsc-test.c
<<
>>
Prefs
   1/*
   2 * Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
   3 *
   4 * Basic test to test behaviour of PR_GET_TSC and PR_SET_TSC
   5 */
   6
   7#include <stdio.h>
   8#include <stdlib.h>
   9#include <unistd.h>
  10#include <signal.h>
  11#include <inttypes.h>
  12
  13
  14#include <sys/prctl.h>
  15#include <linux/prctl.h>
  16
  17/* Get/set the process' ability to use the timestamp counter instruction */
  18#ifndef PR_GET_TSC
  19#define PR_GET_TSC 25
  20#define PR_SET_TSC 26
  21# define PR_TSC_ENABLE          1   /* allow the use of the timestamp counter */
  22# define PR_TSC_SIGSEGV         2   /* throw a SIGSEGV instead of reading the TSC */
  23#endif
  24
  25const char *tsc_names[] =
  26{
  27        [0hreput t.6.16.32<  >
  v2.6.17.5
  
  
  
     4 * Basic t_TSC" cl4ss="sref">PR_GET_TSC{
  16
PR_GET_TSC  17/* Get5_TSC" cl5ss="sref">PR_SET_TSC{
  16
PR_TSC_EN5BLE{
  16
PR_TSC_S5GSEGV52"line" name=T  16
/* allow the use of the timestamp cou) == -1) name="L4">   4 * Basic 5test to 5test behaviour of PR_GE5 clas54"line" name=e" name=T{
  16
[] 55"line" name="L17">  17/* Get5l/disabl5-tsc-test.c#L27" id="L25" cla56"line" name=T{
  16
  16
PR_GET_TSC  25const char *PR_GET_TSC   4 * Basic 6_TSC" cl6ss="sref">PR_SET_TSC  27        [0hreput t.6.16.32< 6C_ENABLE6 class="sref">PR_TSC_EN6BLE  16
PR_TSC_S6GSEGV6="line" name="L13">  13
/* throw a SIGSEGV iof reading ,eT  16
  25const char *[] 65"line" name=T{
  16
{
  16
  16
PR_GET_TSC  25const char *PR_GET_TSC   4 * Basic 7_TSC" cl7ss="sref">PR_SET_TSC{
  16
PR_TSC_EN7BLE  25const char *PR_TSC_S7GSEGV72"line" name=T{
  16
{
  16
{
  16
[] 75"line" name=T  16
   7#include <stdio.hon as7="line" name=if (=T/* allow the use of the timestamp cou) == -1) name="L4">   4 * Basic 7_TSC" cl7ss="sref">PR_GET_TSC{
  16
PR_GET_TSC  17/* Get8_TSC" cl8ss="sref">PR_SET_TSC{
  16
PR_TSC_EN8BLE{
  16
PR_TSC_S8GSEGV82"line" name=T  16
  14#include </* throw a SIGSEGV instead of reading ) == -1) name="L4">   4 * Basic 8>
{
  16
   7#include <stdio.h{
  16
stdlib.h  16
PR_GET_TSC{
  16
PR_SET_TSC  16
PR_TSC_EN9BLE  25const char *PR_TSC_S9GSEGV92"line" name=T  16
  16
  25const char *[] 95SET_Tonses"
	 >
 

"a7/0c/d1c367Documenfooter">
The original LXR software byd="L2" name="Lhttp://sourceforge.netonsojects/lxr">LXR an>
unityss=",ediis experi  25lxr@" id=.noss=".
"a7/0c/1c367Documensubfooter">
lxr." id=.no kindly hosted byd" name="Lhttp://www.redpill-" inso.no">Redpill L inso ASss=",ensovidee-tscL id= ref=ult" id id=opercs services sntal/1995.
"a7/0c/d1/bodyc/1/html