From: Matt Mackall <mpm@selenic.com>
To: "Bryan O'Sullivan" <bos@pathscale.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, hch@infradead.org
Subject: Re: [PATCH 2 of 3] memcpy32 for x86_64
Date: Tue, 27 Dec 2005 22:22:32 -0600 [thread overview]
Message-ID: <20051228042232.GC3356@waste.org> (raw)
In-Reply-To: <042b7d9004acd65f6655.1135726916@eng-12.pathscale.com>
On Tue, Dec 27, 2005 at 03:41:56PM -0800, Bryan O'Sullivan wrote:
> Introduce an x86_64-specific memcpy32 routine. The routine is similar
> to memcpy, but is guaranteed to work in units of 32 bits at a time.
>
> Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
>
> diff -r 7b7b442a4d63 -r 042b7d9004ac arch/x86_64/kernel/x8664_ksyms.c
> --- a/arch/x86_64/kernel/x8664_ksyms.c Tue Dec 27 15:41:48 2005 -0800
> +++ b/arch/x86_64/kernel/x8664_ksyms.c Tue Dec 27 15:41:48 2005 -0800
> @@ -150,6 +150,8 @@
> extern void * memcpy(void *,const void *,__kernel_size_t);
> extern void * __memcpy(void *,const void *,__kernel_size_t);
>
> +extern void memcpy32(void *,const void *,__kernel_size_t);
It's better to do an include here. Duplicating prototypes in .c files
is frowned upon (despite the fact that it's already done here).
> +
> EXPORT_SYMBOL(memset);
> EXPORT_SYMBOL(strlen);
> EXPORT_SYMBOL(memmove);
> @@ -164,6 +166,8 @@
> EXPORT_SYMBOL(memcpy);
> EXPORT_SYMBOL(__memcpy);
>
> +EXPORT_SYMBOL_GPL(memcpy32);
> +
We've been steadily moving towards grouping EXPORTs with function
definitions. Do *_ksyms.c exist solely to provide exports for
functions defined in assembly at this point? If so, perhaps we ought
to come up with a suitable export macro for asm files.
> diff -r 7b7b442a4d63 -r 042b7d9004ac arch/x86_64/lib/memcpy32.S
> --- /dev/null Thu Jan 1 00:00:00 1970 +0000
> +++ b/arch/x86_64/lib/memcpy32.S Tue Dec 27 15:41:48 2005 -0800
> @@ -0,0 +1,25 @@
> +/*
> + * Copyright (c) 2003, 2004, 2005 PathScale, Inc.
> + */
> +
> +/*
> + * memcpy32 - Copy a memory block, 32 bits at a time.
> + *
> + * Count is number of dwords; it need not be a qword multiple.
> + * Input:
> + * rdi destination
> + * rsi source
> + * rdx count
> + */
> +
> + .globl memcpy32
> +memcpy32:
> + movl %edx,%ecx
> + shrl $1,%ecx
> + andl $1,%edx
> + rep
> + movsq
> + movl %edx,%ecx
> + rep
> + movsd
> + ret
Any reason this needs its own .S file? One wonders if the
.p2align 4
in memcpy.S is appropriate here too. Splitting rep movsq across two
lines is a little weird to me too, but I see Andi did it too.
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2005-12-28 4:25 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-27 23:41 [PATCH 0 of 3] Add memcpy_toio32, a 32-bit MMIO copy routine Bryan O'Sullivan
2005-12-27 23:41 ` [PATCH 1 of 3] Introduce __memcpy_toio32 Bryan O'Sullivan
2005-12-28 1:10 ` Roland Dreier
2005-12-28 14:40 ` Bryan O'Sullivan
2005-12-28 14:51 ` Matt Mackall
2005-12-30 23:46 ` Adrian Bunk
2005-12-30 23:44 ` Matt Mackall
2005-12-31 0:23 ` Linus Torvalds
2005-12-31 0:31 ` (OT) " Jan Engelhardt
2005-12-31 0:44 ` Linus Torvalds
2005-12-31 21:24 ` Adrian Bunk
2005-12-28 19:23 ` Roland Dreier
2005-12-28 1:11 ` Roland Dreier
2005-12-28 4:07 ` Matt Mackall
2005-12-28 3:52 ` Matt Mackall
2005-12-28 14:47 ` Bryan O'Sullivan
2005-12-28 14:55 ` Matt Mackall
2005-12-28 15:18 ` Geert Uytterhoeven
2005-12-28 15:52 ` Bryan O'Sullivan
2005-12-27 23:41 ` [PATCH 2 of 3] memcpy32 for x86_64 Bryan O'Sullivan
2005-12-28 4:22 ` Matt Mackall [this message]
2005-12-28 7:54 ` Denis Vlasenko
2005-12-28 14:52 ` Bryan O'Sullivan
2006-01-06 9:12 ` Pavel Machek
2006-01-06 16:02 ` Bryan O'Sullivan
2005-12-27 23:41 ` [PATCH 3 of 3] Add memcpy_toio32 to each arch Bryan O'Sullivan
-- strict thread matches above, loose matches on Subject: below --
2006-01-06 20:26 [PATCH 0 of 3] 32-bit MMIO copy routine Bryan O'Sullivan
2006-01-06 20:26 ` [PATCH 2 of 3] memcpy32 for x86_64 Bryan O'Sullivan
2006-01-10 19:53 [PATCH 0 of 3] 32-bit MMIO copy routines, reworked Bryan O'Sullivan
2006-01-10 19:53 ` [PATCH 2 of 3] memcpy32 for x86_64 Bryan O'Sullivan
2006-01-12 8:38 ` Denis Vlasenko
2006-01-12 16:04 ` Bryan O'Sullivan
2006-01-13 9:56 ` Chris Wedgwood
2006-01-13 10:24 ` Denis Vlasenko
2006-01-13 16:21 ` Bryan O'Sullivan
2006-01-11 22:39 [PATCH 0 of 3] MMIO 32-bit copy routine, the final frontier Bryan O'Sullivan
2006-01-11 22:39 ` [PATCH 2 of 3] memcpy32 for x86_64 Bryan O'Sullivan
2006-01-11 23:45 ` Roland Dreier
2006-01-12 0:03 ` Bryan O'Sullivan
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=20051228042232.GC3356@waste.org \
--to=mpm@selenic.com \
--cc=akpm@osdl.org \
--cc=bos@pathscale.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.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