Add faster, architecture dependent memcpy()
Change-Id: I38d15f3f1ec65f0cb7974d2dd4ae6356433bddd8 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: http://review.coreboot.org/736 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
This commit is contained in:
committed by
Stefan Reinauer
parent
19e7e7d2e7
commit
0054afa11d
@@ -76,6 +76,10 @@ config CMOS_DEFAULT_FILE
|
||||
config BOOTBLOCK_SOUTHBRIDGE_INIT
|
||||
string
|
||||
|
||||
config HAVE_ARCH_MEMCPY
|
||||
bool
|
||||
default y
|
||||
|
||||
config BIG_ENDIAN
|
||||
bool
|
||||
default n
|
||||
|
@@ -8,8 +8,12 @@ ramstage-$(CONFIG_MMCONF_SUPPORT) += pci_ops_mmconf.c
|
||||
ramstage-y += pci_ops_auto.c
|
||||
ramstage-y += exception.c
|
||||
ramstage-$(CONFIG_IOAPIC) += ioapic.c
|
||||
ramstage-y += memcpy.c
|
||||
|
||||
romstage-y += romstage_console.c
|
||||
romstage-y += cbfs_and_run.c
|
||||
romstage-y += memcpy.c
|
||||
|
||||
smm-y += memcpy.c
|
||||
|
||||
$(obj)/arch/x86/lib/console.ramstage.o :: $(obj)/build.h
|
||||
|
13
src/arch/x86/lib/memcpy.c
Normal file
13
src/arch/x86/lib/memcpy.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <string.h>
|
||||
|
||||
void *memcpy(void *__restrict __dest,
|
||||
__const void *__restrict __src, size_t __n)
|
||||
{
|
||||
asm("cld\n"
|
||||
"rep\n"
|
||||
"movsb"
|
||||
: /* no input (?) */
|
||||
:"S"(__src), "D"(__dest), "c"(__n)
|
||||
);
|
||||
return __dest;
|
||||
}
|
Reference in New Issue
Block a user