2006-05-19 21:28:24 +02:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Copyright (c) 2006, Intel Corporation
|
|
|
|
# All rights reserved. This program and the accompanying materials
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# Module Name:
|
|
|
|
#
|
|
|
|
# SetMem32.asm
|
|
|
|
#
|
|
|
|
# Abstract:
|
|
|
|
#
|
|
|
|
# SetMem32 function
|
|
|
|
#
|
|
|
|
# Notes:
|
|
|
|
#
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2006-09-25 12:05:26 +02:00
|
|
|
.globl _InternalMemSetMem32
|
2006-05-19 21:28:24 +02:00
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# VOID *
|
2006-07-28 09:28:19 +02:00
|
|
|
# EFIAPI
|
|
|
|
# InternalMemSetMem32 (
|
2006-05-19 21:28:24 +02:00
|
|
|
# IN VOID *Buffer,
|
|
|
|
# IN UINTN Count,
|
|
|
|
# IN UINT32 Value
|
2006-07-28 09:28:19 +02:00
|
|
|
# );
|
2006-05-19 21:28:24 +02:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
_InternalMemSetMem32:
|
|
|
|
push %edi
|
|
|
|
movl 12(%esp), %edx
|
|
|
|
movl 8(%esp), %edi
|
|
|
|
xorl %ecx, %ecx
|
|
|
|
subl %edi, %ecx
|
|
|
|
andl $15, %ecx # ecx + edi aligns on 16-byte boundary
|
|
|
|
movl 16(%esp), %eax
|
|
|
|
jz L0
|
|
|
|
shrl $2, %ecx
|
|
|
|
cmpl %edx, %ecx
|
|
|
|
cmova %edx, %ecx
|
|
|
|
subl %ecx, %edx
|
|
|
|
rep
|
|
|
|
stosl
|
2006-07-28 09:28:19 +02:00
|
|
|
L0:
|
2006-05-19 21:28:24 +02:00
|
|
|
movl %edx, %ecx
|
|
|
|
andl $3, %edx
|
|
|
|
shrl $2, %ecx
|
2006-09-25 12:05:26 +02:00
|
|
|
jz L_SetDwords
|
2006-05-19 21:28:24 +02:00
|
|
|
movd %eax, %xmm0
|
|
|
|
pshufd $0, %xmm0, %xmm0
|
2006-07-28 09:28:19 +02:00
|
|
|
L1:
|
2006-05-19 21:28:24 +02:00
|
|
|
movntdq %xmm0, (%edi)
|
|
|
|
addl $16, %edi
|
|
|
|
loop L1
|
|
|
|
mfence
|
2006-09-25 12:05:26 +02:00
|
|
|
L_SetDwords:
|
2006-05-19 21:28:24 +02:00
|
|
|
movl %edx, %ecx
|
|
|
|
rep
|
|
|
|
stosl
|
|
|
|
movl 8(%esp), %eax
|
|
|
|
pop %edi
|
|
|
|
ret
|