wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 1 | /* |
Igor Lisitsin | 2dc6445 | 2007-04-18 14:55:19 +0400 | [diff] [blame] | 2 | * (C) Copyright 2002-2007 |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 3 | * Detlev Zundel, dzu@denx.de. |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 6 | */ |
| 7 | #ifndef _LOGBUFF_H |
| 8 | #define _LOGBUFF_H |
| 9 | |
| 10 | #ifdef CONFIG_LOGBUFFER |
| 11 | |
Igor Lisitsin | 2dc6445 | 2007-04-18 14:55:19 +0400 | [diff] [blame] | 12 | #define LOGBUFF_MAGIC 0xc0de4ced /* Forced by code, eh! */ |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 13 | #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 Lisitsin | 2dc6445 | 2007-04-18 14:55:19 +0400 | [diff] [blame] | 18 | /* The mapping used here has to be the same as in setup_ext_logbuff () |
| 19 | in linux/kernel/printk */ |
| 20 | |
| 21 | typedef 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 | |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 41 | int drv_logbuff_init (void); |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 42 | void logbuff_init_ptrs (void); |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 43 | void logbuff_log(char *msg); |
| 44 | void logbuff_reset (void); |
Marian Balakowicz | 95d449a | 2008-05-13 15:53:29 +0200 | [diff] [blame] | 45 | unsigned long logbuffer_base (void); |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 46 | |
| 47 | #endif /* CONFIG_LOGBUFFER */ |
| 48 | |
| 49 | #endif /* _LOGBUFF_H */ |