1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 3<html> 4 5 <head> 6 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 7 <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> 8 <title>Shared memoy Driver</title> 9 <link href="scripts/style.css" type="text/css" rel="stylesheet"> 10 </head> 11 12 <body> 13 <h3>Shared Memory Driver</h3> 14 <hr> 15 <h4>Synopsis</h4> 16 <p>Address: 127.127.28.<i>u</i><br> 17 Reference ID: <tt>SHM</tt><br> 18 Driver ID: <tt>SHM</tt></p> 19 <h4>Description</h4> 20 <p>This driver receives its reference clock info from a shared memory-segment. The shared memory-segment is created with owner-only access for unit 0 and 1, and world access for unit 2 and 3</p> 21 <h4>Structure of shared memory-segment</h4> 22 <pre>struct shmTime { 23 int mode; /* 0 - if valid set 24 * use values, 25 * clear valid 26 * 1 - if valid set 27 * if count before and after read of 28 * values is equal, 29 * use values 30 * clear valid 31 */ 32 int count; 33 time_t clockTimeStampSec; /* external clock */ 34 int clockTimeStampUSec; /* external clock */ 35 time_t receiveTimeStampSec; /* internal clock, when external value was received */ 36 int receiveTimeStampUSec; /* internal clock, when external value was received */ 37 int leap; 38 int precision; 39 int nsamples; 40 int valid; 41 int dummy[10]; 42};</pre> 43 <h4>Operation mode=0</h4> 44 <p>When the poll-method of the driver is called, the valid-flag of the shared memory-segment is checked:</p> 45 <p>If set, the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are passed to ntp, and the valid-flag is cleared.</p> 46 <p>If not set, a timeout is reported to ntp, nothing else happend</p> 47 <h4>Operation mode=1</h4> 48 <p>When the poll-method of the driver is called, the valid-flag of the shared memory-segment is checked:</p> 49 <p>If set, the count-field of the record is remembered, and the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are read. Then, the remembered count is compared to the count now in the record. If both are equal, the values read from the record are passed to ntp. If they differ, another process has modified the record while it was read out (was not able to produce this case), and failure is reported to ntp. The valid flag is cleared.</p> 50 <p>If not set, a timeout is reported to ntp, nothing else happend</p> 51 <h4>Fudge Factors</h4> 52 <dl> 53 <dt><tt>time1 <i>time</i></tt> 54 <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. 55 <dt><tt>time2 <i>time</i></tt> 56 <dd>Not used by this driver. 57 <dt><tt>stratum <i>number</i></tt> 58 <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. 59 <dt><tt>refid <i>string</i></tt> 60 <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>SHM</tt>. 61 <dt><tt>flag1 0 | 1</tt> 62 <dd>Not used by this driver. 63 <dt><tt>flag2 0 | 1</tt> 64 <dd>Not used by this driver. 65 <dt><tt>flag3 0 | 1</tt> 66 <dd>Not used by this driver. 67 <dt><tt>flag4 0 | 1</tt> 68 <dd>Not used by this driver. 69 <h4>Additional Information</h4> 70 <p><a href="../refclock.html">Reference Clock Drivers</a></p> 71 </dl> 72 <hr> 73 <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> 74 </body> 75 76</html>