diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 05:50:01 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 05:50:01 -0500 |
commit | 61c16bebe1a56cb1c211733b92474bf866eba87d (patch) | |
tree | 8b078214f79fae9b8f9bdf608a6f69eebf334801 /ppsthread.c | |
parent | e92b21041e00778c72362620ad9d62ffa94613db (diff) | |
download | gpsd-61c16bebe1a56cb1c211733b92474bf866eba87d.tar.gz |
ntplib extraction requires libgpsd object format bump to 23.
The new struct ppsthread_t isolates the interface to the PPS monitor loop.
It will need more members before we're done, including some reporting
hooks.
Diffstat (limited to 'ppsthread.c')
-rw-r--r-- | ppsthread.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/ppsthread.c b/ppsthread.c index 52512bc8..ff25b81c 100644 --- a/ppsthread.c +++ b/ppsthread.c @@ -350,8 +350,8 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) "PPS: pthread_mutex_lock() : %s\n", errbuf); } /*@ +unrecog @*/ - last_fixtime_real = session->last_fixtime.real; - last_fixtime_clock = session->last_fixtime.clock; + last_fixtime_real = session->pps_thread.fixin_real; + last_fixtime_clock = session->pps_thread.fixin_clock; /*@ -unrecog (splint has no pthread declarations as yet) @*/ pthread_err = pthread_mutex_unlock(&ppslast_mutex); if ( 0 != pthread_err ) { @@ -704,9 +704,9 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) } /*@ +unrecog @*/ /*@-type@*/ /* splint is confused about struct timespec */ - session->pps_state.ppslast = ppstimes; + session->pps_thread.ppsout_last = ppstimes; /*@+type@*/ - session->pps_state.ppscount++; + session->pps_thread.ppsout_count++; /*@ -unrecog (splint has no pthread declarations as yet) @*/ pthread_err = pthread_mutex_unlock(&ppslast_mutex); if ( 0 != pthread_err ) { @@ -787,7 +787,7 @@ void pps_thread_deactivate(struct gps_device_t *session) /*@+nullstate +mustfreeonly@*/ } -int pps_thread_stash_fixtime(volatile struct pps_fixtime_t *last_fixtime, +int pps_thread_stash_fixtime(volatile struct pps_thread_t *pps_thread, timestamp_t realtime, struct timespec clocktime) /* thread-safe update of last fix time - only way we pass data in */ { @@ -799,8 +799,8 @@ int pps_thread_stash_fixtime(volatile struct pps_fixtime_t *last_fixtime, ret = PPS_LOCK_ERR; else { /*@ +unrecog @*/ - last_fixtime->real = realtime; - last_fixtime->clock = clocktime; + pps_thread->fixin_real = realtime; + pps_thread->fixin_clock = clocktime; } /*@ -unrecog (splint has no pthread declarations as yet) @*/ pthread_err = pthread_mutex_unlock(&ppslast_mutex); @@ -811,7 +811,8 @@ int pps_thread_stash_fixtime(volatile struct pps_fixtime_t *last_fixtime, return ret; } -int pps_thread_lastpps(struct pps_state_t *pps_state, struct timedelta_t *td) +int pps_thread_lastpps(volatile struct pps_thread_t *pps_thread, + struct timedelta_t *td) /* return the delta at the time of the last PPS - only way we pass data out */ { volatile int ret; @@ -824,8 +825,8 @@ int pps_thread_lastpps(struct pps_state_t *pps_state, struct timedelta_t *td) ret = PPS_LOCK_ERR; else { /*@ +unrecog @*/ - *td = pps_state->ppslast; - ret = pps_state->ppscount; + *td = pps_thread->ppsout_last; + ret = pps_thread->ppsout_count; } /*@ -unrecog (splint has no pthread declarations as yet) @*/ pthread_err = pthread_mutex_unlock(&ppslast_mutex); |