NetBSD Problem Report #48865

From www@NetBSD.org  Mon Jun  2 21:22:15 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 55AE0A6568
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  2 Jun 2014 21:22:15 +0000 (UTC)
Message-Id: <20140602212213.36B10A6575@mollari.NetBSD.org>
Date: Mon,  2 Jun 2014 21:22:13 +0000 (UTC)
From: netbsd@i3enedek.neomailbox.net
Reply-To: netbsd@i3enedek.neomailbox.net
To: gnats-bugs@NetBSD.org
Subject: pkg qemu0 patch required to set cacheline sizes
X-Send-Pr-Version: www-1.0

>Number:         48865
>Category:       pkg
>Synopsis:       pkg qemu0 patch required to set cacheline sizes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 02 21:25:00 +0000 2014
>Closed-Date:    Mon May 30 00:05:15 +0000 2016
>Last-Modified:  Mon May 30 00:05:15 +0000 2016
>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);

>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48865 CVS commit: pkgsrc/emulators/qemu0
Date: Sat, 27 Dec 2014 01:53:55 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Sat Dec 27 01:53:55 UTC 2014

 Modified Files:
 	pkgsrc/emulators/qemu0: distinfo
 Added Files:
 	pkgsrc/emulators/qemu0/patches: patch-cache-utils.c

 Log Message:
 Add NetBSD support for PowerPC cache line handling. From Ben Gergely
 in PR 48865.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/emulators/qemu0/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/emulators/qemu0/patches/patch-cache-utils.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 27 Dec 2014 02:37:46 +0000
State-Changed-Why:
committed a slightly different version; please check that I didn't
screw it up.


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 30 May 2016 00:05:15 +0000
State-Changed-Why:
feedback timeout.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.