aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-10-28 09:50:50 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-10-28 09:50:50 +0000
commit7a14817d2d032a15d3bafaf7c056281a80cd12fe (patch)
tree10427d0fdc4047c90957d0bceff3ba511d299346 /target
parent4f3acd22a425dab96caf97dc9ae6b3ab36617530 (diff)
downloadupstream-7a14817d2d032a15d3bafaf7c056281a80cd12fe.tar.gz
upstream-7a14817d2d032a15d3bafaf7c056281a80cd12fe.tar.bz2
upstream-7a14817d2d032a15d3bafaf7c056281a80cd12fe.zip
generic: fix crashlog patch for 3.6
kmsg_dump() uses an iterator to receive log buffer content since 3.5. Change the 'crashlog_do_dump' function in order to make it compatible with the new version. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33970 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/patches-3.6/930-crashlog.patch21
1 files changed, 6 insertions, 15 deletions
diff --git a/target/linux/generic/patches-3.6/930-crashlog.patch b/target/linux/generic/patches-3.6/930-crashlog.patch
index 5231907f8b..b5eaba5ed4 100644
--- a/target/linux/generic/patches-3.6/930-crashlog.patch
+++ b/target/linux/generic/patches-3.6/930-crashlog.patch
@@ -43,7 +43,7 @@
--- /dev/null
+++ b/kernel/crashlog.c
-@@ -0,0 +1,190 @@
+@@ -0,0 +1,181 @@
+/*
+ * Crash information logger
+ * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org>
@@ -173,15 +173,12 @@
+}
+
+static void crashlog_do_dump(struct kmsg_dumper *dumper,
-+ enum kmsg_dump_reason reason, const char *s1, unsigned long l1,
-+ const char *s2, unsigned long l2)
++ enum kmsg_dump_reason reason)
+{
-+ unsigned long s1_start, s2_start;
-+ unsigned long l1_cpy, l2_cpy;
+ struct timeval tv;
+ struct module *m;
+ char *buf;
-+ int len;
++ size_t len;
+
+ if (!first)
+ crashlog_printf("\n===================================\n");
@@ -202,17 +199,10 @@
+ }
+
+ buf = (char *)&crashlog_buf->data[crashlog_buf->len];
-+ len = get_maxlen();
+
-+ l2_cpy = min(l2, (unsigned long)len);
-+ l1_cpy = min(l1, (unsigned long)len - l2_cpy);
++ kmsg_dump_get_buffer(dumper, true, buf, get_maxlen(), &len);
+
-+ s2_start = l2 - l2_cpy;
-+ s1_start = l1 - l1_cpy;
-+
-+ memcpy(buf, s1 + s1_start, l1_cpy);
-+ memcpy(buf + l1_cpy, s2 + s2_start, l2_cpy);
-+ crashlog_buf->len += l1_cpy + l2_cpy;
++ crashlog_buf->len += len;
+}
+
+
@@ -228,6 +218,7 @@
+ crashlog_buf->magic = CRASHLOG_MAGIC;
+ crashlog_buf->len = 0;
+
++ dump.max_reason = KMSG_DUMP_OOPS;
+ dump.dump = crashlog_do_dump;
+ kmsg_dump_register(&dump);
+