aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2015-09-17 14:10:12 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2015-09-17 14:10:12 +0000
commit3f3710026224703fd445972d869d601b2e8248f3 (patch)
tree40648a0d91ff4465f10c90ada78705079d0904b2 /graphics
parentaccbd48fdd905aa9a8eeb61d266b910f5530ce36 (diff)
downloadports-3f3710026224703fd445972d869d601b2e8248f3.tar.gz
ports-3f3710026224703fd445972d869d601b2e8248f3.zip
Notes
Diffstat (limited to 'graphics')
-rw-r--r--graphics/appleseed/Makefile1
-rw-r--r--graphics/appleseed/files/patch-src_appleseed_foundation_platform_system.cpp40
2 files changed, 23 insertions, 18 deletions
diff --git a/graphics/appleseed/Makefile b/graphics/appleseed/Makefile
index d55d614b967f..4e5c726a91d4 100644
--- a/graphics/appleseed/Makefile
+++ b/graphics/appleseed/Makefile
@@ -3,6 +3,7 @@
PORTNAME= appleseed
DISTVERSION= 1.2.0-beta
+PORTREVISION= 1
CATEGORIES= graphics
MAINTAINER= danfe@FreeBSD.org
diff --git a/graphics/appleseed/files/patch-src_appleseed_foundation_platform_system.cpp b/graphics/appleseed/files/patch-src_appleseed_foundation_platform_system.cpp
index b6d41306cc28..da6da5c86c95 100644
--- a/graphics/appleseed/files/patch-src_appleseed_foundation_platform_system.cpp
+++ b/graphics/appleseed/files/patch-src_appleseed_foundation_platform_system.cpp
@@ -15,7 +15,7 @@
// Other platforms.
#else
-@@ -421,6 +429,386 @@ uint64 System::get_process_virtual_memor
+@@ -421,6 +429,390 @@ uint64 System::get_process_virtual_memor
return static_cast<uint64>(rss) * sysconf(_SC_PAGESIZE);
}
@@ -43,26 +43,30 @@
+ size_t linesize;
+} mycaches[3];
+
-+// %ebx is used to point to GOT (Global Offset Table) for PIC (Position
-+// Independent Code) on 32-bit x86, so use %edi to preserve %ebx across
-+// the call and %esi when passing CPUID arguments and return values.
++// %ebx may be used to point to GOT (Global Offset Table) for PIC (Position
++// Independent Code) on 32-bit x86, so it must be preserved. Normally
++// compilers handle this implicitly because %ebx is also callee saved, but
++// GCC before 5.0 forbids any use of %ebx with PIC, so it must be performed
++// explicitly. Unfortunately, we need a separate implementation for x86-64
++// to preserve %rbx because 32-bit operations would set the upper 32 bits
++// to zero.
+static inline void
-+cpuid(uint32_t* data)
++cpuid(uint32_t* regs)
+{
-+ asm("movl %%ebx, %%edi\n\t"
-+ "movl %%esi, %%ebx\n\t"
++ asm(
++#if __x86_64__
++ "movq %%rbx, %q1\n\t"
+ "cpuid\n\t"
-+ "movl %%ebx, %%esi\n\t"
-+ "movl %%edi, %%ebx"
-+ : "=a" (data[eax]),
-+ "=S" (data[ebx]),
-+ "=c" (data[ecx]),
-+ "=d" (data[edx])
-+ : "a" (data[eax]),
-+ "S" (data[ebx]),
-+ "c" (data[ecx]),
-+ "d" (data[edx])
-+ : "%edi");
++ "xchgq %%rbx, %q1"
++#else
++ "movl %%ebx, %1\n\t"
++ "cpuid\n\t"
++ "xchgl %%ebx, %1"
++#endif
++ : "+a" (regs[eax]),
++ "=r" (regs[ebx]),
++ "+c" (regs[ecx]),
++ "=d" (regs[edx]));
+}
+
+// For modern CPUs, we use Deterministic Cache Parameters (Function 04h) to