pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48865: pkg qemu0 patch required to set cacheline sizes



>Number:         48865
>Category:       pkg
>Synopsis:       pkg qemu0 patch required to set cacheline sizes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 02 21:25:00 +0000 2014
>Originator:     Ben Gergely
>Release:        pkgsrc -current
>Organization:
>Environment:
NetBSD Spackintosh 6.99.43 NetBSD 6.99.43 (PISMO) #0: Thu May 29 01:51:35 UTC 
2014  root@Spackintosh:/usr/src/sys/arch/macppc/compile/PISMO macppc
>Description:
qemu-0.15.1/cache-utils.c does not enumerate the cache line size on NetBSD.


>How-To-Repeat:
cd /usr/pkgsrc/emulators/qemu0 ; make
>Fix:
$NetBSD$

--- ./work/qemu-0.15.1/cache-utils.c    2011-10-12 16:41:43.000000000 +0000
+++ /tmp/cache-utils.c
@@ -57,7 +57,7 @@ static void ppc_init_cacheline_sizes(voi
 }
 #endif

-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -69,8 +69,11 @@ static void ppc_init_cacheline_sizes(voi
 {
     size_t len = 4;
     unsigned cacheline;
-
+#if defined(__FreeBSD__)
     if (sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0)) {
+#elif defined(__NetBSD__)
+    if (sysctlbyname ("machdep.cachelinesize", &cacheline, &len, NULL, 0)) {
+#endif
         fprintf(stderr, "sysctlbyname machdep.cacheline_size failed: %s\n",
                 strerror(errno));
         exit(1);



Home | Main Index | Thread Index | Old Index