Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
timex.h File Reference
#include <uapi/linux/timex.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/param.h>
#include <asm/timex.h>

Go to the source code of this file.

Macros

#define ADJ_ADJTIME   0x8000 /* switch between adjtime/adjtimex modes */
 
#define ADJ_OFFSET_SINGLESHOT   0x0001 /* old-fashioned adjtime */
 
#define ADJ_OFFSET_READONLY   0x2000 /* read-only adjtime */
 
#define SHIFT_PLL   2 /* PLL frequency factor (shift) */
 
#define SHIFT_FLL   2 /* FLL frequency factor (shift) */
 
#define MAXTC   10 /* maximum time constant (shift) */
 
#define SHIFT_USEC   16 /* frequency offset scale (shift) */
 
#define PPM_SCALE   ((s64)NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
 
#define PPM_SCALE_INV_SHIFT   19
 
#define PPM_SCALE_INV
 
#define MAXPHASE   500000000L /* max phase error (ns) */
 
#define MAXFREQ   500000 /* max frequency error (ns/s) */
 
#define MAXFREQ_SCALED   ((s64)MAXFREQ << NTP_SCALE_SHIFT)
 
#define MINSEC   256 /* min interval between updates (s) */
 
#define MAXSEC   2048 /* max interval between updates (s) */
 
#define NTP_PHASE_LIMIT   ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dispersion */
 
#define shift_right(x, s)
 
#define NTP_SCALE_SHIFT   32
 
#define NTP_INTERVAL_FREQ   (HZ)
 
#define NTP_INTERVAL_LENGTH   (NSEC_PER_SEC/NTP_INTERVAL_FREQ)
 
#define PIT_TICK_RATE   1193182ul
 

Functions

void ntp_init (void)
 
void ntp_clear (void)
 
u64 ntp_tick_length (void)
 
int second_overflow (unsigned long secs)
 
int do_adjtimex (struct timex *)
 
void hardpps (const struct timespec *, const struct timespec *)
 
int read_current_timer (unsigned long *timer_val)
 

Variables

unsigned long tick_usec
 
unsigned long tick_nsec
 

Macro Definition Documentation

#define ADJ_ADJTIME   0x8000 /* switch between adjtime/adjtimex modes */

Definition at line 58 of file timex.h.

#define ADJ_OFFSET_READONLY   0x2000 /* read-only adjtime */

Definition at line 60 of file timex.h.

#define ADJ_OFFSET_SINGLESHOT   0x0001 /* old-fashioned adjtime */

Definition at line 59 of file timex.h.

#define MAXFREQ   500000 /* max frequency error (ns/s) */

Definition at line 114 of file timex.h.

#define MAXFREQ_SCALED   ((s64)MAXFREQ << NTP_SCALE_SHIFT)

Definition at line 115 of file timex.h.

#define MAXPHASE   500000000L /* max phase error (ns) */

Definition at line 113 of file timex.h.

#define MAXSEC   2048 /* max interval between updates (s) */

Definition at line 117 of file timex.h.

#define MAXTC   10 /* maximum time constant (shift) */

Definition at line 100 of file timex.h.

#define MINSEC   256 /* min interval between updates (s) */

Definition at line 116 of file timex.h.

#define NTP_INTERVAL_FREQ   (HZ)

Definition at line 140 of file timex.h.

#define NTP_INTERVAL_LENGTH   (NSEC_PER_SEC/NTP_INTERVAL_FREQ)

Definition at line 141 of file timex.h.

#define NTP_PHASE_LIMIT   ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dispersion */

Definition at line 118 of file timex.h.

#define NTP_SCALE_SHIFT   32

Definition at line 138 of file timex.h.

#define PIT_TICK_RATE   1193182ul

Definition at line 153 of file timex.h.

#define PPM_SCALE   ((s64)NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))

Definition at line 108 of file timex.h.

#define PPM_SCALE_INV
Value:
PPM_SCALE + 1)

Definition at line 110 of file timex.h.

#define PPM_SCALE_INV_SHIFT   19

Definition at line 109 of file timex.h.

#define SHIFT_FLL   2 /* FLL frequency factor (shift) */

Definition at line 99 of file timex.h.

#define SHIFT_PLL   2 /* PLL frequency factor (shift) */

Definition at line 98 of file timex.h.

#define shift_right (   x,
  s 
)
Value:
({ \
__typeof__(x) __x = (x); \
__typeof__(s) __s = (s); \
__x < 0 ? -(-__x >> __s) : __x >> __s; \
})

Definition at line 132 of file timex.h.

#define SHIFT_USEC   16 /* frequency offset scale (shift) */

Definition at line 107 of file timex.h.

Function Documentation

int do_adjtimex ( struct timex )

Definition at line 620 of file ntp.c.

void hardpps ( const struct timespec ,
const struct timespec  
)
void ntp_clear ( void  )

ntp_clear - Clears the NTP state variables

Definition at line 346 of file ntp.c.

void ntp_init ( void  )

Definition at line 964 of file ntp.c.

u64 ntp_tick_length ( void  )

Definition at line 369 of file ntp.c.

int read_current_timer ( unsigned long timer_val)

Definition at line 40 of file delay.c.

int second_overflow ( unsigned long  secs)

Definition at line 391 of file ntp.c.

Variable Documentation

unsigned long tick_nsec

Definition at line 32 of file ntp.c.

unsigned long tick_usec

Definition at line 29 of file ntp.c.