Merge tag 'v3.10.55' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / include / mach / paniclog.h
1 #ifndef __MT6575_PANICLOG_H__
2 #define __MT6575_PANICLOG_H__
3
4 #define PANICLOG_BUF_LEN 16384
5 #define PANICLOG_HEADER_SIZE 512
6 #define PANICLOG_SECTION_SIZE (PANICLOG_BUF_LEN) + (PANICLOG_HEADER_SIZE)
7
8 #ifndef __ASSEMBLY__
9
10 #define PANICLOG_VALID_PATTERN 0x90EFABCD
11 #define PANICLOG_BACKTRACE_NUM 4
12 #define PANICLOG_PROCESS_NAME_LENGTH 256
13
14 struct paniclog {
15 int valid; /* log is valid if valid == PANICLOG_VALID_PATTERN */
16 int crc;
17
18 struct {
19 unsigned long bt_where[PANICLOG_BACKTRACE_NUM];
20 unsigned long bt_from[PANICLOG_BACKTRACE_NUM];
21 char process_path[PANICLOG_PROCESS_NAME_LENGTH];
22
23 char buf[PANICLOG_BUF_LEN];
24 int buf_len;
25 } c;
26 };
27
28 extern struct paniclog *paniclog;
29
30 #ifdef CONFIG_PANICLOG
31
32 /* Begin starting panic record */
33 void paniclog_start(void);
34
35 void paniclog_end(void);
36
37 /* Record the task acenstor into current paniclog */
38 void paniclog_ptree_store(struct task_struct *tsk);
39
40 /* Record stack trace info into current paniclog */
41 void paniclog_stack_store(unsigned long where, unsigned long from);
42
43 /* Check if panic log available */
44 int paniclog_is_available(void);
45
46 /* Dump current paniclog to kernel log buffer */
47 void paniclog_dump(void);
48
49 /* Copy the current panic log and clear the panic log before return */
50 void paniclog_copy_and_clear(struct paniclog *log);
51
52 #else
53
54 #define paniclog_start(a)
55
56 #define paniclog_end()
57
58 #define paniclog_ptree_store(tsk)
59
60 #define paniclog_stack_store(where, from)
61
62 #define paniclog_is_available() 0
63
64 #define paniclog_copy_and_clear(log)
65
66 #endif /* CONFIG_PANALOG_LOG */
67
68 #endif /* __ASSEMBLY */
69
70 #endif /* !__MT6575_PANICLOG_H__ */
71