diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-07-25 08:03:02 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-07-25 10:48:14 +0200 |
commit | ceb4b58d6f2f32c225f5a9a6a12db1a95a5373a5 (patch) | |
tree | aa32cdb67d99c63a75ca7c5940f2c17d7d0b5419 | |
parent | a94c5904255ed02c5469af2874cc1105f74c87b8 (diff) |
build: Add RTEMS_PPS_SYNC CPU option
-rw-r--r-- | cpukit/include/sys/timepps.h | 3 | ||||
-rw-r--r-- | cpukit/score/src/kern_tc.c | 4 | ||||
-rw-r--r-- | spec/build/cpukit/cpuopts.yml | 2 | ||||
-rw-r--r-- | spec/build/cpukit/optppssync.yml | 17 |
4 files changed, 26 insertions, 0 deletions
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 <sys/ioccom.h> #include <sys/time.h> #ifdef __rtems__ +#include <rtems/score/cpuopts.h> #include <rtems/score/atomic.h> +#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 01fc648ced..ae3446e5b3 100644 --- a/spec/build/cpukit/cpuopts.yml +++ b/spec/build/cpukit/cpuopts.yml @@ -52,6 +52,8 @@ links: - role: build-dependency uid: optparavirt - role: build-dependency + uid: optppssync +- role: build-dependency uid: optposix - role: build-dependency uid: optprofiling 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 |