Richard Henderson wrote:
> On Fri, Jun 16, 2000 at 09:09:10PM -0400, Tom Leete wrote:
> > In current i386 memcpy is a macro.
> > fails to provide an addressable copy.
If you fall asleep in the first paragraph and wake in the
last, thats the noise you make.
> #define __KERNEL__
> #define EXPORT_SYMTAB
> #include <linux/types.h>
> #include <asm/string.h>
> #include <linux/module.h>
> void *(memcpy)(void *d, const void *s, size_t n)
> return memcpy(d,s,n);
> #undef memcpy
That works too, but I bet it will be rejected for a lack of
explicit inlining. If you can get this accepted please adopt
my Athlon-SMP patch.
> Know that gcc 2.96 *does* inline memcpy. But only when it thinks that
> it's a win. If the two pointers are not known to be suitably aligned,
> it takes about 150 bytes of code to coerce them to be aligned. At
> which point you might as well have called an out-of-line function and
> saved yourself the icache space.
Agreed. Optimizing compilers do this. I'm inclined to go
If you see memcpy called by name, though, it's the wrong
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:14 EST