mirror of https://github.com/acidanthera/audk.git
Ported to GNU assembly.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@187 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b546c3ade2
commit
b6bd81d45f
|
@ -0,0 +1,46 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# CompareMem.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# CompareMem function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
# The following BaseMemoryLib instances share the same version of this file:
|
||||
#
|
||||
# BaseMemoryLibRepStr
|
||||
# BaseMemoryLibMmx
|
||||
# BaseMemoryLibSse2
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.686:
|
||||
.code:
|
||||
|
||||
.global InternalMemCompareMem
|
||||
InternalMemCompareMem:
|
||||
push %esi
|
||||
push %edi
|
||||
movl 12(%esp),%esi
|
||||
movl 16(%esp),%edi
|
||||
movl 20(%esp),%ecx
|
||||
repe cmpsb
|
||||
movzbl -1(%esi), %eax
|
||||
movzbl -1(%edi), %edx
|
||||
subl %edx,%eax
|
||||
pop %edi
|
||||
pop %esi
|
||||
ret
|
|
@ -0,0 +1,58 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# CopyMem.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# CopyMem function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.386:
|
||||
.code:
|
||||
|
||||
.global InternalMemCopyMem
|
||||
InternalMemCopyMem:
|
||||
push %esi
|
||||
push %edi
|
||||
movl 16(%esp),%esi # esi <- Source
|
||||
movl 12(%esp),%edi # edi <- Destination
|
||||
movl 20(%esp),%edx # edx <- Count
|
||||
leal -1(%edi,%edx),%eax # eax <- End of Destination
|
||||
cmpl %edi,%esi
|
||||
jae L0
|
||||
cmpl %esi,%eax
|
||||
jae @CopyBackward # Copy backward if overlapped
|
||||
L0:
|
||||
movl %edx,%ecx
|
||||
andl $3,%edx
|
||||
shrl $2,%ecx
|
||||
rep
|
||||
movsl # Copy as many Dwords as possible
|
||||
jmp @CopyBytes
|
||||
@CopyBackward:
|
||||
movl %eax,%edi # edi <- End of Destination
|
||||
leal -1(%esi,%edx),%esi # esi <- End of Source
|
||||
std
|
||||
@CopyBytes:
|
||||
movl %edx,%ecx
|
||||
rep
|
||||
movsb # Copy bytes backward
|
||||
cld
|
||||
movl 12(%esp),%eax # eax <- Destination as return value
|
||||
push %edi
|
||||
push %esi
|
||||
ret
|
|
@ -0,0 +1,43 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# ScanMem16.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# ScanMem16 function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
# The following BaseMemoryLib instances share the same version of this file:
|
||||
#
|
||||
# BaseMemoryLibRepStr
|
||||
# BaseMemoryLibMmx
|
||||
# BaseMemoryLibSse2
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.686:
|
||||
.code:
|
||||
|
||||
.global InternalMemScanMem16
|
||||
InternalMemScanMem16:
|
||||
push %edi
|
||||
movl 12(%esp),%ecx
|
||||
movl 8(%esp),%edi
|
||||
movl 16(%esp),%eax
|
||||
repne scasw
|
||||
leal -2(%edi),%eax
|
||||
cmovnz %ecx, %eax
|
||||
pop %edi
|
||||
ret
|
|
@ -0,0 +1,43 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# ScanMem32.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# ScanMem32 function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
# The following BaseMemoryLib instances share the same version of this file:
|
||||
#
|
||||
# BaseMemoryLibRepStr
|
||||
# BaseMemoryLibMmx
|
||||
# BaseMemoryLibSse2
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.686:
|
||||
.code:
|
||||
|
||||
.global InternalMemScanMem32
|
||||
InternalMemScanMem32:
|
||||
push %edi
|
||||
movl 12(%esp),%ecx
|
||||
movl 8(%esp),%edi
|
||||
movl 16(%esp),%eax
|
||||
repne scasl
|
||||
leal -4(%edi),%eax
|
||||
cmovnz %ecx, %eax
|
||||
pop %edi
|
||||
ret
|
|
@ -0,0 +1,52 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# ScanMem64.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# ScanMem64 function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
# The following BaseMemoryLib instances share the same version of this file:
|
||||
#
|
||||
# BaseMemoryLibRepStr
|
||||
# BaseMemoryLibMmx
|
||||
# BaseMemoryLibSse2
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.686:
|
||||
.code:
|
||||
|
||||
InternalMemScanMem64:
|
||||
push %edi
|
||||
movl 12(%esp),%ecx
|
||||
movl 16(%esp),%eax
|
||||
movl 20(%esp),%edx
|
||||
movl 8(%esp),%edi
|
||||
L0:
|
||||
cmpl (%edi),%eax
|
||||
leal 8(%edi),%edi
|
||||
loopne L0
|
||||
jne L1
|
||||
cmpl -4(%edi),%edx
|
||||
jecxz L1
|
||||
jne L0
|
||||
L1:
|
||||
leal -8(%edi),%eax
|
||||
cmovne %ecx, %eax
|
||||
pop %edi
|
||||
ret
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# ScanMem8.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# ScanMem8 function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
# The following BaseMemoryLib instances share the same version of this file:
|
||||
#
|
||||
# BaseMemoryLibRepStr
|
||||
# BaseMemoryLibMmx
|
||||
# BaseMemoryLibSse2
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.686:
|
||||
.code:
|
||||
|
||||
.global InternalMemScanMem8
|
||||
InternalMemScanMem8:
|
||||
push %edi
|
||||
movl 12(%esp),%ecx
|
||||
movl 8(%esp),%edi
|
||||
movb 16(%esp),%al
|
||||
repne scasb
|
||||
leal -1(%edi),%eax
|
||||
cmovnz %ecx, %eax
|
||||
ret
|
|
@ -0,0 +1,36 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# SetMem.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# SetMem function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.386:
|
||||
.code:
|
||||
|
||||
.global InternalMemSetMem
|
||||
InternalMemSetMem:
|
||||
push %edi
|
||||
movl 16(%esp),%eax
|
||||
movl 8(%esp),%edi
|
||||
movl 12(%esp),%ecx
|
||||
rep
|
||||
stosb
|
||||
movl 8(%esp),%eax
|
||||
ret
|
|
@ -0,0 +1,37 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# SetMem16.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# SetMem16 function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.386:
|
||||
.code:
|
||||
|
||||
.global InternalMemSetMem16
|
||||
InternalMemSetMem16:
|
||||
push %edi
|
||||
movl 16(%esp),%eax
|
||||
movl 8(%esp),%edi
|
||||
movl 12(%esp),%ecx
|
||||
rep
|
||||
stosw
|
||||
movl 8(%esp),%eax
|
||||
pop %edi
|
||||
ret
|
|
@ -0,0 +1,37 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.386:
|
||||
.code:
|
||||
|
||||
.global InternalMemSetMem32
|
||||
InternalMemSetMem32:
|
||||
push %edi
|
||||
movl 16(%esp),%eax
|
||||
movl 8(%esp),%edi
|
||||
movl 12(%esp),%ecx
|
||||
rep
|
||||
stosl
|
||||
movl 8(%esp),%eax
|
||||
pop %edi
|
||||
ret
|
|
@ -0,0 +1,40 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# SetMem64.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# SetMem64 function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.386:
|
||||
.code:
|
||||
|
||||
.global InternalMemSetMem64
|
||||
InternalMemSetMem64:
|
||||
push %edi
|
||||
movl 12(%esp),%ecx
|
||||
movl 16(%esp),%eax
|
||||
movl 20(%esp),%edx
|
||||
movl 8(%esp),%edi
|
||||
L0:
|
||||
mov %eax,-8(%edi,%ecx,4)
|
||||
mov %edx,-4(%edi,%ecx,4)
|
||||
loop L0
|
||||
movl %edi,%eax
|
||||
pop %edi
|
||||
ret
|
|
@ -0,0 +1,44 @@
|
|||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
# ZeroMem.Asm
|
||||
#
|
||||
# Abstract:
|
||||
#
|
||||
# ZeroMem function
|
||||
#
|
||||
# Notes:
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
.386:
|
||||
.code:
|
||||
|
||||
.global InternalMemZeroMem
|
||||
InternalMemZeroMem:
|
||||
push %edi
|
||||
xorl %eax,%eax
|
||||
movl 8(%esp),%edi
|
||||
movl 12(%esp),%ecx
|
||||
movl %ecx,%edx
|
||||
shrl $2,%ecx
|
||||
andl $3,%edx
|
||||
pushl %edi
|
||||
rep
|
||||
stosl
|
||||
movl %edx,%ecx
|
||||
rep
|
||||
stosb
|
||||
popl %eax
|
||||
pop %edi
|
||||
ret
|
Loading…
Reference in New Issue