2019-06-04 08:11:30 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2007-07-11 19:18:41 +00:00
|
|
|
/* ----------------------------------------------------------------------- *
|
|
|
|
*
|
|
|
|
* Copyright (C) 1991, 1992 Linus Torvalds
|
|
|
|
* Copyright 2007 rPath, Inc. - All Rights Reserved
|
|
|
|
*
|
|
|
|
* ----------------------------------------------------------------------- */
|
|
|
|
|
2009-02-13 21:50:20 +00:00
|
|
|
#include <linux/linkage.h>
|
|
|
|
|
2007-07-11 19:18:41 +00:00
|
|
|
/*
|
|
|
|
* Memory copy routines
|
|
|
|
*/
|
|
|
|
|
2014-01-03 22:30:42 +00:00
|
|
|
.code16
|
2007-07-11 19:18:41 +00:00
|
|
|
.text
|
|
|
|
|
2019-10-11 11:50:56 +00:00
|
|
|
SYM_FUNC_START_NOALIGN(memcpy)
|
2007-07-11 19:18:41 +00:00
|
|
|
pushw %si
|
|
|
|
pushw %di
|
|
|
|
movw %ax, %di
|
|
|
|
movw %dx, %si
|
|
|
|
pushw %cx
|
|
|
|
shrw $2, %cx
|
|
|
|
rep; movsl
|
|
|
|
popw %cx
|
|
|
|
andw $3, %cx
|
|
|
|
rep; movsb
|
|
|
|
popw %di
|
|
|
|
popw %si
|
2014-01-03 22:30:42 +00:00
|
|
|
retl
|
2019-10-11 11:50:56 +00:00
|
|
|
SYM_FUNC_END(memcpy)
|
2007-07-11 19:18:41 +00:00
|
|
|
|
2019-10-11 11:50:56 +00:00
|
|
|
SYM_FUNC_START_NOALIGN(memset)
|
2007-07-11 19:18:41 +00:00
|
|
|
pushw %di
|
|
|
|
movw %ax, %di
|
|
|
|
movzbl %dl, %eax
|
|
|
|
imull $0x01010101,%eax
|
|
|
|
pushw %cx
|
|
|
|
shrw $2, %cx
|
|
|
|
rep; stosl
|
|
|
|
popw %cx
|
|
|
|
andw $3, %cx
|
|
|
|
rep; stosb
|
|
|
|
popw %di
|
2014-01-03 22:30:42 +00:00
|
|
|
retl
|
2019-10-11 11:50:56 +00:00
|
|
|
SYM_FUNC_END(memset)
|
2007-07-11 19:18:41 +00:00
|
|
|
|
2019-10-11 11:50:56 +00:00
|
|
|
SYM_FUNC_START_NOALIGN(copy_from_fs)
|
2007-07-11 19:18:41 +00:00
|
|
|
pushw %ds
|
|
|
|
pushw %fs
|
|
|
|
popw %ds
|
2014-01-03 22:30:42 +00:00
|
|
|
calll memcpy
|
2007-07-11 19:18:41 +00:00
|
|
|
popw %ds
|
2014-01-03 22:30:42 +00:00
|
|
|
retl
|
2019-10-11 11:50:56 +00:00
|
|
|
SYM_FUNC_END(copy_from_fs)
|
2007-07-11 19:18:41 +00:00
|
|
|
|
2019-10-11 11:50:56 +00:00
|
|
|
SYM_FUNC_START_NOALIGN(copy_to_fs)
|
2007-07-11 19:18:41 +00:00
|
|
|
pushw %es
|
|
|
|
pushw %fs
|
|
|
|
popw %es
|
2014-01-03 22:30:42 +00:00
|
|
|
calll memcpy
|
2007-07-11 19:18:41 +00:00
|
|
|
popw %es
|
2014-01-03 22:30:42 +00:00
|
|
|
retl
|
2019-10-11 11:50:56 +00:00
|
|
|
SYM_FUNC_END(copy_to_fs)
|