summaryrefslogtreecommitdiff
path: root/bsps/sparc/leon3/include/bsp/leon3.h
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/sparc/leon3/include/bsp/leon3.h')
-rw-r--r--bsps/sparc/leon3/include/bsp/leon3.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/bsps/sparc/leon3/include/bsp/leon3.h b/bsps/sparc/leon3/include/bsp/leon3.h
index a5eecdded7..4ee5531941 100644
--- a/bsps/sparc/leon3/include/bsp/leon3.h
+++ b/bsps/sparc/leon3/include/bsp/leon3.h
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (C) 2014, 2021 embedded brains GmbH & Co. KG
+ * Copyright (C) 2014, 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
@@ -313,11 +313,33 @@ extern apbuart *leon3_debug_uart;
#endif
/**
+ * @brief Represents the LEON3-specific timecounter.
+ */
+typedef struct {
+ /**
+ * @brief This member contains the base timecounter.
+ */
+ struct timecounter base;
+
+ /**
+ * @brief This member provides a software fall-back counter.
+ */
+ uint32_t software_counter;
+
+#if !defined(LEON3_HAS_ASR_22_23_UP_COUNTER)
+ /**
+ * @brief This member may reference a hardware counter register.
+ */
+ volatile uint32_t *counter_register;
+#endif
+} leon3_timecounter;
+
+/**
* @brief Provides the LEON3-specific timecounter.
*
* It is also used by the CPU counter implementation.
*/
-extern struct timecounter leon3_timecounter_instance;
+extern leon3_timecounter leon3_timecounter_instance;
/** @} */