2014-08-19 15:29:52 +02:00
|
|
|
;------------------------------------------------------------------------------
|
2010-04-22 00:04:35 +02:00
|
|
|
;
|
|
|
|
; SetMem() worker for ARM
|
|
|
|
;
|
|
|
|
; This file started out as C code that did 64 bit moves if the buffer was
|
|
|
|
; 32-bit aligned, else it does a byte copy. It also does a byte copy for
|
|
|
|
; any trailing bytes. It was updated to do 32-byte at a time.
|
|
|
|
;
|
2010-04-29 14:15:47 +02:00
|
|
|
; Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
|
|
|
; This program and the accompanying materials
|
2010-04-22 00:04:35 +02:00
|
|
|
; are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
; which accompanies this distribution. The full text of the license may be found at
|
|
|
|
; http://opensource.org/licenses/bsd-license.php
|
|
|
|
;
|
|
|
|
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set Buffer to Value for Size bytes.
|
|
|
|
|
|
|
|
@param Buffer Memory to set.
|
|
|
|
@param Length Number of bytes to set
|
|
|
|
@param Value Value of the set operation.
|
|
|
|
|
|
|
|
@return Buffer
|
|
|
|
|
|
|
|
VOID *
|
|
|
|
EFIAPI
|
|
|
|
InternalMemSetMem (
|
|
|
|
OUT VOID *Buffer,
|
|
|
|
IN UINTN Length,
|
|
|
|
IN UINT8 Value
|
|
|
|
)
|
|
|
|
**/
|
2014-08-19 15:29:52 +02:00
|
|
|
|
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
INCLUDE AsmMacroExport.inc
|
2010-04-22 00:04:35 +02:00
|
|
|
|
2015-12-03 21:28:02 +01:00
|
|
|
RVCT_ASM_EXPORT InternalMemSetMem
|
2011-02-03 00:19:30 +01:00
|
|
|
stmfd sp!, {r4-r11, lr}
|
|
|
|
tst r0, #3
|
|
|
|
movne r3, #0
|
|
|
|
moveq r3, #1
|
|
|
|
cmp r1, #31
|
|
|
|
movls lr, #0
|
|
|
|
andhi lr, r3, #1
|
|
|
|
cmp lr, #0
|
|
|
|
mov r12, r0
|
|
|
|
bne L31
|
2010-04-22 00:04:35 +02:00
|
|
|
L32
|
2011-02-03 00:19:30 +01:00
|
|
|
mov r3, #0
|
|
|
|
b L43
|
2010-04-22 00:04:35 +02:00
|
|
|
L31
|
|
|
|
and r4, r2, #0xff
|
|
|
|
orr r4, r4, r4, LSL #8
|
2014-08-19 15:29:52 +02:00
|
|
|
orr r4, r4, r4, LSL #16
|
2011-02-03 00:19:30 +01:00
|
|
|
mov r5, r4
|
|
|
|
mov r6, r4
|
2014-08-19 15:29:52 +02:00
|
|
|
mov r7, r4
|
|
|
|
mov r8, r4
|
|
|
|
mov r9, r4
|
|
|
|
mov r10, r4
|
|
|
|
mov r11, r4
|
2011-02-03 00:19:30 +01:00
|
|
|
b L32
|
2010-04-22 00:04:35 +02:00
|
|
|
L34
|
2011-02-03 00:19:30 +01:00
|
|
|
cmp lr, #0
|
|
|
|
streqb r2, [r12], #1
|
|
|
|
subeq r1, r1, #1
|
|
|
|
beq L43
|
|
|
|
sub r1, r1, #32
|
|
|
|
cmp r1, #31
|
|
|
|
movls lr, r3
|
|
|
|
stmia r12!, {r4-r11}
|
2010-04-22 00:04:35 +02:00
|
|
|
L43
|
2011-02-03 00:19:30 +01:00
|
|
|
cmp r1, #0
|
|
|
|
bne L34
|
|
|
|
ldmfd sp!, {r4-r11, pc}
|
2014-08-19 15:29:52 +02:00
|
|
|
|
2010-04-22 00:04:35 +02:00
|
|
|
END
|