Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 1 | #ifndef RESUME_TRACE_H |
| 2 | #define RESUME_TRACE_H |
| 3 | |
| 4 | #ifdef CONFIG_PM_TRACE |
| 5 | |
Rafael J. Wysocki | c5c6ba4 | 2006-09-25 23:32:58 -0700 | [diff] [blame] | 6 | extern int pm_trace_enabled; |
| 7 | |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 8 | struct device; |
| 9 | extern void set_trace_device(struct device *); |
| 10 | extern void generate_resume_trace(void *tracedata, unsigned int user); |
| 11 | |
| 12 | #define TRACE_DEVICE(dev) set_trace_device(dev) |
Rafael J. Wysocki | c5c6ba4 | 2006-09-25 23:32:58 -0700 | [diff] [blame] | 13 | #define TRACE_RESUME(user) do { \ |
| 14 | if (pm_trace_enabled) { \ |
| 15 | void *tracedata; \ |
| 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 | } \ |
Linus Torvalds | eb71c87 | 2006-06-24 14:27:42 -0700 | [diff] [blame] | 25 | } while (0) |
| 26 | |
| 27 | #else |
| 28 | |
| 29 | #define TRACE_DEVICE(dev) do { } while (0) |
| 30 | #define TRACE_RESUME(dev) do { } while (0) |
| 31 | |
| 32 | #endif |
| 33 | |
| 34 | #endif |