[PATCH 4/4] tod.h -> libcsupport like other driver and helper prototype files

Joel Sherrill joel.sherrill at oarcorp.com
Thu Sep 11 13:28:17 UTC 2014


This rippled into the handful of files that should have been using
<rtems/tod.h>.
---
 c/src/lib/libbsp/m68k/mvme162/tod/tod.c |  2 +-
 c/src/lib/libbsp/shared/tod.c           |  1 +
 c/src/lib/libbsp/shared/tod.h           | 71 ---------------------------------
 c/src/lib/libcpu/bfin/clock/rtc.c       |  2 +-
 cpukit/libcsupport/Makefile.am          |  1 +
 cpukit/libcsupport/include/rtems/tod.h  | 70 ++++++++++++++++++++++++++++++++
 cpukit/libcsupport/preinstall.am        |  4 ++
 7 files changed, 78 insertions(+), 73 deletions(-)
 delete mode 100644 c/src/lib/libbsp/shared/tod.h
 create mode 100644 cpukit/libcsupport/include/rtems/tod.h

diff --git a/c/src/lib/libbsp/m68k/mvme162/tod/tod.c b/c/src/lib/libbsp/m68k/mvme162/tod/tod.c
index 58e964f..3475979 100644
--- a/c/src/lib/libbsp/m68k/mvme162/tod/tod.c
+++ b/c/src/lib/libbsp/m68k/mvme162/tod/tod.c
@@ -16,7 +16,7 @@
  */
 
 #include <rtems.h>
-#include <tod.h>
+#include <rtems/tod.h>
 
 #define	tod	((volatile unsigned char *)0xfffc1ff8)
 
diff --git a/c/src/lib/libbsp/shared/tod.c b/c/src/lib/libbsp/shared/tod.c
index e074569..64007d6 100644
--- a/c/src/lib/libbsp/shared/tod.c
+++ b/c/src/lib/libbsp/shared/tod.c
@@ -8,6 +8,7 @@
 
 #include <rtems.h>
 #include <rtems/rtc.h>
+#include <rtems/tod.h>
 #include <rtems/libio.h>
 
 #include <libchip/rtc.h>
diff --git a/c/src/lib/libbsp/shared/tod.h b/c/src/lib/libbsp/shared/tod.h
deleted file mode 100644
index 605cef2..0000000
--- a/c/src/lib/libbsp/shared/tod.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- *  @file
- *
- *  @ingroup shared_tod
- *
- *  @brief Real Time Clock (MK48T08) for RTEMS on Score603e
- */
-
-/*
- *
- *  Based on MVME162 TOD by:
- *    COPYRIGHT (C) 1997
- *    by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN
- *    ALL RIGHTS RESERVED
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifndef TOD_H
-#define TOD_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  @defgroup shared_tod RTC
- *
- *  @ingroup bsp_shared
- *
- *  @brief Set the RTC
- */
-
-int setRealTime(
-  const rtems_time_of_day *tod
-);
-
-/*
- *  Get the time from the RTC.
- */
-
-void getRealTime(
-  rtems_time_of_day *tod
-);
-
-/*
- *  Read real time from RTC and set it to RTEMS' clock manager
- */
-
-void setRealTimeToRTEMS(void);
-
-/*
- *  Read time from RTEMS' clock manager and set it to RTC
- */
-
-void setRealTimeFromRTEMS(void);
-
-/*
- *  Return the difference between RTC and RTEMS' clock manager time in minutes.
- *  If the difference is greater than 1 day, this returns 9999.
- */
-
-int checkRealTime(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libcpu/bfin/clock/rtc.c b/c/src/lib/libcpu/bfin/clock/rtc.c
index 6e57cb2..17f2cf7 100644
--- a/c/src/lib/libcpu/bfin/clock/rtc.c
+++ b/c/src/lib/libcpu/bfin/clock/rtc.c
@@ -11,7 +11,7 @@
 
 
 #include <rtems.h>
-#include "tod.h"
+#include <rtems/tod.h>
 #include <rtems/rtc.h>
 #include <rtems/libio.h>
 #include <bsp.h>
diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
index 835f96e..d39f8f9 100644
--- a/cpukit/libcsupport/Makefile.am
+++ b/cpukit/libcsupport/Makefile.am
@@ -11,6 +11,7 @@ include_rtems_HEADERS += include/rtems/framebuffer.h
 include_rtems_HEADERS += include/iosupp.h
 include_rtems_HEADERS += include/ringbuf.h
 include_rtems_HEADERS += include/rtc.h
+include_rtems_HEADERS += include/rtems/tod.h
 include_rtems_HEADERS += include/spurious.h
 include_rtems_HEADERS += include/vmeintr.h
 
diff --git a/cpukit/libcsupport/include/rtems/tod.h b/cpukit/libcsupport/include/rtems/tod.h
new file mode 100644
index 0000000..971e854
--- /dev/null
+++ b/cpukit/libcsupport/include/rtems/tod.h
@@ -0,0 +1,70 @@
+/**
+ *  @file
+ *
+ *  @ingroup shared_tod
+ *
+ *  @brief Real Time Clock Time of Day API Definition
+ */
+
+/*
+ *
+ *  Based on MVME162 TOD by:
+ *    COPYRIGHT (C) 1997
+ *    by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN
+ *    ALL RIGHTS RESERVED
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef TOD_H
+#define TOD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ *  @defgroup shared_tod RTC
+ *
+ *  @ingroup bsp_shared
+ *
+ *  @brief Set the RTC
+ */
+int setRealTime(
+  const rtems_time_of_day *tod
+);
+
+/*
+ *  Get the time from the RTC.
+ */
+
+void getRealTime(
+  rtems_time_of_day *tod
+);
+
+/*
+ *  Read real time from RTC and set it to RTEMS' clock manager
+ */
+
+void setRealTimeToRTEMS(void);
+
+/*
+ *  Read time from RTEMS' clock manager and set it to RTC
+ */
+
+void setRealTimeFromRTEMS(void);
+
+/*
+ *  Return the difference between RTC and RTEMS' clock manager time in minutes.
+ *  If the difference is greater than 1 day, this returns 9999.
+ */
+
+int checkRealTime(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/cpukit/libcsupport/preinstall.am b/cpukit/libcsupport/preinstall.am
index c4286ba..e56d946 100644
--- a/cpukit/libcsupport/preinstall.am
+++ b/cpukit/libcsupport/preinstall.am
@@ -42,6 +42,10 @@ $(PROJECT_INCLUDE)/rtems/rtc.h: include/rtc.h $(PROJECT_INCLUDE)/rtems/$(dirstam
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtc.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtc.h
 
+$(PROJECT_INCLUDE)/rtems/tod.h: include/rtems/tod.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/tod.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/tod.h
+
 $(PROJECT_INCLUDE)/rtems/spurious.h: include/spurious.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/spurious.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/spurious.h
-- 
1.9.3




More information about the devel mailing list