a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * This program is free software; you can redistribute it and/or
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * modify it under the terms of the GNU General Public License as
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * published by the Free Software Foundation; either version 2 of the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * License, or any later version.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * This program is distributed in the hope that it will be useful, but
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * WITHOUT ANY WARRANTY; without even the implied warranty of
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * General Public License for more details.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * You should have received a copy of the GNU General Public License
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * along with this program; if not, write to the Free Software
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Optimised string operations
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copy memory area
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * @v dest Destination address
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * @v src Source address
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * @v len Length
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * @ret dest Destination address
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncvoid * __memcpy ( void *dest, const void *src, size_t len ) {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /* We often do large dword-aligned and dword-length block
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * moves. Using movsl rather than movsb speeds these up by
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * around 32%.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync : "memory" );
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync __asm__ __volatile__ ( "movsw" : "=&D" ( edi ), "=&S" ( esi )
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync __asm__ __volatile__ ( "movsb" : "=&D" ( edi ), "=&S" ( esi )