Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
tsc.c File Reference
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/timer.h>
#include <linux/acpi_pmtmr.h>
#include <linux/cpufreq.h>
#include <linux/delay.h>
#include <linux/clocksource.h>
#include <linux/percpu.h>
#include <linux/timex.h>
#include <asm/hpet.h>
#include <asm/timer.h>
#include <asm/vgtod.h>
#include <asm/time.h>
#include <asm/delay.h>
#include <asm/hypervisor.h>
#include <asm/nmi.h>
#include <asm/x86_init.h>

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define MAX_RETRIES   5
 
#define SMI_TRESHOLD   50000
 
#define CAL_MS   10
 
#define CAL_LATCH   (PIT_TICK_RATE / (1000 / CAL_MS))
 
#define CAL_PIT_LOOPS   1000
 
#define CAL2_MS   50
 
#define CAL2_LATCH   (PIT_TICK_RATE / (1000 / CAL2_MS))
 
#define CAL2_PIT_LOOPS   5000
 
#define MAX_QUICK_PIT_MS   50
 
#define MAX_QUICK_PIT_ITERATIONS   (MAX_QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256)
 

Functions

 EXPORT_SYMBOL (cpu_khz)
 
 EXPORT_SYMBOL (tsc_khz)
 
u64 native_sched_clock (void)
 
unsigned long long sched_clock (void)
 
 EXPORT_SYMBOL_GPL (check_tsc_unstable)
 
int __init notsc_setup (char *str)
 
 __setup ("notsc", notsc_setup)
 
 __setup ("tsc=", tsc_setup)
 
unsigned long native_calibrate_tsc (void)
 
int recalibrate_cpu_khz (void)
 
 EXPORT_SYMBOL (recalibrate_cpu_khz)
 
 DEFINE_PER_CPU (unsigned long, cyc2ns)
 
 DEFINE_PER_CPU (unsigned long long, cyc2ns_offset)
 
void tsc_save_sched_clock_state (void)
 
void tsc_restore_sched_clock_state (void)
 
void mark_tsc_unstable (char *reason)
 
 EXPORT_SYMBOL_GPL (mark_tsc_unstable)
 
__cpuinit int unsynchronized_tsc (void)
 
 device_initcall (init_tsc_clocksource)
 
void __init tsc_init (void)
 

Variables

unsigned int __read_mostly cpu_khz
 
unsigned int __read_mostly tsc_khz
 
int tsc_clocksource_reliable
 

Macro Definition Documentation

#define CAL2_LATCH   (PIT_TICK_RATE / (1000 / CAL2_MS))

Definition at line 186 of file tsc.c.

#define CAL2_MS   50

Definition at line 185 of file tsc.c.

#define CAL2_PIT_LOOPS   5000

Definition at line 187 of file tsc.c.

#define CAL_LATCH   (PIT_TICK_RATE / (1000 / CAL_MS))

Definition at line 182 of file tsc.c.

#define CAL_MS   10

Definition at line 181 of file tsc.c.

#define CAL_PIT_LOOPS   1000

Definition at line 183 of file tsc.c.

#define MAX_QUICK_PIT_ITERATIONS   (MAX_QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256)

Definition at line 319 of file tsc.c.

#define MAX_QUICK_PIT_MS   50

Definition at line 318 of file tsc.c.

#define MAX_RETRIES   5

Definition at line 120 of file tsc.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 1 of file tsc.c.

#define SMI_TRESHOLD   50000

Definition at line 121 of file tsc.c.

Function Documentation

__setup ( "notsc"  ,
notsc_setup   
)
__setup ( )
DEFINE_PER_CPU ( unsigned  long,
cyc2ns   
)
DEFINE_PER_CPU ( unsigned long  long,
cyc2ns_offset   
)
device_initcall ( init_tsc_clocksource  )
EXPORT_SYMBOL ( cpu_khz  )
EXPORT_SYMBOL ( tsc_khz  )
EXPORT_SYMBOL ( recalibrate_cpu_khz  )
EXPORT_SYMBOL_GPL ( check_tsc_unstable  )
EXPORT_SYMBOL_GPL ( mark_tsc_unstable  )
void mark_tsc_unstable ( char reason)

Definition at line 780 of file tsc.c.

unsigned long native_calibrate_tsc ( void  )

native_calibrate_tsc - calibrate the tsc on boot

Definition at line 403 of file tsc.c.

u64 native_sched_clock ( void  )

Definition at line 44 of file tsc.c.

int __init notsc_setup ( char str)

Definition at line 98 of file tsc.c.

int recalibrate_cpu_khz ( void  )

Definition at line 558 of file tsc.c.

unsigned long long sched_clock ( void  )

Definition at line 77 of file tsc.c.

void __init tsc_init ( void  )

Definition at line 953 of file tsc.c.

void tsc_restore_sched_clock_state ( void  )

Definition at line 647 of file tsc.c.

void tsc_save_sched_clock_state ( void  )

Definition at line 631 of file tsc.c.

__cpuinit int unsynchronized_tsc ( void  )

Definition at line 819 of file tsc.c.

Variable Documentation

unsigned int __read_mostly cpu_khz

Definition at line 24 of file tsc.c.

int tsc_clocksource_reliable

Definition at line 40 of file tsc.c.

unsigned int __read_mostly tsc_khz

Definition at line 27 of file tsc.c.