]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/common.h
NAND: Fix integer overflow in ONFI detection of chips >= 4GiB
[people/ms/u-boot.git] / include / common.h
index 0686a173d52bc5120a2a281dd3d31c682b94f78c..21c05db3f47e110e3e2e93f807399016bc1fda76 100644 (file)
@@ -35,6 +35,7 @@ typedef volatile unsigned short vu_short;
 typedef volatile unsigned char vu_char;
 
 #include <config.h>
+#include <asm-offsets.h>
 #include <linux/bitops.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -179,11 +180,13 @@ typedef void (interrupt_handler_t)(void *);
  * General Purpose Utilities
  */
 #define min(X, Y)                              \
-       ({ typeof (X) __x = (X), __y = (Y);     \
+       ({ typeof (X) __x = (X);                \
+               typeof (Y) __y = (Y);           \
                (__x < __y) ? __x : __y; })
 
 #define max(X, Y)                              \
-       ({ typeof (X) __x = (X), __y = (Y);     \
+       ({ typeof (X) __x = (X);                \
+               typeof (Y) __y = (Y);           \
                (__x > __y) ? __x : __y; })
 
 #define MIN(x, y)  min(x, y)
@@ -269,9 +272,9 @@ int setenv       (char *, char *);
 # include <asm/setup.h>
 # include <asm/u-boot-arm.h>   /* ARM version to be fixed! */
 #endif /* CONFIG_ARM */
-#ifdef CONFIG_I386             /* x86 version to be fixed! */
-# include <asm/u-boot-i386.h>
-#endif /* CONFIG_I386 */
+#ifdef CONFIG_X86              /* x86 version to be fixed! */
+# include <asm/u-boot-x86.h>
+#endif /* CONFIG_X86 */
 
 #ifdef CONFIG_AUTO_COMPLETE
 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
@@ -537,6 +540,10 @@ ulong      get_ddr_freq  (ulong);
 #if defined(CONFIG_MPC86xx)
 typedef MPC86xx_SYS_INFO sys_info_t;
 void   get_sys_info  ( sys_info_t * );
+static inline ulong get_ddr_freq(ulong dummy)
+{
+       return get_bus_freq(dummy);
+}
 #endif
 
 #if defined(CONFIG_4xx) || defined(CONFIG_IOP480)
@@ -631,6 +638,7 @@ static inline IPaddr_t getenv_IPaddr (char *var)
 /* lib/qsort.c */
 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);
@@ -646,7 +654,7 @@ int sprintf(char * buf, const char *fmt, ...)
 int    vsprintf(char *buf, const char *fmt, va_list args);
 
 /* lib/strmhz.c */
-char * strmhz(char *buf, long hz);
+char * strmhz(char *buf, unsigned long hz);
 
 /* lib/crc32.c */
 #include <u-boot/crc.h>
@@ -654,7 +662,7 @@ char *      strmhz(char *buf, long hz);
 /* common/console.c */
 int    console_init_f(void);   /* Before relocation; uses the serial  stuff    */
 int    console_init_r(void);   /* After  relocation; uses the console stuff    */
-int    console_assign (int file, char *devname);       /* Assign the console   */
+int    console_assign(int file, const char *devname);  /* Assign the console   */
 int    ctrlc (void);
 int    had_ctrlc (void);       /* have we had a Control-C since last clear? */
 void   clear_ctrlc (void);     /* clear the Control-C condition */