From patchwork Thu Mar 20 15:45:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 26721 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2E45520143 for ; Thu, 20 Mar 2014 15:48:03 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id fb1sf2613887pad.8 for ; Thu, 20 Mar 2014 08:48:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=wOhCtmhRpY2rSGPykC1rQexF7wP3QNnvCJdwk3QjzUI=; b=L0kkI7Q+KiPKjY7tKqGBGoyZlTJirXQk5PWbn+CKjTZT33aKRnz5XJqErc9f1+5QSh mgG/74Hf+CEmCUXcvPOphKATE1JJoM6r44r2HWT6UGYjrgSRg0zdADLbb0rRt5DDWJwb NRFYnoT3yV+S1HrhEeG/6jYmcbvTCPMLD/SzXf9m4VFQOe8UBNjhpVEmpzKu3P9etKqF wZXHoEiuPwUv7SKltSRMsFhq6E2tcmrIEWb+JNIauRANV1D4K5t75Snb92CJDGxlYLZ1 +6kSHMpEKQeI08FwCSkR8idU9CVRyZH8aAMoq38Y7IF5INqa7PT/9kUoJRHdhqagwGhh Z9zA== X-Gm-Message-State: ALoCoQnLcmhaJrGVU9fhvQpNKoXgJRVC7o7WJZm3oKf2fTVER2jeLmCo0iFHTWuAVqJstdMu9GDG X-Received: by 10.66.149.67 with SMTP id ty3mr17280968pab.27.1395330482334; Thu, 20 Mar 2014 08:48:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.37 with SMTP id e34ls233483qge.4.gmail; Thu, 20 Mar 2014 08:48:02 -0700 (PDT) X-Received: by 10.220.188.70 with SMTP id cz6mr483498vcb.59.1395330482183; Thu, 20 Mar 2014 08:48:02 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id la9si512377veb.92.2014.03.20.08.48.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 08:48:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lc6so1141399vcb.7 for ; Thu, 20 Mar 2014 08:48:02 -0700 (PDT) X-Received: by 10.52.137.74 with SMTP id qg10mr756973vdb.61.1395330482093; Thu, 20 Mar 2014 08:48:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp398579vck; Thu, 20 Mar 2014 08:48:01 -0700 (PDT) X-Received: by 10.140.38.168 with SMTP id t37mr48540619qgt.33.1395330481529; Thu, 20 Mar 2014 08:48:01 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id w16si1360103qge.21.2014.03.20.08.48.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Mar 2014 08:48:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQfAd-0004Cp-Ap; Thu, 20 Mar 2014 15:46:15 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQfAb-0004AJ-PG for xen-devel@lists.xen.org; Thu, 20 Mar 2014 15:46:13 +0000 Received: from [85.158.137.68:59037] by server-9.bemta-3.messagelabs.com id 97/21-30063-54D0B235; Thu, 20 Mar 2014 15:46:13 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1395330370!1925614!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20717 invoked from network); 20 Mar 2014 15:46:12 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 20 Mar 2014 15:46:12 -0000 X-IronPort-AV: E=Sophos;i="4.97,695,1389744000"; d="scan'208";a="111935207" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 20 Mar 2014 15:46:09 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Thu, 20 Mar 2014 11:46:06 -0400 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WQfAU-0006O2-9A; Thu, 20 Mar 2014 15:46:06 +0000 From: Ian Campbell To: Date: Thu, 20 Mar 2014 15:45:55 +0000 Message-ID: <1395330365-9901-7-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395330336.3104.12.camel@kazak.uk.xensource.com> References: <1395330336.3104.12.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 07/17] xen: arm32: add optimised memchr routine X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: This isn't used enough to be critical, but it completes the set of mem*. Taken from Linux v3.14-rc7. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/arm32/lib/Makefile | 2 +- xen/arch/arm/arm32/lib/memchr.S | 28 ++++++++++++++++++++++++++++ xen/include/asm-arm/string.h | 3 +++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 xen/arch/arm/arm32/lib/memchr.S diff --git a/xen/arch/arm/arm32/lib/Makefile b/xen/arch/arm/arm32/lib/Makefile index 4cf41f4..fa4e241 100644 --- a/xen/arch/arm/arm32/lib/Makefile +++ b/xen/arch/arm/arm32/lib/Makefile @@ -1,4 +1,4 @@ -obj-y += memcpy.o memmove.o memset.o memzero.o +obj-y += memcpy.o memmove.o memset.o memchr.o memzero.o obj-y += findbit.o setbit.o obj-y += setbit.o clearbit.o changebit.o obj-y += testsetbit.o testclearbit.o testchangebit.o diff --git a/xen/arch/arm/arm32/lib/memchr.S b/xen/arch/arm/arm32/lib/memchr.S new file mode 100644 index 0000000..fd64ed8 --- /dev/null +++ b/xen/arch/arm/arm32/lib/memchr.S @@ -0,0 +1,28 @@ +/* + * linux/arch/arm/lib/memchr.S + * + * Copyright (C) 1995-2000 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ASM optimised string functions + */ + +#include + +#include "assembler.h" + + .text + .align 5 +ENTRY(memchr) +1: subs r2, r2, #1 + bmi 2f + ldrb r3, [r0], #1 + teq r3, r1 + bne 1b + sub r0, r0, #1 +2: movne r0, #0 + mov pc, lr +ENDPROC(memchr) diff --git a/xen/include/asm-arm/string.h b/xen/include/asm-arm/string.h index abfa9d2..2c9f4f7 100644 --- a/xen/include/asm-arm/string.h +++ b/xen/include/asm-arm/string.h @@ -14,6 +14,9 @@ extern void *memmove(void *dest, const void *src, size_t n); #define __HAVE_ARCH_MEMSET extern void * memset(void *, int, __kernel_size_t); +#define __HAVE_ARCH_MEMCHR +extern void * memchr(const void *, int, __kernel_size_t); + extern void __memzero(void *ptr, __kernel_size_t n); #define memset(p,v,n) \