summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/sparc/sparc-counter-asm.S
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-09-14 16:08:53 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-10-20 11:16:54 +0200
commitb6dc4b47077803cde93648016d15ce3992573d03 (patch)
tree425c75b086ca6c211490c7a73b0c96746dba91d5 /cpukit/score/cpu/sparc/sparc-counter-asm.S
parentbsps/leon3: Optional IRQ(A)MP timestamp support (diff)
downloadrtems-b6dc4b47077803cde93648016d15ce3992573d03.tar.bz2
sparc: Move CPU counter implementation
Enable a BSP-specific CPU counter implementation. Update #4954.
Diffstat (limited to '')
-rw-r--r--bsps/sparc/shared/start/sparc-counter-asm.S (renamed from cpukit/score/cpu/sparc/sparc-counter-asm.S)28
1 files changed, 27 insertions, 1 deletions
diff --git a/cpukit/score/cpu/sparc/sparc-counter-asm.S b/bsps/sparc/shared/start/sparc-counter-asm.S
index 890876eff1..8b988bf3ed 100644
--- a/cpukit/score/cpu/sparc/sparc-counter-asm.S
+++ b/bsps/sparc/shared/start/sparc-counter-asm.S
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (C) 2016, 2018 embedded brains GmbH & Co. KG
+ * Copyright (C) 2016, 2023 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,6 +39,32 @@
.section ".text"
.align 4
+ /*
+ * This is a workaround for:
+ * https://gcc.gnu.org/bugzilla//show_bug.cgi?id=69027
+ */
+ PUBLIC(_CPU_Counter_read)
+SYM(_CPU_Counter_read):
+ sethi %hi(_SPARC_Counter + 4), %o1
+ ld [%o1 + %lo(_SPARC_Counter + 4)], %o1
+ or %o7, %g0, %g1
+ call %o1, 0
+ or %g1, %g0, %o7
+
+#if defined(RTEMS_PROFILING)
+ /*
+ * This is a workaround for:
+ * https://gcc.gnu.org/bugzilla//show_bug.cgi?id=69027
+ */
+ PUBLIC(_SPARC_Counter_read_ISR_disabled)
+SYM(_SPARC_Counter_read_ISR_disabled):
+ sethi %hi(_SPARC_Counter), %o1
+ ld [%o1 + %lo(_SPARC_Counter)], %o1
+ or %o7, %g0, %g1
+ call %o1, 0
+ or %g1, %g0, %o7
+#endif
+
PUBLIC(_SPARC_Counter_read_default)
SYM(_SPARC_Counter_read_default):
sethi %hi(_SPARC_Counter + 12), %o1