linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: powerpc commits for 2.6.24
Date: Fri, 12 Oct 2007 12:36:20 +1000	[thread overview]
Message-ID: <20071012023620.GB21056@localhost.localdomain> (raw)
In-Reply-To: <18190.5965.836544.396721@cargo.ozlabs.ibm.com>

One more for you.  This is preparation for the libfdt merge.

Add memchr() to the bootwrapper

This patch adds a memchr() implementation to the bootwrapper.  libfdt
will need this.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Index: working-2.6/arch/powerpc/boot/string.S
===================================================================
--- working-2.6.orig/arch/powerpc/boot/string.S	2007-09-27 18:36:21.000000000 +1000
+++ working-2.6/arch/powerpc/boot/string.S	2007-09-27 18:40:24.000000000 +1000
@@ -219,6 +219,19 @@ backwards_memcpy:
 	mtctr	r7
 	b	1b
 
+	.globl	memchr
+memchr:
+	cmpwi	0,r5,0
+	blelr
+	mtctr	r5
+	addi	r3,r3,-1
+1:	lbzu	r0,1(r3)
+	cmpw	r0,r4
+	beqlr
+	bdnz	1b
+	li	r3,0
+	blr
+
 	.globl	memcmp
 memcmp:
 	cmpwi	0,r5,0
Index: working-2.6/arch/powerpc/boot/string.h
===================================================================
--- working-2.6.orig/arch/powerpc/boot/string.h	2007-09-27 18:40:27.000000000 +1000
+++ working-2.6/arch/powerpc/boot/string.h	2007-09-27 18:40:58.000000000 +1000
@@ -14,6 +14,7 @@ extern size_t strnlen(const char *s, siz
 extern void *memset(void *s, int c, size_t n);
 extern void *memmove(void *dest, const void *src, unsigned long n);
 extern void *memcpy(void *dest, const void *src, unsigned long n);
+extern void *memchr(const void *s, int c, size_t n);
 extern int memcmp(const void *s1, const void *s2, size_t n);
 
 #endif	/* _PPC_BOOT_STRING_H_ */


-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

      parent reply	other threads:[~2007-10-12  2:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11 12:30 powerpc commits for 2.6.24 Paul Mackerras
2007-10-11 12:47 ` Josh Boyer
2007-10-11 22:07   ` Josh Boyer
2007-10-12  8:41     ` Stefan Roese
2007-10-11 12:52 ` Kumar Gala
2007-10-11 12:53   ` Paul Mackerras
2007-10-11 13:14     ` Kumar Gala
2007-10-11 20:55   ` Benjamin Herrenschmidt
2007-10-11 21:06     ` Kumar Gala
2007-10-11 13:19 ` Kumar Gala
2007-10-11 14:16   ` Grant Likely
2007-10-11 15:36   ` Timur Tabi
2007-10-11 17:06     ` Arnd Bergmann
2007-10-11 22:31   ` Paul Mackerras
2007-10-11 22:51     ` Kumar Gala
2007-10-11 14:29 ` Grant Likely
2007-10-11 16:58 ` Olof Johansson
2007-10-12  0:28 ` Michael Ellerman
2007-10-12  0:32   ` Paul Mackerras
2007-10-12  0:37     ` Michael Ellerman
2007-10-12  2:36 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071012023620.GB21056@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).