]> git.sur5r.net Git - u-boot/blobdiff - lib/vsprintf.c
tegra2: Simplify tegra_start() boot path
[u-boot] / lib / vsprintf.c
index c029fbbc48191d58c1afd14c25af8e4ab2bc4971..e497a8686ed321acf5119e290fd32b0fd74ed61d 100644 (file)
@@ -7,6 +7,8 @@
 /* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */
 /*
  * Wirzenius wrote this portably, Torvalds fucked it up :-)
+ *
+ * from hush: simple_itoa() was lifted from boa-0.93.15
  */
 
 #include <stdarg.h>
@@ -730,3 +732,25 @@ void panic(const char *fmt, ...)
        while (1)
                ;
 }
+
+void __assert_fail(const char *assertion, const char *file, unsigned line,
+                  const char *function)
+{
+       /* This will not return */
+       panic("%s:%u: %s: Assertion `%s' failed.", file, line, function,
+             assertion);
+}
+
+char *simple_itoa(ulong i)
+{
+       /* 21 digits plus null terminator, good for 64-bit or smaller ints */
+       static char local[22];
+       char *p = &local[21];
+
+       *p-- = '\0';
+       do {
+               *p-- = '0' + i % 10;
+               i /= 10;
+       } while (i > 0);
+       return p + 1;
+}