From patchwork Sun Feb 14 20:12:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Lock X-Patchwork-Id: 45336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 99A04B7C98 for ; Mon, 15 Feb 2010 07:29:16 +1100 (EST) Received: from localhost ([127.0.0.1]:44988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ngl37-0001ZR-9i for incoming@patchwork.ozlabs.org; Sun, 14 Feb 2010 15:26:37 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ngl0I-0000zo-LN for qemu-devel@nongnu.org; Sun, 14 Feb 2010 15:23:42 -0500 Received: from [199.232.76.173] (port=56111 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ngl0I-0000zg-2Q for qemu-devel@nongnu.org; Sun, 14 Feb 2010 15:23:42 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ngl0F-0004ga-SO for qemu-devel@nongnu.org; Sun, 14 Feb 2010 15:23:42 -0500 Received: from gelbbaer.kn-bremen.de ([78.46.108.116]:47903 helo=smtp.kn-bremen.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ngl0F-0004fJ-1w for qemu-devel@nongnu.org; Sun, 14 Feb 2010 15:23:39 -0500 Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 108E51E00770; Sun, 14 Feb 2010 21:23:37 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id o1EKC9Zc097908 for ; Sun, 14 Feb 2010 21:12:09 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id o1EKC9KT097907 for qemu-devel@nongnu.org; Sun, 14 Feb 2010 21:12:09 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Sun, 14 Feb 2010 21:12:09 +0100 To: qemu-devel@nongnu.org Message-ID: <20100214201209.GA97896@triton8.kn-bremen.de> References: <20100214201056.GA97858@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100214201056.GA97858@triton8.kn-bremen.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Submitted by: Andreas Tobler Signed-off-by: Juergen Lock --- a/cache-utils.c +++ b/cache-utils.c @@ -57,6 +57,23 @@ } #endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#include +#include +#include + +static void ppc_init_cacheline_sizes(void) +{ + size_t len = 4; + unsigned cacheline; + + sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0); + + qemu_cache_conf.dcache_bsize = cacheline; + qemu_cache_conf.icache_bsize = cacheline; +} +#endif + #ifdef __linux__ void qemu_cache_utils_init(char **envp) {