From 76358fc28a3e7b2a46b2a0958425e243a3391ab3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 25 Jul 2023 08:03:02 +0200 Subject: build: Add RTEMS_PPS_SYNC CPU option --- cpukit/include/sys/timepps.h | 3 +++ cpukit/score/src/kern_tc.c | 4 ++++ spec/build/cpukit/cpuopts.yml | 2 ++ spec/build/cpukit/optppssync.yml | 17 +++++++++++++++++ spec/build/testsuites/sptests/sppps01.yml | 2 +- 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 spec/build/cpukit/optppssync.yml diff --git a/cpukit/include/sys/timepps.h b/cpukit/include/sys/timepps.h index 502d93833e..4b76f2e36c 100644 --- a/cpukit/include/sys/timepps.h +++ b/cpukit/include/sys/timepps.h @@ -34,8 +34,11 @@ #include #include #ifdef __rtems__ +#include #include +#ifdef RTEMS_PPS_SYNC #define PPS_SYNC +#endif #define hardpps _Timecounter_Discipline #ifdef __cplusplus extern "C" { diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c index 95ae01b5b4..9a4896c5f6 100644 --- a/cpukit/score/src/kern_tc.c +++ b/cpukit/score/src/kern_tc.c @@ -1519,6 +1519,7 @@ unlock: #endif /* __rtems__ */ } +#ifdef RTEMS_PPS_SYNC /* Report the frequency of the current timecounter. */ uint64_t tc_getfrequency(void) @@ -1526,6 +1527,7 @@ tc_getfrequency(void) return (timehands->th_counter->tc_frequency); } +#endif #ifndef __rtems__ static bool @@ -1904,6 +1906,7 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, choice, "Timecounter hardware detected"); #endif /* __rtems__ */ +#ifdef RTEMS_PPS_SYNC /* * RFC 2783 PPS-API implementation. */ @@ -2292,6 +2295,7 @@ pps_event(struct pps_state *pps, int event) (*pps->wakeup)(pps); #endif /* __rtems__ */ } +#endif /* RTEMS_PPS_SYNC */ /* * Timecounters need to be updated every so often to prevent the hardware diff --git a/spec/build/cpukit/cpuopts.yml b/spec/build/cpukit/cpuopts.yml index 9ab3e0d298..d7bb3ac4c3 100644 --- a/spec/build/cpukit/cpuopts.yml +++ b/spec/build/cpukit/cpuopts.yml @@ -47,6 +47,8 @@ links: uid: optnewlib - role: build-dependency uid: optparavirt +- role: build-dependency + uid: optppssync - role: build-dependency uid: optposix - role: build-dependency diff --git a/spec/build/cpukit/optppssync.yml b/spec/build/cpukit/optppssync.yml new file mode 100644 index 0000000000..30506f04d7 --- /dev/null +++ b/spec/build/cpukit/optppssync.yml @@ -0,0 +1,17 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- env-enable: null +- define-condition: null +build-type: option +copyrights: +- Copyright (C) 2023 embedded brains GmbH & Co. KG +default: +- enabled-by: true + value: true +description: | + Enable the RTEMS PPS synchronization support. +enabled-by: true +links: [] +name: RTEMS_PPS_SYNC +type: build diff --git a/spec/build/testsuites/sptests/sppps01.yml b/spec/build/testsuites/sptests/sppps01.yml index 55770eceb9..0f7150e712 100644 --- a/spec/build/testsuites/sptests/sppps01.yml +++ b/spec/build/testsuites/sptests/sppps01.yml @@ -5,7 +5,7 @@ copyrights: - Copyright (C) 2022 German Aerospace Center (DLR) cppflags: [] cxxflags: [] -enabled-by: true +enabled-by: RTEMS_PPS_SYNC features: c cprogram includes: [] ldflags: [] -- cgit v1.2.3