Commit 8ad3f411 authored by Aurelio Colosimo's avatar Aurelio Colosimo

PP_ADJ_FREQ_MAX exported in pptp.h

ADJ_FREQ_MAX is machine-dependent, but is used by servo.c too, so
I declare it in pptp.h as extern and define it for each platform.
Only gnu-linux is currently supported
parent 7f163d5b
......@@ -9,7 +9,7 @@
#include <sys/timex.h>
#include <pptp/pptp.h>
#define POSIX_IO_ADJ_FREQ_MAX 512000
const Integer32 PP_ADJ_FREQ_MAX = 512000;
void pp_puts(const char *s)
{
......@@ -63,10 +63,10 @@ int pp_adj_freq(Integer32 adj)
{
struct timex t;
if (adj > POSIX_IO_ADJ_FREQ_MAX)
adj = POSIX_IO_ADJ_FREQ_MAX;
else if (adj < -POSIX_IO_ADJ_FREQ_MAX)
adj = -POSIX_IO_ADJ_FREQ_MAX;
if (adj > PP_ADJ_FREQ_MAX)
adj = PP_ADJ_FREQ_MAX;
else if (adj < -PP_ADJ_FREQ_MAX)
adj = -PP_ADJ_FREQ_MAX;
t.modes = MOD_FREQUENCY;
t.freq = adj * ((1 << 16) / 1000);
......
......@@ -326,6 +326,7 @@ extern void pp_set_tstamp(TimeInternal *t);
/* Virtualization of Linux adjtimex (or BSD adjtime) system clock time
* adjustment. Boolean: returns 1 in case of success and 0 if failure */
extern int pp_adj_freq(Integer32 adj);
extern const Integer32 PP_ADJ_FREQ_MAX;
/*
* The state machine itself is an array of these structures.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment