]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/i386/kernel/machine_kexec.c
[PATCH] i386/x86-64: fall back to old-style call trace if no unwinding
[linux-2.6-omap-h63xx.git] / arch / i386 / kernel / machine_kexec.c
index 52ed18d8b511d40892be066e7eb91d85269b467f..f73d7374a2ba8db6cd903bc4e316df2ecdb4260b 100644 (file)
 #include <asm/io.h>
 #include <asm/apic.h>
 #include <asm/cpufeature.h>
-
-static inline unsigned long read_cr3(void)
-{
-       unsigned long cr3;
-       asm volatile("movl %%cr3,%0": "=r"(cr3));
-       return cr3;
-}
+#include <asm/desc.h>
+#include <asm/system.h>
 
 #define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE)))
 
@@ -90,34 +85,27 @@ static void identity_map_page(unsigned long address)
 }
 #endif
 
-
 static void set_idt(void *newidt, __u16 limit)
 {
-       unsigned char curidt[6];
+       struct Xgt_desc_struct curidt;
 
        /* ia32 supports unaliged loads & stores */
-       (*(__u16 *)(curidt)) = limit;
-       (*(__u32 *)(curidt +2)) = (unsigned long)(newidt);
+       curidt.size    = limit;
+       curidt.address = (unsigned long)newidt;
 
-       __asm__ __volatile__ (
-               "lidt %0\n"
-               : "=m" (curidt)
-               );
+       load_idt(&curidt);
 };
 
 
 static void set_gdt(void *newgdt, __u16 limit)
 {
-       unsigned char curgdt[6];
+       struct Xgt_desc_struct curgdt;
 
        /* ia32 supports unaligned loads & stores */
-       (*(__u16 *)(curgdt)) = limit;
-       (*(__u32 *)(curgdt +2)) = (unsigned long)(newgdt);
+       curgdt.size    = limit;
+       curgdt.address = (unsigned long)newgdt;
 
-       __asm__ __volatile__ (
-               "lgdt %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
 }