From patchwork Wed Mar 26 13:38:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27125 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7097320062 for ; Wed, 26 Mar 2014 13:40:42 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id j5sf1061783qga.6 for ; Wed, 26 Mar 2014 06:40:42 -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=SatNMk/96YeChLwcV2gY1zLnMXyPfnHyR732/GsFBG0=; b=IU0fsqLf7GGs2kRUmXqFkdOZUW2i81kMDqAiuOZ+wTuDXW0HeCHo/rPiUxTeK07Fk2 axrwaCUnLTafCfo1ox4b9hwMAeX61+a1qAA9IXAtGD0/u58WW+oPfBbasn+FGkcRCNKw pcRRcujiHjMNoOYqwa65EKcy716GWKhL18RUNCvC/LnNHC94XL2KGdpPA0uhqDzlPHLM uLVvmZnBfy/JIwztn+lphZKn/vyIdjfORjTV+ydAMqJofuvdXlfBDC+UiQz1mfzw664k s+TJ7yuBMjqMcS3SCKYt5koUqUskTskkYgDO+OfgDqCAV6GwAJVmupIjx5FdEcYr+2RF 9RIg== X-Gm-Message-State: ALoCoQndFQmmPU2FdY3+uhWvJp5o9rPMMhGgKt5IxfANWNFmXbjEVrd0BbvmPq+dMf7lKXTuLurI X-Received: by 10.236.125.6 with SMTP id y6mr22624864yhh.3.1395841242245; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.73 with SMTP id 67ls611765qga.18.gmail; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) X-Received: by 10.59.7.228 with SMTP id df4mr17080805ved.11.1395841242141; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id w10si3670185vck.212.2014.03.26.06.40.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 06:40:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so2369835veb.27 for ; Wed, 26 Mar 2014 06:40:42 -0700 (PDT) X-Received: by 10.58.94.195 with SMTP id de3mr176180veb.39.1395841242044; Wed, 26 Mar 2014 06:40:42 -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 i9csp47112vck; Wed, 26 Mar 2014 06:40:41 -0700 (PDT) X-Received: by 10.52.170.16 with SMTP id ai16mr58470vdc.69.1395841241639; Wed, 26 Mar 2014 06:40:41 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id xo2si4526730vec.62.2014.03.26.06.40.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Mar 2014 06:40:41 -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 1WSo2k-0004Na-SC; Wed, 26 Mar 2014 13:38:58 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSo2i-0004Ld-Pw for xen-devel@lists.xen.org; Wed, 26 Mar 2014 13:38:56 +0000 Received: from [193.109.254.147:45228] by server-5.bemta-14.messagelabs.com id 32/AD-26413-078D2335; Wed, 26 Mar 2014 13:38:56 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1395841134!4297751!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 2555 invoked from network); 26 Mar 2014 13:38:55 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 26 Mar 2014 13:38:55 -0000 X-IronPort-AV: E=Sophos;i="4.97,735,1389744000"; d="scan'208";a="113732835" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 26 Mar 2014 13:38:54 +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; Wed, 26 Mar 2014 09:38:53 -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 1WSo2f-00074X-Jd; Wed, 26 Mar 2014 13:38:53 +0000 From: Ian Campbell To: Date: Wed, 26 Mar 2014 13:38:42 +0000 Message-ID: <1395841133-2223-7-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395841009.12547.11.camel@kazak.uk.xensource.com> References: <1395841009.12547.11.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v2 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.128.182 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) \