blob: 625feb9f95a09491477a8c42a6f65f82d130de96 [file] [log] [blame]
wdenk56f94be2002-11-05 16:35:14 +00001/*
Igor Lisitsin93470f22007-04-18 14:55:19 +04002 * (C) Copyright 2002-2007
wdenk56f94be2002-11-05 16:35:14 +00003 * Detlev Zundel, dzu@denx.de.
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk56f94be2002-11-05 16:35:14 +00006 */
7#ifndef _LOGBUFF_H
8#define _LOGBUFF_H
9
10#ifdef CONFIG_LOGBUFFER
11
Igor Lisitsin93470f22007-04-18 14:55:19 +040012#define LOGBUFF_MAGIC 0xc0de4ced /* Forced by code, eh! */
wdenk9dfa8d12002-12-08 09:53:23 +000013#define LOGBUFF_LEN (16384) /* Must be 16k right now */
14#define LOGBUFF_MASK (LOGBUFF_LEN-1)
15#define LOGBUFF_OVERHEAD (4096) /* Logbuffer overhead for extra info */
16#define LOGBUFF_RESERVE (LOGBUFF_LEN+LOGBUFF_OVERHEAD)
17
Igor Lisitsin93470f22007-04-18 14:55:19 +040018/* The mapping used here has to be the same as in setup_ext_logbuff ()
19 in linux/kernel/printk */
20
21typedef struct {
22 union {
23 struct {
24 unsigned long tag;
25 unsigned long start;
26 unsigned long con;
27 unsigned long end;
28 unsigned long chars;
29 } v2;
30 struct {
31 unsigned long dummy;
32 unsigned long tag;
33 unsigned long start;
34 unsigned long size;
35 unsigned long chars;
36 } v1;
37 };
38 unsigned char buf[0];
39} logbuff_t;
40
wdenk56f94be2002-11-05 16:35:14 +000041int drv_logbuff_init (void);
wdenk9dfa8d12002-12-08 09:53:23 +000042void logbuff_init_ptrs (void);
wdenk56f94be2002-11-05 16:35:14 +000043void logbuff_log(char *msg);
44void logbuff_reset (void);
Marian Balakowicz902ce702008-05-13 15:53:29 +020045unsigned long logbuffer_base (void);
wdenk56f94be2002-11-05 16:35:14 +000046
47#endif /* CONFIG_LOGBUFFER */
48
49#endif /* _LOGBUFF_H */