x86: move tracedata to RODATA
authorJan Beulich <jbeulich@novell.com>
Mon, 12 May 2008 13:44:41 +0000 (15:44 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 25 May 2008 05:09:47 +0000 (07:09 +0200)
.. allowing it to be write-protected just as other read-only data
under CONFIG_DEBUG_RODATA.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/vmlinux_32.lds.S
arch/x86/kernel/vmlinux_64.lds.S
drivers/base/power/trace.c
include/asm-generic/vmlinux.lds.h
include/asm-x86/resume-trace.h
include/linux/resume-trace.h

index ce5ed083a1e905e463486e8f05e9125d2f41d157..2674f57962756a3dbb5e609dae3d8442b7d143c3 100644 (file)
@@ -60,13 +60,6 @@ SECTIONS
 
   BUG_TABLE :text
 
-  . = ALIGN(4);
-  .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
-       __tracedata_start = .;
-       *(.tracedata)
-       __tracedata_end = .;
-  }
-
   RODATA
 
   /* writeable */
index fad3674b06a58f990cabab44bd61910f975a6682..687041bfbae5fdb14054a4f9e8599292ad9b9477 100644 (file)
@@ -53,13 +53,6 @@ SECTIONS
 
   RODATA
 
-  . = ALIGN(4);
-  .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
-       __tracedata_start = .;
-       *(.tracedata)
-       __tracedata_end = .;
-  }
-
   . = ALIGN(PAGE_SIZE);                /* Align data segment to page size boundary */
                                /* Data */
   .data : AT(ADDR(.data) - LOAD_OFFSET) {
index 2b4b392dcbc1761339db874b4f9a02a5b49305c0..87a7f1d02578f194c821eb26049cbaafcf46a54c 100644 (file)
@@ -153,7 +153,7 @@ EXPORT_SYMBOL(set_trace_device);
  * it's not any guarantee, but it's a high _likelihood_ that
  * the match is valid).
  */
-void generate_resume_trace(void *tracedata, unsigned int user)
+void generate_resume_trace(const void *tracedata, unsigned int user)
 {
        unsigned short lineno = *(unsigned short *)tracedata;
        const char *file = *(const char **)(tracedata + 2);
index f054778e916c08e0b1e7cc85dd028de15b21edb2..f1992dc5c4248a21a6c71f7a546fdb21527d72a5 100644 (file)
@@ -93,6 +93,8 @@
                VMLINUX_SYMBOL(__end_rio_route_ops) = .;                \
        }                                                               \
                                                                        \
+       TRACEDATA                                                       \
+                                                                       \
        /* Kernel symbol table: Normal symbols */                       \
        __ksymtab         : AT(ADDR(__ksymtab) - LOAD_OFFSET) {         \
                VMLINUX_SYMBOL(__start___ksymtab) = .;                  \
                __stop___bug_table = .;                                 \
        }
 
+#ifdef CONFIG_PM_TRACE
+#define TRACEDATA                                                      \
+       . = ALIGN(4);                                                   \
+       .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {               \
+               __tracedata_start = .;                                  \
+               *(.tracedata)                                           \
+               __tracedata_end = .;                                    \
+       }
+#else
+#define TRACEDATA
+#endif
+
 #define NOTES                                                          \
        .notes : AT(ADDR(.notes) - LOAD_OFFSET) {                       \
                VMLINUX_SYMBOL(__start_notes) = .;                      \
index 2557514d7ef646cc066d976b1805b141fc685f83..8d9f0b41ee86ca40f7f9b19d02f43c76348e1069 100644 (file)
@@ -6,7 +6,7 @@
 #define TRACE_RESUME(user)                                     \
 do {                                                           \
        if (pm_trace_enabled) {                                 \
-               void *tracedata;                                \
+               const void *tracedata;                          \
                asm volatile(_ASM_MOV_UL " $1f,%0\n"            \
                             ".section .tracedata,\"a\"\n"      \
                             "1:\t.word %c1\n\t"                \
index f3f4f28c6960cfabce8efd60f974f8d6dfd7eb62..c9ba2fdf807d5cbca878d5873ef38ca50332a201 100644 (file)
@@ -8,7 +8,7 @@ extern int pm_trace_enabled;
 
 struct device;
 extern void set_trace_device(struct device *);
-extern void generate_resume_trace(void *tracedata, unsigned int user);
+extern void generate_resume_trace(const void *tracedata, unsigned int user);
 
 #define TRACE_DEVICE(dev) do { \
        if (pm_trace_enabled) \