Commit | Line | Data |
---|---|---|
060287b8 AV |
1 | #ifndef __PSTORE_INTERNAL_H__ |
2 | #define __PSTORE_INTERNAL_H__ | |
3 | ||
4 | #include <linux/pstore.h> | |
5 | ||
6 | #if NR_CPUS <= 2 && defined(CONFIG_ARM_THUMB) | |
7 | #define PSTORE_CPU_IN_IP 0x1 | |
8 | #elif NR_CPUS <= 4 && defined(CONFIG_ARM) | |
9 | #define PSTORE_CPU_IN_IP 0x3 | |
10 | #endif | |
11 | ||
12 | struct pstore_ftrace_record { | |
13 | unsigned long ip; | |
14 | unsigned long parent_ip; | |
15 | #ifndef PSTORE_CPU_IN_IP | |
16 | unsigned int cpu; | |
17 | #endif | |
18 | }; | |
19 | ||
20 | static inline void | |
21 | pstore_ftrace_encode_cpu(struct pstore_ftrace_record *rec, unsigned int cpu) | |
22 | { | |
23 | #ifndef PSTORE_CPU_IN_IP | |
24 | rec->cpu = cpu; | |
25 | #else | |
26 | rec->ip |= cpu; | |
27 | #endif | |
28 | } | |
29 | ||
30 | static inline unsigned int | |
31 | pstore_ftrace_decode_cpu(struct pstore_ftrace_record *rec) | |
32 | { | |
33 | #ifndef PSTORE_CPU_IN_IP | |
34 | return rec->cpu; | |
35 | #else | |
36 | return rec->ip & PSTORE_CPU_IN_IP; | |
37 | #endif | |
38 | } | |
39 | ||
40 | extern struct pstore_info *psinfo; | |
41 | ||
366f7e7a | 42 | extern void pstore_set_kmsg_bytes(int); |
6dda9266 | 43 | extern void pstore_get_records(int); |
ca01d6dd TL |
44 | extern int pstore_mkfile(enum pstore_type_id, char *psname, u64 id, |
45 | char *data, size_t size, | |
638c1fd3 | 46 | struct timespec time, struct pstore_info *psi); |
ca01d6dd | 47 | extern int pstore_is_mounted(void); |
060287b8 AV |
48 | |
49 | #endif |