]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/x86/boot/copy.S
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / boot / copy.S
CommitLineData
5be86566
PA
1/* ----------------------------------------------------------------------- *
2 *
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright 2007 rPath, Inc. - All Rights Reserved
5 *
6 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2.
8 *
9 * ----------------------------------------------------------------------- */
10
2f795550
CG
11#include <linux/linkage.h>
12
5be86566 13/*
5be86566
PA
14 * Memory copy routines
15 */
16
e24df921 17 .code16
5be86566
PA
18 .text
19
2f795550 20GLOBAL(memcpy)
5be86566
PA
21 pushw %si
22 pushw %di
23 movw %ax, %di
24 movw %dx, %si
25 pushw %cx
26 shrw $2, %cx
27 rep; movsl
28 popw %cx
29 andw $3, %cx
30 rep; movsb
31 popw %di
32 popw %si
e24df921 33 retl
2f795550 34ENDPROC(memcpy)
5be86566 35
2f795550 36GLOBAL(memset)
5be86566
PA
37 pushw %di
38 movw %ax, %di
39 movzbl %dl, %eax
40 imull $0x01010101,%eax
41 pushw %cx
42 shrw $2, %cx
43 rep; stosl
44 popw %cx
45 andw $3, %cx
46 rep; stosb
47 popw %di
e24df921 48 retl
2f795550 49ENDPROC(memset)
5be86566 50
2f795550 51GLOBAL(copy_from_fs)
5be86566
PA
52 pushw %ds
53 pushw %fs
54 popw %ds
e24df921 55 calll memcpy
5be86566 56 popw %ds
e24df921 57 retl
2f795550 58ENDPROC(copy_from_fs)
5be86566 59
2f795550 60GLOBAL(copy_to_fs)
5be86566
PA
61 pushw %es
62 pushw %fs
63 popw %es
e24df921 64 calll memcpy
5be86566 65 popw %es
e24df921 66 retl
2f795550 67ENDPROC(copy_to_fs)
5be86566
PA
68
69#if 0 /* Not currently used, but can be enabled as needed */
2f795550 70GLOBAL(copy_from_gs)
5be86566
PA
71 pushw %ds
72 pushw %gs
73 popw %ds
e24df921 74 calll memcpy
5be86566 75 popw %ds
e24df921 76 retl
2f795550 77ENDPROC(copy_from_gs)
5be86566 78
2f795550 79GLOBAL(copy_to_gs)
5be86566
PA
80 pushw %es
81 pushw %gs
82 popw %es
e24df921 83 calll memcpy
5be86566 84 popw %es
e24df921 85 retl
2f795550 86ENDPROC(copy_to_gs)
5be86566 87#endif