]> git.sur5r.net Git - u-boot/blobdiff - include/common.h
pxe: add support for parsing local syslinux files
[u-boot] / include / common.h
index 399363af1c92a994eb80d2cb241aa5454524e13b..7cf15c53b7454278333e695be86ba79d55038419 100644 (file)
@@ -222,6 +222,31 @@ typedef void (interrupt_handler_t)(void *);
 #define MIN(x, y)  min(x, y)
 #define MAX(x, y)  max(x, y)
 
+/*
+ * Return the absolute value of a number.
+ *
+ * This handles unsigned and signed longs, ints, shorts and chars.  For all
+ * input types abs() returns a signed long.
+ *
+ * For 64-bit types, use abs64()
+ */
+#define abs(x) ({                                              \
+               long ret;                                       \
+               if (sizeof(x) == sizeof(long)) {                \
+                       long __x = (x);                         \
+                       ret = (__x < 0) ? -__x : __x;           \
+               } else {                                        \
+                       int __x = (x);                          \
+                       ret = (__x < 0) ? -__x : __x;           \
+               }                                               \
+               ret;                                            \
+       })
+
+#define abs64(x) ({                            \
+               s64 __x = (x);                  \
+               (__x < 0) ? -__x : __x;         \
+       })
+
 #if defined(CONFIG_ENV_IS_EMBEDDED)
 #define TOTAL_MALLOC_LEN       CONFIG_SYS_MALLOC_LEN
 #elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
@@ -284,13 +309,6 @@ int mac_read_from_eeprom(void);
 extern u8 _binary_dt_dtb_start[];      /* embedded device tree blob */
 int set_cpu_clk_info(void);
 
-/*
- * Called when console output is requested before the console is available.
- * The board should do its best to get the character out to the user any way
- * it can.
- */
-void board_pre_console_putc(int ch);
-
 /* common/flash.c */
 void flash_perror (int);
 
@@ -307,6 +325,12 @@ void       doc_probe(unsigned long physadr);
 /* common/cmd_net.c */
 int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
+/* common/cmd_fat.c */
+int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);
+
+/* common/cmd_ext2.c */
+int do_ext2load(cmd_tbl_t *, int, int, char * const []);
+
 /* common/cmd_nvedit.c */
 int    env_init     (void);
 void   env_relocate (void);
@@ -337,6 +361,9 @@ int setenv_addr(const char *varname, const void *addr);
 # include <asm/mach-types.h>
 # include <asm/u-boot-nds32.h>
 #endif /* CONFIG_NDS32 */
+#ifdef CONFIG_MIPS
+# include <asm/u-boot-mips.h>
+#endif /* CONFIG_MIPS */
 
 #ifdef CONFIG_AUTO_COMPLETE
 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
@@ -711,13 +738,6 @@ int gunzip(void *, int, unsigned char *, unsigned long *);
 int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
                                                int stoponerr, int offset);
 
-/* lib/net_utils.c */
-#include <net.h>
-static inline IPaddr_t getenv_IPaddr (char *var)
-{
-       return (string_to_ip(getenv(var)));
-}
-
 /* lib/qsort.c */
 void qsort(void *base, size_t nmemb, size_t size,
           int(*compar)(const void *, const void *));
@@ -786,6 +806,13 @@ void       fputc(int file, const char c);
 int    ftstc(int file);
 int    fgetc(int file);
 
+/* lib/net_utils.c */
+#include <net.h>
+static inline IPaddr_t getenv_IPaddr(char *var)
+{
+       return string_to_ip(getenv(var));
+}
+
 /*
  * CONSOLE multiplexing.
  */
@@ -801,6 +828,10 @@ int        pcmcia_init (void);
 
 #include <bootstage.h>
 
+#ifdef CONFIG_SHOW_ACTIVITY
+void show_activity(int arg);
+#endif
+
 /* Multicore arch functions */
 #ifdef CONFIG_MP
 int cpu_status(int nr);