]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/i386/kernel/machine_kexec.c
[PATCH] lockdep: improve debug output
[linux-2.6-omap-h63xx.git] / arch / i386 / kernel / machine_kexec.c
index cb699a2aa1f84a915c8a1105fe66f19548adec10..511abe52a94e861a2ad2051dd72e072a131db30c 100644 (file)
 #include <asm/apic.h>
 #include <asm/cpufeature.h>
 #include <asm/desc.h>
-
-static inline unsigned long read_cr3(void)
-{
-       unsigned long cr3;
-       asm volatile("movl %%cr3,%0": "=r"(cr3));
-       return cr3;
-}
+#include <asm/system.h>
 
 #define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE)))
 
@@ -99,10 +93,7 @@ static void set_idt(void *newidt, __u16 limit)
        curidt.size    = limit;
        curidt.address = (unsigned long)newidt;
 
-       __asm__ __volatile__ (
-               "lidtl %0\n"
-               : : "m" (curidt)
-               );
+       load_idt(&curidt);
 };
 
 
@@ -114,10 +105,7 @@ static void set_gdt(void *newgdt, __u16 limit)
        curgdt.size    = limit;
        curgdt.address = (unsigned long)newgdt;
 
-       __asm__ __volatile__ (
-               "lgdtl %0\n"
-               : : "m" (curgdt)
-               );
+       load_gdt(&curgdt);
 };
 
 static void load_segments(void)
@@ -128,13 +116,13 @@ static void load_segments(void)
        __asm__ __volatile__ (
                "\tljmp $"STR(__KERNEL_CS)",$1f\n"
                "\t1:\n"
-               "\tmovl $"STR(__KERNEL_DS)",%eax\n"
-               "\tmovl %eax,%ds\n"
-               "\tmovl %eax,%es\n"
-               "\tmovl %eax,%fs\n"
-               "\tmovl %eax,%gs\n"
-               "\tmovl %eax,%ss\n"
-               );
+               "\tmovl $"STR(__KERNEL_DS)",%%eax\n"
+               "\tmovl %%eax,%%ds\n"
+               "\tmovl %%eax,%%es\n"
+               "\tmovl %%eax,%%fs\n"
+               "\tmovl %%eax,%%gs\n"
+               "\tmovl %%eax,%%ss\n"
+               ::: "eax", "memory");
 #undef STR
 #undef __STR
 }
@@ -145,9 +133,9 @@ typedef asmlinkage NORET_TYPE void (*relocate_new_kernel_t)(
                                        unsigned long start_address,
                                        unsigned int has_pae) ATTRIB_NORET;
 
-const extern unsigned char relocate_new_kernel[];
+extern const unsigned char relocate_new_kernel[];
 extern void relocate_new_kernel_end(void);
-const extern unsigned int relocate_new_kernel_size;
+extern const unsigned int relocate_new_kernel_size;
 
 /*
  * A architecture hook called to validate the