blob: 2092d9e3b6efa559f0af463b29f0ce78f4e760ad [file] [log] [blame]
Mike Frysinger909878f2009-07-09 01:15:05 -04001/*
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 Denka5750b82013-11-19 08:01:44 +010015int bfin_os_log_check(void)
Mike Frysinger909878f2009-07-09 01:15:05 -040016{
17 if (*OS_LOG_MAGIC_ADDR != OS_LOG_MAGIC)
Wolfgang Denka5750b82013-11-19 08:01:44 +010018 return 0;
Mike Frysinger909878f2009-07-09 01:15:05 -040019 *OS_LOG_MAGIC_ADDR = 0;
Wolfgang Denka5750b82013-11-19 08:01:44 +010020 return 1;
Mike Frysinger909878f2009-07-09 01:15:05 -040021}
22
23void 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}