File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ntp / ports / winnt / include / clockstuff.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:08:38 2012 UTC (12 years, 3 months ago) by misho
Branches: ntp, MAIN
CVS tags: v4_2_6p5p0, v4_2_6p5, HEAD
ntp 4.2.6p5

#ifndef _CLOCKSTUFF_H
#define _CLOCKSTUFF_H

#include <time.h>
#include <sys\timeb.h>

#include "ntp_fp.h"
#include "ntp_syslog.h"


void init_winnt_time(void);
void reset_winnt_time(void);
void lock_thread_to_processor(HANDLE);

/* 100ns intervals between 1/1/1601 and 1/1/1970 as reported by
 * SystemTimeToFileTime()
 */

#define FILETIME_1970     0x019db1ded53e8000
#define HECTONANOSECONDS  10000000

/*
 * Multimedia Timer
 */

void set_mm_timer(int);

enum {
	MM_TIMER_LORES,
	MM_TIMER_HIRES
};

/*
 * Optional callback from libntp ntp_set_tod() to Windows ntpd code
 * in nt_clockstuff that needs to know.  Optional because other
 * libntp clients like ntpdate don't use it.
 */

typedef void (*time_stepped_callback)(void);
extern time_stepped_callback	step_callback;

/*
 * get_sys_time_as_filetime is a function pointer to
 * either GetSystemTimeAsFileTime provided by Windows
 * or ntpd's interpolating replacement.
 */

typedef void (WINAPI *PGSTAFT)(LPFILETIME pft);
extern PGSTAFT get_sys_time_as_filetime;

void lock_thread_to_processor(HANDLE);

#ifdef HAVE_PPSAPI
/*
 * ntp_timestamp_from_counter provides an interface for 
 * serialpps.sys counterstamps to be converted to 
 * interpolated timestamps.
 */

extern void ntp_timestamp_from_counter(l_fp *, ULONGLONG, ULONGLONG);
#endif

#endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>