Mike Frysinger | 0897589 | 2009-07-09 01:15:05 -0400 | [diff] [blame] | 1 | /* |
| 2 | * functions for handling OS log buffer |
| 3 | * |
| 4 | * Copyright (c) 2009 Analog Devices Inc. |
| 5 | * |
| 6 | * Licensed under the 2-clause BSD. |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | |
| 11 | #define OS_LOG_MAGIC 0xDEADBEEF |
| 12 | #define OS_LOG_MAGIC_ADDR ((unsigned long *)0x4f0) |
| 13 | #define OS_LOG_PTR_ADDR ((char **)0x4f4) |
| 14 | |
Wolfgang Denk | 9655c93 | 2013-11-19 08:01:44 +0100 | [diff] [blame] | 15 | int bfin_os_log_check(void) |
Mike Frysinger | 0897589 | 2009-07-09 01:15:05 -0400 | [diff] [blame] | 16 | { |
| 17 | if (*OS_LOG_MAGIC_ADDR != OS_LOG_MAGIC) |
Wolfgang Denk | 9655c93 | 2013-11-19 08:01:44 +0100 | [diff] [blame] | 18 | return 0; |
Mike Frysinger | 0897589 | 2009-07-09 01:15:05 -0400 | [diff] [blame] | 19 | *OS_LOG_MAGIC_ADDR = 0; |
Wolfgang Denk | 9655c93 | 2013-11-19 08:01:44 +0100 | [diff] [blame] | 20 | return 1; |
Mike Frysinger | 0897589 | 2009-07-09 01:15:05 -0400 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | void bfin_os_log_dump(void) |
| 24 | { |
| 25 | char *log = *OS_LOG_PTR_ADDR; |
| 26 | while (*log) { |
| 27 | puts(log); |
| 28 | log += strlen(log) + 1; |
| 29 | } |
| 30 | } |