uboot/include/logbuff.h
<<
>>
Prefs
   1/*
   2 * (C) Copyright 2002-2007
   3 * Detlev Zundel, dzu@denx.de.
   4 *
   5 * SPDX-License-Identifier:     GPL-2.0+
   6 */
   7#ifndef _LOGBUFF_H
   8#define _LOGBUFF_H
   9
  10#ifdef CONFIG_LOGBUFFER
  11
  12#define LOGBUFF_MAGIC   0xc0de4ced      /* Forced by code, eh!  */
  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
  18/* 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
  41int drv_logbuff_init (void);
  42void logbuff_init_ptrs (void);
  43void logbuff_log(char *msg);
  44void logbuff_reset (void);
  45unsigned long logbuffer_base (void);
  46
  47#endif /* CONFIG_LOGBUFFER */
  48
  49#endif /* _LOGBUFF_H */
  50