]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_log.c
[PATCH] Clean up Katmai (440SPe) linker script
[u-boot] / common / cmd_log.c
index 8780da5e2904248a23f637728611a244485b782a..042a403026f00fa04b5cadd571ee3246b301d522 100644 (file)
@@ -46,6 +46,8 @@
 #include <post.h>
 #include <logbuff.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_LOGBUFFER)
 
 /* Local prototypes */
@@ -73,7 +75,6 @@ static unsigned long *ext_logged_chars;
    in linux/kernel/printk */
 void logbuff_init_ptrs (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long *ext_tag;
        unsigned long post_word;
        char *s;
@@ -86,8 +87,7 @@ void logbuff_init_ptrs (void)
        post_word = post_word_load();
 #ifdef CONFIG_POST
        /* The post routines have setup the word so we can simply test it */
-       if (((post_word & 0xffff) == POST_POWERON) ||
-           ((post_word & 0xffff) == POST_SLOWTEST)) {
+       if (post_word_load () & POST_COLDBOOT) {
                logged_chars = log_size = log_start = 0;
                *ext_tag = LOGBUFF_MAGIC;
        }
@@ -140,8 +140,6 @@ static void logbuff_puts (const char *s)
 
 void logbuff_log(char *msg)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if ((gd->post_log_word & LOGBUFF_INITIALIZED)) {
                logbuff_printk (msg);
        } else {
@@ -180,7 +178,7 @@ int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        case 2:
                if (strcmp(argv[1],"show") == 0) {
                        for (i=0; i < (log_size&LOGBUFF_MASK); i++) {
-                               s = log_buf+((log_start+i)&LOGBUFF_MASK);
+                               s = (char *)log_buf+((log_start+i)&LOGBUFF_MASK);
                                putc (*s);
                        }
                        return 0;