mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-09 00:53:16 +00:00
Use atomic_load(9) to read ppsinfo sequence numbers.
In this case volatile qualifiers enusre that a compiler does not optimize the accesses out. Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13534
This commit is contained in:
committed by
Moyano, Gabriel
parent
73b77be719
commit
7d3712fb26
@@ -1799,10 +1799,10 @@ pps_fetch(struct pps_fetch_args *fapi, struct pps_state *pps)
|
|||||||
tv.tv_usec = fapi->timeout.tv_nsec / 1000;
|
tv.tv_usec = fapi->timeout.tv_nsec / 1000;
|
||||||
timo = tvtohz(&tv);
|
timo = tvtohz(&tv);
|
||||||
}
|
}
|
||||||
aseq = pps->ppsinfo.assert_sequence;
|
aseq = atomic_load_int(&pps->ppsinfo.assert_sequence);
|
||||||
cseq = pps->ppsinfo.clear_sequence;
|
cseq = atomic_load_int(&pps->ppsinfo.clear_sequence);
|
||||||
while (aseq == pps->ppsinfo.assert_sequence &&
|
while (aseq == atomic_load_int(&pps->ppsinfo.assert_sequence) &&
|
||||||
cseq == pps->ppsinfo.clear_sequence) {
|
cseq == atomic_load_int(&pps->ppsinfo.clear_sequence)) {
|
||||||
if (abi_aware(pps, 1) && pps->driver_mtx != NULL) {
|
if (abi_aware(pps, 1) && pps->driver_mtx != NULL) {
|
||||||
if (pps->flags & PPSFLAG_MTX_SPIN) {
|
if (pps->flags & PPSFLAG_MTX_SPIN) {
|
||||||
err = msleep_spin(pps, pps->driver_mtx,
|
err = msleep_spin(pps, pps->driver_mtx,
|
||||||
|
|||||||
Reference in New Issue
Block a user