diff options
| author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-07-31 07:59:42 -0400 |
|---|---|---|
| committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-07-31 08:16:47 -0400 |
| commit | e6db06a53b1dcf4e9da4aba143e2eb4d63418abb (patch) | |
| tree | 10adcecb71c95ce4393c39fa7911d091bcadfe09 /include/linux/kmsg_dump.h | |
| parent | ecc2edd56c49fa31a0a9ed15a7bf810ae79d3b85 (diff) | |
| parent | c56f5c0342dfee11a1a13d2f5bb7618de5b17590 (diff) | |
Merge with upstream to accommodate with thermal changes
This merge is performed to take commit c56f5c0342dfee11a1 ("Thermal: Make
Thermal trip points writeable") out of Linus' tree and then fixup power
supply class. This is needed since thermal stuff added a new argument:
CC drivers/power/power_supply_core.o
drivers/power/power_supply_core.c: In function ‘psy_register_thermal’:
drivers/power/power_supply_core.c:204:6: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default]
include/linux/thermal.h:154:29: note: expected ‘int’ but argument is of type ‘struct power_supply *’
drivers/power/power_supply_core.c:204:6: error: too few arguments to function ‘thermal_zone_device_register’
include/linux/thermal.h:154:29: note: declared here
make[1]: *** [drivers/power/power_supply_core.o] Error 1
make: *** [drivers/power/] Error 2
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'include/linux/kmsg_dump.h')
| -rw-r--r-- | include/linux/kmsg_dump.h | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index 35f7237ec972..2e7a1e032c71 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | * is passed to the kernel. | 21 | * is passed to the kernel. |
| 22 | */ | 22 | */ |
| 23 | enum kmsg_dump_reason { | 23 | enum kmsg_dump_reason { |
| 24 | KMSG_DUMP_UNDEF, | ||
| 24 | KMSG_DUMP_PANIC, | 25 | KMSG_DUMP_PANIC, |
| 25 | KMSG_DUMP_OOPS, | 26 | KMSG_DUMP_OOPS, |
| 26 | KMSG_DUMP_EMERG, | 27 | KMSG_DUMP_EMERG, |
| @@ -31,23 +32,42 @@ enum kmsg_dump_reason { | |||
| 31 | 32 | ||
| 32 | /** | 33 | /** |
| 33 | * struct kmsg_dumper - kernel crash message dumper structure | 34 | * struct kmsg_dumper - kernel crash message dumper structure |
| 34 | * @dump: The callback which gets called on crashes. The buffer is passed | ||
| 35 | * as two sections, where s1 (length l1) contains the older | ||
| 36 | * messages and s2 (length l2) contains the newer. | ||
| 37 | * @list: Entry in the dumper list (private) | 35 | * @list: Entry in the dumper list (private) |
| 36 | * @dump: Call into dumping code which will retrieve the data with | ||
| 37 | * through the record iterator | ||
| 38 | * @max_reason: filter for highest reason number that should be dumped | ||
| 38 | * @registered: Flag that specifies if this is already registered | 39 | * @registered: Flag that specifies if this is already registered |
| 39 | */ | 40 | */ |
| 40 | struct kmsg_dumper { | 41 | struct kmsg_dumper { |
| 41 | void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason, | ||
| 42 | const char *s1, unsigned long l1, | ||
| 43 | const char *s2, unsigned long l2); | ||
| 44 | struct list_head list; | 42 | struct list_head list; |
| 45 | int registered; | 43 | void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason); |
| 44 | enum kmsg_dump_reason max_reason; | ||
| 45 | bool active; | ||
| 46 | bool registered; | ||
| 47 | |||
| 48 | /* private state of the kmsg iterator */ | ||
| 49 | u32 cur_idx; | ||
| 50 | u32 next_idx; | ||
| 51 | u64 cur_seq; | ||
| 52 | u64 next_seq; | ||
| 46 | }; | 53 | }; |
| 47 | 54 | ||
| 48 | #ifdef CONFIG_PRINTK | 55 | #ifdef CONFIG_PRINTK |
| 49 | void kmsg_dump(enum kmsg_dump_reason reason); | 56 | void kmsg_dump(enum kmsg_dump_reason reason); |
| 50 | 57 | ||
| 58 | bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, | ||
| 59 | char *line, size_t size, size_t *len); | ||
| 60 | |||
| 61 | bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, | ||
| 62 | char *line, size_t size, size_t *len); | ||
| 63 | |||
| 64 | bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | ||
| 65 | char *buf, size_t size, size_t *len); | ||
| 66 | |||
| 67 | void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper); | ||
| 68 | |||
| 69 | void kmsg_dump_rewind(struct kmsg_dumper *dumper); | ||
| 70 | |||
| 51 | int kmsg_dump_register(struct kmsg_dumper *dumper); | 71 | int kmsg_dump_register(struct kmsg_dumper *dumper); |
| 52 | 72 | ||
| 53 | int kmsg_dump_unregister(struct kmsg_dumper *dumper); | 73 | int kmsg_dump_unregister(struct kmsg_dumper *dumper); |
| @@ -56,6 +76,33 @@ static inline void kmsg_dump(enum kmsg_dump_reason reason) | |||
| 56 | { | 76 | { |
| 57 | } | 77 | } |
| 58 | 78 | ||
| 79 | static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, | ||
| 80 | bool syslog, const char *line, | ||
| 81 | size_t size, size_t *len) | ||
| 82 | { | ||
| 83 | return false; | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, | ||
| 87 | const char *line, size_t size, size_t *len) | ||
| 88 | { | ||
| 89 | return false; | ||
| 90 | } | ||
| 91 | |||
| 92 | static inline bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | ||
| 93 | char *buf, size_t size, size_t *len) | ||
| 94 | { | ||
| 95 | return false; | ||
| 96 | } | ||
| 97 | |||
| 98 | static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper) | ||
| 99 | { | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper) | ||
| 103 | { | ||
| 104 | } | ||
| 105 | |||
| 59 | static inline int kmsg_dump_register(struct kmsg_dumper *dumper) | 106 | static inline int kmsg_dump_register(struct kmsg_dumper *dumper) |
| 60 | { | 107 | { |
| 61 | return -EINVAL; | 108 | return -EINVAL; |
