From owner-svn-src-head@FreeBSD.ORG Sun Feb 2 23:29:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 754FBEFB; Sun, 2 Feb 2014 23:29:52 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 611D810F7; Sun, 2 Feb 2014 23:29:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12NTqF9004705; Sun, 2 Feb 2014 23:29:52 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12NTqbQ004703; Sun, 2 Feb 2014 23:29:52 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201402022329.s12NTqbQ004703@svn.freebsd.org> From: Olivier Houchard Date: Sun, 2 Feb 2014 23:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261419 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 23:29:52 -0000 Author: cognet Date: Sun Feb 2 23:29:51 2014 New Revision: 261419 URL: http://svnweb.freebsd.org/changeset/base/261419 Log: Only use the CPU ID register if SMP is defined. Some non-MPCore armv6 cpu, such as the one found in the RPi, don't have it, and just hang when we try to access it. Modified: head/sys/arm/arm/swtch.S head/sys/arm/include/pcpu.h Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sun Feb 2 22:26:30 2014 (r261418) +++ head/sys/arm/arm/swtch.S Sun Feb 2 23:29:51 2014 (r261419) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); #define DOMAIN_CLIENT 0x01 -#ifdef _ARM_ARCH_6 +#if defined(_ARM_ARCH_6) && defined(SMP) #define GET_PCPU(tmp, tmp2) \ mrc p15, 0, tmp, c0, c0, 5; \ and tmp, tmp, #0xf; \ @@ -240,8 +240,7 @@ ENTRY(cpu_switch) /* Process is now on a processor. */ /* We have a new curthread now so make a note it */ GET_PCPU(r7, r2) - add r7, r7, #PC_CURTHREAD - str r1, [r7] + str r1, [r7, #PC_CURTHREAD] #ifndef ARM_TP_ADDRESS mcr p15, 0, r1, c13, c0, 4 #endif Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Sun Feb 2 22:26:30 2014 (r261418) +++ head/sys/arm/include/pcpu.h Sun Feb 2 23:29:51 2014 (r261419) @@ -65,11 +65,15 @@ extern struct pcpu *pcpup; #define CPU_MASK (0xf) +#ifndef SMP +#define get_pcpu() (pcpup) +#else #define get_pcpu() __extension__ ({ \ int id; \ __asm __volatile("mrc p15, 0, %0, c0, c0, 5" : "=r" (id)); \ (pcpup + (id & CPU_MASK)); \ }) +#endif static inline struct thread * get_curthread(void)