Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* ----------------------------------------------------------------------- *
0003  *
0004  *   Copyright (C) 1991, 1992 Linus Torvalds
0005  *   Copyright 2007 rPath, Inc. - All Rights Reserved
0006  *
0007  * ----------------------------------------------------------------------- */
0008 
0009 #include <linux/linkage.h>
0010 
0011 /*
0012  * Memory copy routines
0013  */
0014 
0015     .code16
0016     .text
0017 
0018 SYM_FUNC_START_NOALIGN(memcpy)
0019     pushw   %si
0020     pushw   %di
0021     movw    %ax, %di
0022     movw    %dx, %si
0023     pushw   %cx
0024     shrw    $2, %cx
0025     rep; movsl
0026     popw    %cx
0027     andw    $3, %cx
0028     rep; movsb
0029     popw    %di
0030     popw    %si
0031     retl
0032 SYM_FUNC_END(memcpy)
0033 
0034 SYM_FUNC_START_NOALIGN(memset)
0035     pushw   %di
0036     movw    %ax, %di
0037     movzbl  %dl, %eax
0038     imull   $0x01010101,%eax
0039     pushw   %cx
0040     shrw    $2, %cx
0041     rep; stosl
0042     popw    %cx
0043     andw    $3, %cx
0044     rep; stosb
0045     popw    %di
0046     retl
0047 SYM_FUNC_END(memset)
0048 
0049 SYM_FUNC_START_NOALIGN(copy_from_fs)
0050     pushw   %ds
0051     pushw   %fs
0052     popw    %ds
0053     calll   memcpy
0054     popw    %ds
0055     retl
0056 SYM_FUNC_END(copy_from_fs)
0057 
0058 SYM_FUNC_START_NOALIGN(copy_to_fs)
0059     pushw   %es
0060     pushw   %fs
0061     popw    %es
0062     calll   memcpy
0063     popw    %es
0064     retl
0065 SYM_FUNC_END(copy_to_fs)