[rtems commit] virtex5/.../bsp.h: Add BSP_Convert_decrementer() macro required by MPC6xx timer driver

Joel Sherrill joel at rtems.org
Wed Aug 27 17:41:54 UTC 2014


Module:    rtems
Branch:    master
Commit:    bfa2b8c39ee19006e75d5ea3890fdda3eec4f9b7
Changeset: http://git.rtems.org/rtems/commit/?id=bfa2b8c39ee19006e75d5ea3890fdda3eec4f9b7

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Wed Aug 27 12:50:36 2014 -0500

virtex5/.../bsp.h: Add BSP_Convert_decrementer() macro required by MPC6xx timer driver

---

 c/src/lib/libbsp/powerpc/virtex5/include/bsp.h |   27 +++++++++++++++++++++--
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/virtex5/include/bsp.h b/c/src/lib/libbsp/powerpc/virtex5/include/bsp.h
index 2e21129..8558faa 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/virtex5/include/bsp.h
@@ -1,7 +1,9 @@
-/*  bsp.h
+/*  @file
  *
  *  This include file contains all GEN405 board IO definitions.
- *
+ */
+
+/*
  * derived from helas403/include/bsp.h:
  *  Id: bsp.h,v 1.4 2001/06/18 17:01:48 joel Exp
  *  Author:	Thomas Doerfler <td at imd.m.isar.de>
@@ -67,7 +69,26 @@ extern "C" {
 /* miscellaneous stuff assumed to exist */
 extern bool bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
 
-extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
+/*
+ * Bus Frequency
+ */
+extern unsigned int BSP_bus_frequency;
+/*
+ * Processor Clock Frequency
+ */
+extern unsigned int BSP_processor_frequency;
+/*
+ * Time base divisior (how many tick for 1 second).
+ */
+extern unsigned int BSP_time_base_divisor;
+
+/*
+ * Macro used by shared MPC6xx timer driver
+ */
+#define BSP_Convert_decrementer( _value ) \
+  ((unsigned long long) ((((unsigned long long)BSP_time_base_divisor) * 1000000ULL) /((unsigned long long) BSP_bus_frequency)) * ((unsigned long long) (_value)))
+
+
 #endif /* ASM */
 
 void BSP_ask_for_reset(void);



More information about the vc mailing list