/* ----------------------------------------------------------------------- *1*2* Copyright (C) 1991, 1992 Linus Torvalds3* Copyright 2007 rPath, Inc. - All Rights Reserved4*5* This file is part of the Linux kernel, and is made available under6* the terms of the GNU General Public License version 2.7*8* ----------------------------------------------------------------------- */910#include <linux/linkage.h>1112/*13* Memory copy routines14*/1516.code16gcc17.text1819GLOBAL(memcpy)20pushw %si21pushw %di22movw %ax, %di23movw %dx, %si24pushw %cx25shrw $2, %cx26rep; movsl27popw %cx28andw $3, %cx29rep; movsb30popw %di31popw %si32ret33ENDPROC(memcpy)3435GLOBAL(memset)36pushw %di37movw %ax, %di38movzbl %dl, %eax39imull $0x01010101,%eax40pushw %cx41shrw $2, %cx42rep; stosl43popw %cx44andw $3, %cx45rep; stosb46popw %di47ret48ENDPROC(memset)4950GLOBAL(copy_from_fs)51pushw %ds52pushw %fs53popw %ds54call memcpy55popw %ds56ret57ENDPROC(copy_from_fs)5859GLOBAL(copy_to_fs)60pushw %es61pushw %fs62popw %es63call memcpy64popw %es65ret66ENDPROC(copy_to_fs)6768#if 0 /* Not currently used, but can be enabled as needed */69GLOBAL(copy_from_gs)70pushw %ds71pushw %gs72popw %ds73call memcpy74popw %ds75ret76ENDPROC(copy_from_gs)7778GLOBAL(copy_to_gs)79pushw %es80pushw %gs81popw %es82call memcpy83popw %es84ret85ENDPROC(copy_to_gs)86#endif878889