aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNigel Cunningham <nigel@nigel.suspend2.net>2007-07-21 11:10:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-21 21:37:10 -0400
commit44bf4cea43816d43deab73c1c16361e899996eaa (patch)
tree7ed3e6672f6abe3a68a79c77a7af125d0e0dab21 /include
parent9ef231a436fddb34d806f599c97b479691b3c38b (diff)
x86: PM_TRACE support
Signed-off-by: Nigel Cunningham <nigel@nigel.suspend2.net> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/resume-trace.h13
-rw-r--r--include/asm-x86_64/resume-trace.h13
-rw-r--r--include/linux/resume-trace.h19
3 files changed, 31 insertions, 14 deletions
diff --git a/include/asm-i386/resume-trace.h b/include/asm-i386/resume-trace.h
new file mode 100644
index 000000000000..ec9cfd656230
--- /dev/null
+++ b/include/asm-i386/resume-trace.h
@@ -0,0 +1,13 @@
1#define TRACE_RESUME(user) do { \
2 if (pm_trace_enabled) { \
3 void *tracedata; \
4 asm volatile("movl $1f,%0\n" \
5 ".section .tracedata,\"a\"\n" \
6 "1:\t.word %c1\n" \
7 "\t.long %c2\n" \
8 ".previous" \
9 :"=r" (tracedata) \
10 : "i" (__LINE__), "i" (__FILE__)); \
11 generate_resume_trace(tracedata, user); \
12 } \
13} while (0)
diff --git a/include/asm-x86_64/resume-trace.h b/include/asm-x86_64/resume-trace.h
new file mode 100644
index 000000000000..34bf998fdf62
--- /dev/null
+++ b/include/asm-x86_64/resume-trace.h
@@ -0,0 +1,13 @@
1#define TRACE_RESUME(user) do { \
2 if (pm_trace_enabled) { \
3 void *tracedata; \
4 asm volatile("movq $1f,%0\n" \
5 ".section .tracedata,\"a\"\n" \
6 "1:\t.word %c1\n" \
7 "\t.quad %c2\n" \
8 ".previous" \
9 :"=r" (tracedata) \
10 : "i" (__LINE__), "i" (__FILE__)); \
11 generate_resume_trace(tracedata, user); \
12 } \
13} while (0)
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
index 81e9299ca148..f3f4f28c6960 100644
--- a/include/linux/resume-trace.h
+++ b/include/linux/resume-trace.h
@@ -2,6 +2,7 @@
2#define RESUME_TRACE_H 2#define RESUME_TRACE_H
3 3
4#ifdef CONFIG_PM_TRACE 4#ifdef CONFIG_PM_TRACE
5#include <asm/resume-trace.h>
5 6
6extern int pm_trace_enabled; 7extern int pm_trace_enabled;
7 8
@@ -9,20 +10,10 @@ struct device;
9extern void set_trace_device(struct device *); 10extern void set_trace_device(struct device *);
10extern void generate_resume_trace(void *tracedata, unsigned int user); 11extern void generate_resume_trace(void *tracedata, unsigned int user);
11 12
12#define TRACE_DEVICE(dev) set_trace_device(dev) 13#define TRACE_DEVICE(dev) do { \
13#define TRACE_RESUME(user) do { \ 14 if (pm_trace_enabled) \
14 if (pm_trace_enabled) { \ 15 set_trace_device(dev); \
15 void *tracedata; \ 16 } while(0)
16 asm volatile("movl $1f,%0\n" \
17 ".section .tracedata,\"a\"\n" \
18 "1:\t.word %c1\n" \
19 "\t.long %c2\n" \
20 ".previous" \
21 :"=r" (tracedata) \
22 : "i" (__LINE__), "i" (__FILE__)); \
23 generate_resume_trace(tracedata, user); \
24 } \
25} while (0)
26 17
27#else 18#else
28 19