diff options
Diffstat (limited to 'main/gdb/cpuid-pic.patch')
-rw-r--r-- | main/gdb/cpuid-pic.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/main/gdb/cpuid-pic.patch b/main/gdb/cpuid-pic.patch new file mode 100644 index 0000000000..e250a95098 --- /dev/null +++ b/main/gdb/cpuid-pic.patch @@ -0,0 +1,41 @@ +--- ./gdb/common/linux-btrace.c.orig 2013-04-29 07:44:49.320273451 +0000 ++++ ./gdb/common/linux-btrace.c 2013-04-29 08:05:02.111631215 +0000 +@@ -342,10 +342,12 @@ + #if defined __i386__ || defined __x86_64__ + unsigned int cpuid, model, family; + +- __asm__ __volatile__ ("movl $1, %%eax;" ++ __asm__ __volatile__ ("movl %%ebx, %%edi;" ++ "movl $1, %%eax;" + "cpuid;" ++ "movl %%edi, %%ebx;" + : "=a" (cpuid) +- :: "%ebx", "%ecx", "%edx"); ++ :: "%ecx", "%edx", "%edi"); + + family = (cpuid >> 8) & 0xf; + model = (cpuid >> 4) & 0xf; +@@ -392,7 +394,8 @@ + #if defined __i386__ || defined __x86_64__ + char vendor[13]; + +- __asm__ __volatile__ ("xorl %%ebx, %%ebx;" ++ __asm__ __volatile__ ("movl %%ebx, %%edi;" ++ "xorl %%ebx, %%ebx;" + "xorl %%ecx, %%ecx;" + "xorl %%edx, %%edx;" + "movl $0, %%eax;" +@@ -400,11 +403,12 @@ + "movl %%ebx, %0;" + "movl %%edx, %1;" + "movl %%ecx, %2;" ++ "movl %%edi, %%ebx;" + : "=m" (vendor[0]), + "=m" (vendor[4]), + "=m" (vendor[8]) + : +- : "%eax", "%ebx", "%ecx", "%edx"); ++ : "%eax", "%ecx", "%edx", "%edi"); + vendor[12] = '\0'; + + if (strcmp (vendor, "GenuineIntel") == 0) |