Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Jun 2022 07:25:14 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Sebastian Huber <sebastian.huber@embedded-brains.de>
Cc:        hackers@freebsd.org
Subject:   Re: pps_capture() and pps_fetch()
Message-ID:  <202206010725.2517PEfF036703@critter.freebsd.dk>
In-Reply-To: <5b8310db-c94b-709f-8c57-bec2d413a80f@embedded-brains.de>
References:  <5b8310db-c94b-709f-8c57-bec2d413a80f@embedded-brains.de>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
Sebastian Huber writes:

> I try to understand how the PPS synchronization works in FreeBSD. It =

> seems that pps_capture() starts a transaction and pps_event() completes =

> the transaction if nothing interfered in the meantime.

The answer to most of your questions are in ./i386/i386/elan-mmcr.c

The PPS capture in the Soekris 4501 used two hardware counters, counting a=
t the same rate.

The first of the two were the timecounter, the other was started by the ha=
rdware signal.

Sometime later the hardware signals interrupt processing would happen.

By reading read both counters as close to instantaneously as possible, and=
 compensated for the interrupt latency by subtracting the event-started co=
unter from the timecounter.

(See also: http://phk.freebsd.dk/soekris/pps/)

-- =

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    =

Never attribute to malice what can adequately be explained by incompetence=
.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206010725.2517PEfF036703>