summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-07-25 08:03:02 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-12-19 08:26:46 +0100
commit20d2eaea3fa0e1c1f90df05e10184e551b807722 (patch)
tree0495a139ebe9e1dbeeaeb487d214b041076c6ee4
parentcfc0b3208cfe69b7b626b03c702a1b0dc068bec6 (diff)
build: Add RTEMS_PPS_SYNC CPU option
-rw-r--r--cpukit/include/sys/timepps.h3
-rw-r--r--cpukit/score/src/kern_tc.c4
-rw-r--r--spec/build/cpukit/cpuopts.yml2
-rw-r--r--spec/build/cpukit/optppssync.yml17
-rw-r--r--spec/build/testsuites/sptests/sppps01.yml2
5 files changed, 27 insertions, 1 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 c09f8e6cd4..b91474f3e9 100644
--- a/spec/build/cpukit/cpuopts.yml
+++ b/spec/build/cpukit/cpuopts.yml
@@ -50,6 +50,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
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: []