]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- cpuid fixed. prev. version causing segfault with -fpic.
authorPaweł Sikora <pluto@pld-linux.org>
Mon, 29 Mar 2004 13:22:09 +0000 (13:22 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  now it's (non)PIC complaint.

Changed files:
    rpm-cpuid.patch -> 1.1

rpm-cpuid.patch [new file with mode: 0644]

diff --git a/rpm-cpuid.patch b/rpm-cpuid.patch
new file mode 100644 (file)
index 0000000..3b248cd
--- /dev/null
@@ -0,0 +1,93 @@
+--- rpm-4.3/lib/rpmrc.c.orig   2004-03-29 14:43:40.000000000 +0200
++++ rpm-4.3/lib/rpmrc.c        2004-03-29 14:52:50.141270392 +0200
+@@ -893,16 +893,13 @@
+ #ifdef        __LCLINT__
+     *eax = *ebx = *ecx = *edx = 0;
+ #endif
+-#ifdef PIC
+-      __asm__("pushl %%ebx; cpuid; movl %%ebx,%1; popl %%ebx"
+-              : "=a"(*eax), "=g"(*ebx), "=&c"(*ecx), "=&d"(*edx)
+-              : "a" (op));
+-#else
+-      __asm__("cpuid"
+-              : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
+-              : "a" (op));
+-#endif
+-
++    asm volatile (
++      "pushl  %%ebx           \n"
++      "cpuid                  \n"
++      "movl   %%ebx,  %%esi   \n"
++      "popl   %%ebx           \n"
++    : "=a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx)
++    : "a" (op));
+ }
+ /*
+@@ -911,15 +908,8 @@
+ static inline unsigned int cpuid_eax(unsigned int op)
+       /*@*/
+ {
+-      unsigned int val;
+-
+-#ifdef PIC
+-      __asm__("pushl %%ebx; cpuid; popl %%ebx"
+-              : "=a" (val) : "a" (op) : "ecx", "edx");
+-#else
+-      __asm__("cpuid"
+-              : "=a" (val) : "a" (op) : "ebx", "ecx", "edx");
+-#endif
++      unsigned int tmp, val;
++      cpuid(op, &val, &tmp, &tmp, &tmp);
+       return val;
+ }
+@@ -927,14 +917,7 @@
+       /*@*/
+ {
+       unsigned int tmp, val;
+-
+-#ifdef PIC
+-      __asm__("pushl %%ebx; cpuid; movl %%ebx,%1; popl %%ebx"
+-              : "=a" (tmp), "=g" (val) : "a" (op) : "ecx", "edx");
+-#else
+-      __asm__("cpuid"
+-              : "=a" (tmp), "=b" (val) : "a" (op) : "ecx", "edx");
+-#endif
++      cpuid(op, &tmp, &val, &tmp, &tmp);
+       return val;
+ }
+@@ -942,30 +925,16 @@
+       /*@*/
+ {
+       unsigned int tmp, val;
+-#ifdef PIC
+-      __asm__("pushl %%ebx; cpuid; popl %%ebx"
+-              : "=a" (tmp), "=c" (val) : "a" (op) : "edx");
+-#else
+-      __asm__("cpuid"
+-              : "=a" (tmp), "=c" (val) : "a" (op) : "ebx", "edx");
+-#endif
++      cpuid(op, &tmp, &tmp, &val, &tmp);
+       return val;
+-
+ }
+ static inline unsigned int cpuid_edx(unsigned int op)
+       /*@*/
+ {
+       unsigned int tmp, val;
+-#ifdef PIC
+-      __asm__("pushl %%ebx; cpuid; popl %%ebx"
+-              : "=a" (tmp), "=d" (val) : "a" (op) : "ecx");
+-#else
+-      __asm__("cpuid"
+-              : "=a" (tmp), "=d" (val) : "a" (op) : "ebx", "ecx");
+-#endif
++      cpuid(op, &tmp, &tmp, &tmp, &val);
+       return val;
+-
+ }
+ /*@unchecked@*/
This page took 0.09111 seconds and 4 git commands to generate.