]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/BaseMemoryLibStm/Arm/SetMem.asm
Remove tabs.
[mirror_edk2.git] / ArmPkg / Library / BaseMemoryLibStm / Arm / SetMem.asm
CommitLineData
d39eb83c 1;------------------------------------------------------------------------------ \r
2;\r
3; SetMem() worker for ARM\r
4;\r
5; This file started out as C code that did 64 bit moves if the buffer was\r
6; 32-bit aligned, else it does a byte copy. It also does a byte copy for\r
7; any trailing bytes. It was updated to do 32-byte at a time.\r
8;\r
d6ebcab7
HT
9; Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
10; This program and the accompanying materials\r
d39eb83c 11; are licensed and made available under the terms and conditions of the BSD License\r
12; which accompanies this distribution. The full text of the license may be found at\r
13; http://opensource.org/licenses/bsd-license.php\r
14;\r
15; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
16; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
17;\r
18\r
19/**\r
20 Set Buffer to Value for Size bytes.\r
21\r
22 @param Buffer Memory to set.\r
23 @param Length Number of bytes to set\r
24 @param Value Value of the set operation.\r
25\r
26 @return Buffer\r
27\r
28VOID *\r
29EFIAPI\r
30InternalMemSetMem (\r
31 OUT VOID *Buffer,\r
32 IN UINTN Length,\r
33 IN UINT8 Value\r
34 )\r
35**/\r
58b5d037 36\s\s\r
37\s\sEXPORT InternalMemSetMem\r
38\s\s\r
39\s\sAREA AsmMemStuff, CODE, READONLY\r
d39eb83c 40\r
41InternalMemSetMem\r
58b5d037 42\s\sstmfd\s\ssp!, {r4-r11, lr}\r
43\s\stst\s\s r0, #3\r
44\s\smovne\s\sr3, #0\r
45\s\smoveq\s\sr3, #1\r
46\s\scmp\s\s r1, #31\r
47\s\smovls lr, #0\r
48\s\sandhi\s\slr, r3, #1\r
49\s\scmp\s\s lr, #0\r
50\s\smov\s\s r12, r0\r
51\s\sbne\s\s L31\r
d39eb83c 52L32\r
58b5d037 53\s\smov\s\s r3, #0\r
54\s\sb\s\s L43\r
d39eb83c 55L31\r
56 and r4, r2, #0xff\r
57 orr r4, r4, r4, LSL #8\r
58 orr r4, r4, r4, LSL #16 \r
58b5d037 59\s\smov r5, r4\r
60\s\smov r5, r4\r
61\s\smov r6, r4\r
62\s\smov r7, r4 \r
63\s\smov r8, r4 \r
64\s\smov r9, r4 \r
65\s\smov r10, r4 \r
66\s\smov r11, r4 \r
67\s\sb\s\s L32\r
d39eb83c 68L34\r
58b5d037 69\s\scmp\s\s lr, #0\r
70\s\sstreqb\s\sr2, [r12], #1\r
71\s\ssubeq\s\s r1, r1, #1\r
72\s\sbeq\s\s L43\r
73\s\ssub\s\s r1, r1, #32\r
74\s\scmp\s\s r1, #31\r
75\s\smovls\s\s lr, r3\r
76\s\sstmia\s\s r12!, {r4-r11}\r
d39eb83c 77L43\r
58b5d037 78\s\scmp\s\s r1, #0\r
79\s\sbne\s\s L34\r
80\s\sldmfd\s\s sp!, {r4-r11, pc}\r
81\s\s\r
d39eb83c 82 END\r
83