]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/BaseMemoryLibVstm/Arm/SetMem.asm
Update the copyright notice format
[mirror_edk2.git] / ArmPkg / Library / BaseMemoryLibVstm / Arm / SetMem.asm
1 ;------------------------------------------------------------------------------
2 ;
3 ; SetMem() worker for ARM
4 ;
5 ; This file started out as C code that did 64 bit moves if the buffer was
6 ; 32-bit aligned, else it does a byte copy. It also does a byte copy for
7 ; any trailing bytes. Update to use VSTM/VLDM to do 128 byte writes.
8 ;
9 ; Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
10 ; This program and the accompanying materials
11 ; are licensed and made available under the terms and conditions of the BSD License
12 ; which accompanies this distribution. The full text of the license may be found at
13 ; http://opensource.org/licenses/bsd-license.php
14 ;
15 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 ;
18
19 /**
20 Set Buffer to Value for Size bytes.
21
22 @param Buffer Memory to set.
23 @param Length Number of bytes to set
24 @param Value Value of the set operation.
25
26 @return Buffer
27
28 VOID *
29 EFIAPI
30 InternalMemSetMem (
31 OUT VOID *Buffer,
32 IN UINTN Length,
33 IN UINT8 Value
34 )
35 **/
36
37 EXPORT InternalMemSetMem
38
39 AREA AsmMemStuff, CODE, READONLY
40
41 InternalMemSetMem
42 stmfd sp!, {lr}
43 tst r0, #3
44 movne r3, #0
45 moveq r3, #1
46 cmp r1, #127
47 movls lr, #0
48 andhi lr, r3, #1
49 cmp lr, #0
50 mov r12, r0
51 bne L31
52 L32
53 mov r3, #0
54 b L43
55 L31
56 vdup.8 q0,r2
57 vmov q1,q0
58 vmov q2,q0
59 vmov q3,q0
60 vmov q4,q0
61 vmov q5,q0
62 vmov q6,q0
63 vmov q7,q0
64 b L32
65 L34
66 cmp lr, #0
67 streqb r2, [r12], #1
68 subeq r1, r1, #1
69 beq L43
70 sub r1, r1, #128
71 cmp r1, #127
72 movls lr, r3
73 vstm r12!, {d0-d15}
74 L43
75 cmp r1, #0
76 bne L34
77 ldmfd sp!, {pc}
78
79 END
80