aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-24 17:27:42 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-24 17:44:01 -0400
commiteb71c87a492b7090ff9e8ac46912c480a1687e38 (patch)
tree1136213dee0f942866b6c2c65de7e7c63ca94fda /include/linux
parentd384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff)
Add some basic resume trace facilities
Considering that there isn't a lot of hw we can depend on during resume, this is about as good as it gets. This is x86-only for now, although the basic concept (and most of the code) will certainly work on almost any platform. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/resume-trace.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
new file mode 100644
index 000000000000..a376bd4ade39
--- /dev/null
+++ b/include/linux/resume-trace.h
@@ -0,0 +1,30 @@
1#ifndef RESUME_TRACE_H
2#define RESUME_TRACE_H
3
4#ifdef CONFIG_PM_TRACE
5
6struct device;
7extern void set_trace_device(struct device *);
8extern void generate_resume_trace(void *tracedata, unsigned int user);
9
10#define TRACE_DEVICE(dev) set_trace_device(dev)
11#define TRACE_RESUME(user) do { \
12 void *tracedata; \
13 asm volatile("movl $1f,%0\n" \
14 ".section .tracedata,\"a\"\n" \
15 "1:\t.word %c1\n" \
16 "\t.long %c2\n" \
17 ".previous" \
18 :"=r" (tracedata) \
19 : "i" (__LINE__), "i" (__FILE__)); \
20 generate_resume_trace(tracedata, user); \
21} while (0)
22
23#else
24
25#define TRACE_DEVICE(dev) do { } while (0)
26#define TRACE_RESUME(dev) do { } while (0)
27
28#endif
29
30#endif