diff mbox

[2/5] time: move timer APIs to include/time.h

Message ID 1482216812-18379-3-git-send-email-yamada.masahiro@socionext.com
State Superseded
Headers show

Commit Message

Masahiro Yamada Dec. 20, 2016, 6:53 a.m. UTC
The include/common.h is a collection of unrelated declarations,
macros, etc.

It is horrible to include such a cluttered header just for some
timer functions.  Split out timer functions into include/timer.h.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

 include/common.h |  8 +-------
 include/time.h   | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 7 deletions(-)
 create mode 100644 include/time.h

-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Simon Glass Dec. 26, 2016, 5:23 a.m. UTC | #1
On 20 December 2016 at 19:53, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> The include/common.h is a collection of unrelated declarations,

> macros, etc.

>

> It is horrible to include such a cluttered header just for some

> timer functions.  Split out timer functions into include/timer.h.

>

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> ---

>

>  include/common.h |  8 +-------

>  include/time.h   | 16 ++++++++++++++++

>  2 files changed, 17 insertions(+), 7 deletions(-)

>  create mode 100644 include/time.h


Reviewed-by: Simon Glass <sjg@chromium.org>

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox

Patch

diff --git a/include/common.h b/include/common.h
index 682205d..08f581c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -17,6 +17,7 @@  typedef volatile unsigned char	vu_char;
 
 #include <config.h>
 #include <errno.h>
+#include <time.h>
 #include <asm-offsets.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
@@ -577,12 +578,6 @@  void ddr_enable_ecc(unsigned int dram_size);
 #endif
 #endif
 
-/*
- * Return the current value of a monotonically increasing microsecond timer.
- * Granularity may be larger than 1us if hardware does not support this.
- */
-ulong timer_get_us(void);
-
 /* $(CPU)/cpu.c */
 static inline int cpumask_next(int cpu, unsigned int mask)
 {
@@ -721,7 +716,6 @@  void	external_interrupt (struct pt_regs *);
 void	irq_install_handler(int, interrupt_handler_t *, void *);
 void	irq_free_handler   (int);
 void	reset_timer	   (void);
-ulong	get_timer	   (ulong base);
 
 /* Return value of monotonic microsecond timer */
 unsigned long timer_get_us(void);
diff --git a/include/time.h b/include/time.h
new file mode 100644
index 0000000..5ed021f
--- /dev/null
+++ b/include/time.h
@@ -0,0 +1,16 @@ 
+/*
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _TIME_H
+#define _TIME_H
+
+unsigned long get_timer(unsigned long base);
+
+/*
+ * Return the current value of a monotonically increasing microsecond timer.
+ * Granularity may be larger than 1us if hardware does not support this.
+ */
+unsigned long timer_get_us(void);
+
+#endif /* _TIME_H */