^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* ----------------------------------------------------------------------- *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 1991, 1992 Linus Torvalds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright 2007 rPath, Inc. - All Rights Reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * ----------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/linkage.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * Memory copy routines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) .code16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) .text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) SYM_FUNC_START_NOALIGN(memcpy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) pushw %si
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) pushw %di
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) movw %ax, %di
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) movw %dx, %si
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) pushw %cx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) shrw $2, %cx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) rep; movsl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) popw %cx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) andw $3, %cx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) rep; movsb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) popw %di
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) popw %si
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) retl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) SYM_FUNC_END(memcpy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) SYM_FUNC_START_NOALIGN(memset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) pushw %di
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) movw %ax, %di
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) movzbl %dl, %eax
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) imull $0x01010101,%eax
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) pushw %cx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) shrw $2, %cx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) rep; stosl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) popw %cx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) andw $3, %cx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) rep; stosb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) popw %di
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) retl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) SYM_FUNC_END(memset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) SYM_FUNC_START_NOALIGN(copy_from_fs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) pushw %ds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) pushw %fs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) popw %ds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) calll memcpy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) popw %ds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) retl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) SYM_FUNC_END(copy_from_fs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) SYM_FUNC_START_NOALIGN(copy_to_fs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) pushw %es
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) pushw %fs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) popw %es
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) calll memcpy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) popw %es
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) retl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) SYM_FUNC_END(copy_to_fs)