diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-24 14:27:42 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-24 14:44:01 -0700 |
commit | eb71c87a492b7090ff9e8ac46912c480a1687e38 (patch) | |
tree | 1136213dee0f942866b6c2c65de7e7c63ca94fda /include/linux/resume-trace.h | |
parent | d384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff) | |
download | op-kernel-dev-eb71c87a492b7090ff9e8ac46912c480a1687e38.zip op-kernel-dev-eb71c87a492b7090ff9e8ac46912c480a1687e38.tar.gz |
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/resume-trace.h')
-rw-r--r-- | include/linux/resume-trace.h | 30 |
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 0000000..a376bd4 --- /dev/null +++ b/include/linux/resume-trace.h @@ -0,0 +1,30 @@ +#ifndef RESUME_TRACE_H +#define RESUME_TRACE_H + +#ifdef CONFIG_PM_TRACE + +struct device; +extern void set_trace_device(struct device *); +extern void generate_resume_trace(void *tracedata, unsigned int user); + +#define TRACE_DEVICE(dev) set_trace_device(dev) +#define TRACE_RESUME(user) do { \ + void *tracedata; \ + asm volatile("movl $1f,%0\n" \ + ".section .tracedata,\"a\"\n" \ + "1:\t.word %c1\n" \ + "\t.long %c2\n" \ + ".previous" \ + :"=r" (tracedata) \ + : "i" (__LINE__), "i" (__FILE__)); \ + generate_resume_trace(tracedata, user); \ +} while (0) + +#else + +#define TRACE_DEVICE(dev) do { } while (0) +#define TRACE_RESUME(dev) do { } while (0) + +#endif + +#endif |