coreboot-kgpe-d16/src/arch/x86
Mathias Krause dd30acdd59 Fix issues with x86 memcpy
The x86 memcpy() implementation did not mention its implicit output
registers ESI, EDI and ECX which might make this code miscompile when
the compiler uses the value of EDI for the return value *after* the 'rep
movsb' has completed. That would break the API of memcpy as this would
return 'dst+len' instead of 'dst'.

Fix this possible bug by removing the wrong comment and listing all
output registers as such (using dummy stack variables that get optimized
away).

Also the leading 'cld' is superflous as the ABI mandates the direction
flag to be cleared all the time when we're in C (see
<http://gcc.gnu.org/gcc-4.3/changes.html>) and we have no ASM call sites
that might require it to be cleared explicitly (SMM might come to mind,
but it clears the DF itself before passing control to the C part of the
SMI handler).

Last but not least fix the prototype to match the one from <string.h>.

Change-Id: I106422d41180c4ed876078cabb26b45e49f3fa93
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Reviewed-on: http://review.coreboot.org/836
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-03-31 20:26:20 +02:00
..
acpi After this has been brought up many times before, rename src/arch/i386 to 2010-12-11 20:33:41 +00:00
boot use movsl for copying resume memory back 2012-03-30 17:58:55 +02:00
include Prepare the BIOS data areas before device init. 2012-03-30 17:51:45 +02:00
init Add support for RAM-less multi-processor init 2012-03-31 11:57:47 +02:00
lib Fix issues with x86 memcpy 2012-03-31 20:26:20 +02:00
llshell After this has been brought up many times before, rename src/arch/i386 to 2010-12-11 20:33:41 +00:00
Kconfig Make PCI CONF2 support a compile time option 2012-03-30 17:45:53 +02:00
Makefile.inc Makefile: rename romstage linking filenames 2012-03-31 11:36:19 +02:00
coreboot_ram.ld After this has been brought up many times before, rename src/arch/i386 to 2010-12-11 20:33:41 +00:00