[rtems commit] Create a new macro for static DPCPU data.

Jan Sommer jan at rtems.org
Tue Nov 30 14:38:31 UTC 2021


Module:    rtems
Branch:    5
Commit:    975ecc1702ea13f9a999155b4eed3506a6390a9a
Changeset: http://git.rtems.org/rtems/commit/?id=975ecc1702ea13f9a999155b4eed3506a6390a9a

Author:    Andrew Turner <andrew at FreeBSD.org>
Date:      Thu Jul  5 17:13:37 2018 +0000

Create a new macro for static DPCPU data.

On arm64 (and possible other architectures) we are unable to use static
DPCPU data in kernel modules. This is because the compiler will generate
PC-relative accesses, however the runtime-linker expects to be able to
relocate these.

In preparation to fix this create two macros depending on if the data is
global or static.

Reviewed by:	bz, emaste, markj
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D16140

---

 cpukit/score/src/kern_tc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c
index 28994d8..747ce7e 100644
--- a/cpukit/score/src/kern_tc.c
+++ b/cpukit/score/src/kern_tc.c
@@ -2257,8 +2257,8 @@ SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_SECOND, inittimecounter, NULL);
 static int cpu_tick_variable;
 static uint64_t	cpu_tick_frequency;
 
-static DPCPU_DEFINE(uint64_t, tc_cpu_ticks_base);
-static DPCPU_DEFINE(unsigned, tc_cpu_ticks_last);
+DPCPU_DEFINE_STATIC(uint64_t, tc_cpu_ticks_base);
+DPCPU_DEFINE_STATIC(unsigned, tc_cpu_ticks_last);
 
 static uint64_t
 tc_cpu_ticks(void)



More information about the vc mailing list