summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-07-24 00:17:48 +0200
committerWolfgang Denk <wd@denx.de>2009-07-27 00:12:32 +0200
commitfcd3c87e495f3c48b70c919869fb1e0b93d4880b (patch)
treeb9840b891a1f27b64714a10d984e9bdc35eeaf2f /include/common.h
parentdeec15b3064d3bb0189aede3c2921fd7ee401a0f (diff)
Make include/common.h usable by assembler code
Commit 70ebf316 factored out the ROUND() macro into include/common.h, not realizing that the primary use of this macro on AT91 systems was in start.S where common.h was not included, and could not be included because it contains a lot of C code which the assembler doesn't understand. This patch wraps such code in common.h in a "#ifndef __ASSEMBLY__" construct, and then adds an include to cpu/arm926ejs/start.S thus solving the problem. Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h37
1 files changed, 20 insertions, 17 deletions
diff --git a/include/common.h b/include/common.h
index 6e689b233..ee174bb2a 100644
--- a/include/common.h
+++ b/include/common.h
@@ -27,6 +27,8 @@
#undef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
+#ifndef __ASSEMBLY__ /* put C only stuff in this section */
+
typedef unsigned char uchar;
typedef volatile unsigned long vu_long;
typedef volatile unsigned short vu_short;
@@ -105,6 +107,9 @@ typedef volatile unsigned char vu_char;
#ifdef CONFIG_BLACKFIN
#include <asm/blackfin.h>
#endif
+#ifdef CONFIG_STATUS_LED
+#include <status_led.h>
+#endif
#include <part.h>
#include <flash.h>
@@ -636,11 +641,9 @@ int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */
/*
* STDIO based functions (can always be used)
*/
-
/* serial stuff */
void serial_printf (const char *fmt, ...)
__attribute__ ((format (__printf__, 1, 2)));
-
/* stdin */
int getc(void);
int tstc(void);
@@ -660,7 +663,6 @@ void vprintf(const char *fmt, va_list args);
/*
* FILE based functions (can only be used AFTER relocation!)
*/
-
#define stdin 0
#define stdout 1
#define stderr 2
@@ -682,14 +684,26 @@ int fgetc(int file);
int pcmcia_init (void);
-#ifdef CONFIG_STATUS_LED
-# include <status_led.h>
-#endif
/*
* Board-specific Platform code can reimplement show_boot_progress () if needed
*/
void show_boot_progress(int val);
+/* Multicore arch functions */
+#ifdef CONFIG_MP
+int cpu_status(int nr);
+int cpu_reset(int nr);
+int cpu_release(int nr, int argc, char *argv[]);
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+/* Put only stuff here that the assembler can digest */
+
+#ifdef CONFIG_POST
+#define CONFIG_HAS_POST
+#endif
+
#ifdef CONFIG_INIT_CRITICAL
#error CONFIG_INIT_CRITICAL is deprecated!
#error Read section CONFIG_SKIP_LOWLEVEL_INIT in README.
@@ -705,15 +719,4 @@ void show_boot_progress(int val);
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
-/* Multicore arch functions */
-#ifdef CONFIG_MP
-int cpu_status(int nr);
-int cpu_reset(int nr);
-int cpu_release(int nr, int argc, char *argv[]);
-#endif
-
-#ifdef CONFIG_POST
-#define CONFIG_HAS_POST
-#endif
-
#endif /* __COMMON_H_ */