summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3/include/leon.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-24 12:45:00 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-24 16:12:02 +0100
commita4bc90af4ee55e72b18de4b64da6338634490760 (patch)
tree64cd9a60f941054d469ce5061d9d77847de2e308 /c/src/lib/libbsp/sparc/leon3/include/leon.h
parentscore: Fix thread TLS area initialization (diff)
downloadrtems-a4bc90af4ee55e72b18de4b64da6338634490760.tar.bz2
sparc: Fix CPU counter support
The SPARC processors supported by RTEMS have no built-in CPU counter support. We have to use some hardware counter module for this purpose. The BSP must provide a 32-bit register which contains the current CPU counter value and a function for the difference calculation. It can use for example the GPTIMER instance used for the clock driver.
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/include/leon.h')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/include/leon.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
index ccee1a381d..e4710cde7d 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -273,6 +273,13 @@ extern rtems_interrupt_lock LEON3_IrqCtrl_Lock;
#define LEON_REG_TIMER_COUNTER_DEFINED_MASK 0x00000003
#define LEON_REG_TIMER_COUNTER_CURRENT_MODE_MASK 0x00000003
+#if defined(RTEMS_MULTIPROCESSING)
+ #define LEON3_CLOCK_INDEX \
+ (rtems_configuration_get_user_multiprocessing_table() ? LEON3_Cpu_Index : 0)
+#else
+ #define LEON3_CLOCK_INDEX 0
+#endif
+
/* Load 32-bit word by forcing a cache-miss */
static inline unsigned int leon_r32_no_cache(uintptr_t addr)
{