summaryrefslogtreecommitdiffstats
path: root/arch/blackfin/cpu/os_log.c
blob: 2092d9e3b6efa559f0af463b29f0ce78f4e760ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * functions for handling OS log buffer
 *
 * Copyright (c) 2009 Analog Devices Inc.
 *
 * Licensed under the 2-clause BSD.
 */

#include <common.h>

#define OS_LOG_MAGIC       0xDEADBEEF
#define OS_LOG_MAGIC_ADDR  ((unsigned long *)0x4f0)
#define OS_LOG_PTR_ADDR    ((char **)0x4f4)

int bfin_os_log_check(void)
{
	if (*OS_LOG_MAGIC_ADDR != OS_LOG_MAGIC)
		return 0;
	*OS_LOG_MAGIC_ADDR = 0;
	return 1;
}

void bfin_os_log_dump(void)
{
	char *log = *OS_LOG_PTR_ADDR;
	while (*log) {
		puts(log);
		log += strlen(log) + 1;
	}
}