Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Vadim Kuznetsov (vadimk)" <vadimk@g.o>
Subject: gentoo-x86 commit in app-emulation/open-vm-tools/files: checkvm-pie-safety.patch
Date: Sat, 07 Nov 2009 13:46:15 +0000
vadimk      09/11/07 13:46:15

  Added:                checkvm-pie-safety.patch
  Log:
  Bug 200376
  (Portage version: 2.2_rc48/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  app-emulation/open-vm-tools/files/checkvm-pie-safety.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/open-vm-tools/files/checkvm-pie-safety.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/open-vm-tools/files/checkvm-pie-safety.patch?rev=1.1&content-type=text/plain

Index: checkvm-pie-safety.patch
===================================================================
--- a/checkvm/checkvm.c
+++ b/checkvm/checkvm.c
@@ -79,8 +79,16 @@
 {
    uint32 eax, ebx, ecx, edx;
    
-   __asm__ volatile("inl (%%dx)" :
-   	            "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+   __asm__ volatile(
+#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler.
+		    "movl %%ebx, %3    \n\t"
+		    "inl (%%dx)        \n\t"
+		    "xchgl %%ebx, %3   \n\t" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) :
+#else
+		    "inl (%%dx)" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+#endif
 		    "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETVERSION),
 		    "2"(BDOOR_PORT) : "memory");
    version[0] = eax;
@@ -96,8 +104,16 @@
 {
    uint32 eax, ebx, ecx, edx;
    
-   __asm__ volatile("inl (%%dx)" :
-   	            "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+   __asm__ volatile(
+#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler.
+		    "movl %%ebx, %3    \n\t"
+		    "inl (%%dx)        \n\t"
+		    "xchgl %%ebx, %3   \n\t" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) :
+#else
+		    "inl (%%dx)" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+#endif
 		    "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETHWVERSION),
 		    "2"(BDOOR_PORT) : "memory");
    *hwVersion = eax;
@@ -112,8 +128,16 @@
 {
    uint32 eax, ebx, ecx, edx;
    
-   __asm__ volatile("inl (%%dx)" :
-   		    "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+   __asm__ volatile(
+#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler.
+		    "movl %%ebx, %3    \n\t"
+		    "inl (%%dx)        \n\t"
+		    "xchgl %%ebx, %3   \n\t" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) :
+#else
+		    "inl (%%dx)" :
+		    "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
+#endif
 		    "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE),
 		    "2"(BDOOR_PORT) : "memory");
    *screensize = eax;






Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in app-text/wv2: wv2-0.4.2.ebuild ChangeLog
Next by thread:
gentoo-x86 commit in app-emulation/open-vm-tools/files: checkvm-pie-safety.patch
Previous by date:
gentoo-x86 commit in app-text/wv2: wv2-0.4.2.ebuild ChangeLog
Next by date:
gentoo-x86 commit in app-emulation/open-vm-tools: ChangeLog open-vm-tools-0.0.20091015.201664.ebuild


Updated Nov 23, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.