From owner-svn-src-all@FreeBSD.ORG Fri May 15 18:07:58 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB799E2B; Fri, 15 May 2015 18:07:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9E731E83; Fri, 15 May 2015 18:07:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4FI7wiN088676; Fri, 15 May 2015 18:07:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4FI7w2B088675; Fri, 15 May 2015 18:07:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505151807.t4FI7w2B088675@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 15 May 2015 18:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282983 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2015 18:07:58 -0000 Author: ian Date: Fri May 15 18:07:58 2015 New Revision: 282983 URL: https://svnweb.freebsd.org/changeset/base/282983 Log: Retrieve the cache parms in the proper arch-specific way. Submitted by: Michal Meloun Modified: head/sys/arm/arm/cpuinfo.c Modified: head/sys/arm/arm/cpuinfo.c ============================================================================== --- head/sys/arm/arm/cpuinfo.c Fri May 15 18:04:49 2015 (r282982) +++ head/sys/arm/arm/cpuinfo.c Fri May 15 18:07:58 2015 (r282983) @@ -131,8 +131,17 @@ cpuinfo_init(void) cpuinfo.security_ext = (cpuinfo.id_pfr1 >> 4) & 0xF; /* L1 Cache sizes */ - cpuinfo.dcache_line_size = 1 << (CPU_CT_DMINLINE(cpuinfo.ctr ) + 2); + if (CPU_CT_FORMAT(cpuinfo.ctr) == CPU_CT_ARMV7) { + cpuinfo.dcache_line_size = + 1 << (CPU_CT_DMINLINE(cpuinfo.ctr) + 2); + cpuinfo.icache_line_size = + 1 << (CPU_CT_IMINLINE(cpuinfo.ctr) + 2); + } else { + cpuinfo.dcache_line_size = + 1 << (CPU_CT_xSIZE_LEN(CPU_CT_DSIZE(cpuinfo.ctr)) + 3); + cpuinfo.icache_line_size = + 1 << (CPU_CT_xSIZE_LEN(CPU_CT_ISIZE(cpuinfo.ctr)) + 3); + } cpuinfo.dcache_line_mask = cpuinfo.dcache_line_size - 1; - cpuinfo.icache_line_size= 1 << (CPU_CT_IMINLINE(cpuinfo.ctr ) + 2); cpuinfo.icache_line_mask = cpuinfo.icache_line_size - 1; }