summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/include/common.h b/include/common.h
index a8d833b..695478c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -15,10 +15,15 @@ typedef volatile unsigned long vu_long;
typedef volatile unsigned short vu_short;
typedef volatile unsigned char vu_char;
+/* Allow sharing constants with type modifiers between C and assembly. */
+#define _AC(X, Y) (X##Y)
+
#include <config.h>
#include <errno.h>
+#include <time.h>
#include <asm-offsets.h>
#include <linux/bitops.h>
+#include <linux/delay.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/stringify.h>
@@ -576,12 +581,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)
{
@@ -720,7 +719,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);
@@ -776,7 +774,6 @@ uint64_t get_ticks(void);
void wait_ticks (unsigned long);
/* arch/$(ARCH)/lib/time.c */
-void __udelay (unsigned long);
ulong usec2ticks (unsigned long usec);
ulong ticks2usec (unsigned long ticks);
int init_timebase (void);
@@ -833,10 +830,6 @@ void qsort(void *base, size_t nmemb, size_t size,
int(*compar)(const void *, const void *));
int strcmp_compar(const void *, const void *);
-/* lib/time.c */
-void udelay (unsigned long);
-void mdelay(unsigned long);
-
/* lib/uuid.c */
#include <uuid.h>
@@ -936,7 +929,12 @@ int cpu_disable(int nr);
int cpu_release(int nr, int argc, char * const argv[]);
#endif
-#endif /* __ASSEMBLY__ */
+#else /* __ASSEMBLY__ */
+
+/* Drop a C type modifier (like in 3UL) for constants used in assembly. */
+#define _AC(X, Y) X
+
+#endif /* __ASSEMBLY__ */
#ifdef CONFIG_PPC
/*
@@ -948,6 +946,9 @@ int cpu_release(int nr, int argc, char * const argv[]);
/* Put only stuff here that the assembler can digest */
+/* Declare an unsigned long constant digestable both by C and an assembler. */
+#define UL(x) _AC(x, UL)
+
#ifdef CONFIG_POST
#define CONFIG_HAS_POST
#ifndef CONFIG_POST_ALT_LIST