summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-12 12:19:18 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-12 12:19:18 -0500
commit3b26aed0b6a6dd607e4b63138c2102d1e6754441 (patch)
treef4f213fd9f542e8774cdd25a224a88a5f5d7062c
parent036d54fcffacac2ae32ce8d6970b1eba8f85269b (diff)
downloadgpsd-3b26aed0b6a6dd607e4b63138c2102d1e6754441.tar.gz
Namespace cleanup.
-rw-r--r--gpsd.h-tail2
-rw-r--r--libgpsd_core.c2
-rw-r--r--ppsthread.c51
3 files changed, 27 insertions, 28 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail
index 71753c1e..5e883aa9 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -959,7 +959,7 @@ extern void pps_early_init(struct gps_context_t *);
TS_NORM( r ); \
} while (0)
-extern void pps_stash_fixtime(struct gps_device_t *,
+extern void pps_thread_stash_fixtime(struct gps_device_t *,
timestamp_t, struct timespec);
extern void pps_thread_activate(struct gps_device_t *);
extern void pps_thread_deactivate(struct gps_device_t *);
diff --git a/libgpsd_core.c b/libgpsd_core.c
index e61ed3ae..47ce3014 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1679,7 +1679,7 @@ void ntpshm_latch(struct gps_device_t *device, struct timedrift_t /*@out@*/*td)
/*@+type@*/
/* thread-safe update */
- pps_stash_fixtime(device, device->newdata.time, td->clock);
+ pps_thread_stash_fixtime(device, device->newdata.time, td->clock);
}
#endif /* NTPSHM_ENABLE */
diff --git a/ppsthread.c b/ppsthread.c
index ce006a9c..7aed82ad 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -260,31 +260,6 @@ static int init_kernel_pps(struct gps_device_t *session)
/*@+compdestroy +nullpass +unrecog@*/
#endif /* defined(HAVE_SYS_TIMEPPS_H) */
-void pps_stash_fixtime(struct gps_device_t *session,
- timestamp_t realtime, struct timespec clocktime)
-/* thread-safe update of last fix time */
-{
- /*@ -unrecog (splint has no pthread declarations as yet) @*/
- int pthread_err = pthread_mutex_lock(&ppslast_mutex);
- if ( 0 != pthread_err ) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "PPS: pthread_mutex_lock() : %s\n",
- strerror(errno));
- }
- /*@ +unrecog @*/
- session->last_fixtime.real = realtime;
- session->last_fixtime.clock = clocktime;
- /*@ -unrecog (splint has no pthread declarations as yet) @*/
- pthread_err = pthread_mutex_unlock(&ppslast_mutex);
- if ( 0 != pthread_err ) {
- gpsd_report(&session->context->errout, LOG_ERROR,
- "PPS: pthread_mutex_unlock() : %s\n",
- strerror(errno));
- }
- /*@ +unrecog @*/
-}
-
-
/*@-mustfreefresh -type -unrecog -branchstate@*/
static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
{
@@ -795,8 +770,32 @@ void pps_thread_deactivate(struct gps_device_t *session)
/*@+nullstate +mustfreeonly@*/
}
+void pps_thread_stash_fixtime(struct gps_device_t *session,
+ timestamp_t realtime, struct timespec clocktime)
+/* thread-safe update of last fix time - only way we pass data in */
+{
+ /*@ -unrecog (splint has no pthread declarations as yet) @*/
+ int pthread_err = pthread_mutex_lock(&ppslast_mutex);
+ if ( 0 != pthread_err ) {
+ gpsd_report(&session->context->errout, LOG_ERROR,
+ "PPS: pthread_mutex_lock() : %s\n",
+ strerror(errno));
+ }
+ /*@ +unrecog @*/
+ session->last_fixtime.real = realtime;
+ session->last_fixtime.clock = clocktime;
+ /*@ -unrecog (splint has no pthread declarations as yet) @*/
+ pthread_err = pthread_mutex_unlock(&ppslast_mutex);
+ if ( 0 != pthread_err ) {
+ gpsd_report(&session->context->errout, LOG_ERROR,
+ "PPS: pthread_mutex_unlock() : %s\n",
+ strerror(errno));
+ }
+ /*@ +unrecog @*/
+}
+
int pps_thread_lastpps(struct gps_device_t *session, struct timedrift_t *td)
-/* return a copy of the drift at the time of the last PPS */
+/* return the drift at the time of the last PPS - only way we pass data out */
{
volatile int ret;
/* pthread error return */