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 | |
| 15 | bool bfin_os_log_check(void) |
| 16 | { |
| 17 | if (*OS_LOG_MAGIC_ADDR != OS_LOG_MAGIC) |
| 18 | return false; |
| 19 | *OS_LOG_MAGIC_ADDR = 0; |
| 20 | return true; |
| 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 | } |