Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/ntp/ntpd/refclock_tsyncpci.c
Show First 20 Lines • Show All 543 Lines • ▼ Show 20 Lines | static void tsync_poll(int unit, struct peer *peer) | ||||
// Extract reference identifiers from ioctl payload | // Extract reference identifiers from ioctl payload | ||||
memset(timeRef, '\0', sizeof(timeRef)); | memset(timeRef, '\0', sizeof(timeRef)); | ||||
memset(ppsRef, '\0', sizeof(ppsRef)); | memset(ppsRef, '\0', sizeof(ppsRef)); | ||||
pRefObj = (void *)it->payloads; | pRefObj = (void *)it->payloads; | ||||
memcpy(timeRef, pRefObj->time, TSYNC_REF_LEN); | memcpy(timeRef, pRefObj->time, TSYNC_REF_LEN); | ||||
memcpy(ppsRef, pRefObj->pps, TSYNC_REF_LEN); | memcpy(ppsRef, pRefObj->pps, TSYNC_REF_LEN); | ||||
// Extract the Clock Service Time Scale and convert to correct byte order | // Extract the Clock Service Time Scale and convert to correct byte order | ||||
memcpy(&tmscl, ((TIME_SCALE*)(it1->payloads)), sizeof(tmscl)); | memcpy(&tmscl, it1->payloads, sizeof(tmscl)); | ||||
tmscl = ntohl(tmscl); | tmscl = ntohl(tmscl); | ||||
// Extract leap second info from ioctl payload and perform byte swapping | // Extract leap second info from ioctl payload and perform byte swapping | ||||
for (i = 0; i < (sizeof(leapSec) / 4); i++) | for (i = 0; i < (sizeof(leapSec) / 4); i++) | ||||
{ | { | ||||
for (j = 0; j < 4; j++) | for (j = 0; j < 4; j++) | ||||
{ | { | ||||
((unsigned char*)&leapSec)[(i * 4) + j] = | ((unsigned char*)&leapSec)[(i * 4) + j] = | ||||
▲ Show 20 Lines • Show All 352 Lines • Show Last 20 Lines |