1. Port X64, IPF and EBC arch for BaseLib

2. Port X64 arch codes for BaseMemoryLibRepStr and BaseMemoryLibSee2


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2955 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2007-07-02 09:34:25 +00:00
parent 29b052646a
commit f1baef624f
371 changed files with 13464 additions and 2205 deletions

View File

@ -0,0 +1,164 @@
/** @file
Base Library CPU Functions for EBC
Copyright (c) 2006, Intel Corporation<BR>
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.
**/
extern
UINT64
_break (
CHAR8 BreakCode
);
/**
Generates a breakpoint on the CPU.
Generates a breakpoint on the CPU. The breakpoint must be implemented such
that code can resume normal execution after the breakpoint.
**/
VOID
EFIAPI
CpuBreakpoint (
VOID
)
{
_break (3);
}
/**
Used to serialize load and store operations.
All loads and stores that proceed calls to this function are guaranteed to be
globally visible when this function returns.
**/
VOID
EFIAPI
MemoryFence (
VOID
)
{
}
/**
Disables CPU interrupts.
Disables CPU interrupts.
**/
VOID
EFIAPI
DisableInterrupts (
VOID
)
{
ASSERT (FALSE);
}
/**
Enables CPU interrupts.
Enables CPU interrupts.
**/
VOID
EFIAPI
EnableInterrupts (
VOID
)
{
ASSERT (FALSE);
}
/**
Retrieves the current CPU interrupt state.
Retrieves the current CPU interrupt state. Returns TRUE is interrupts are
currently enabled. Otherwise returns FALSE.
@retval TRUE CPU interrupts are enabled.
@retval FALSE CPU interrupts are disabled.
**/
BOOLEAN
EFIAPI
GetInterruptState (
VOID
)
{
ASSERT (FALSE);
return FALSE;
}
/**
Enables CPU interrupts for the smallest window required to capture any
pending interrupts.
Enables CPU interrupts for the smallest window required to capture any
pending interrupts.
**/
VOID
EFIAPI
EnableDisableInterrupts (
VOID
)
{
EnableInterrupts ();
DisableInterrupts ();
}
/**
Requests CPU to pause for a short period of time.
Requests CPU to pause for a short period of time. Typically used in MP
systems to prevent memory starvation while waiting for a spin lock.
**/
VOID
EFIAPI
CpuPause (
VOID
)
{
}
/**
Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
**/
VOID
EFIAPI
CpuFlushTlb (
VOID
)
{
ASSERT (FALSE);
}
/**
Places the CPU in a sleep state until an interrupt is received.
Places the CPU in a sleep state until an interrupt is received. If interrupts
are disabled prior to calling this function, then the CPU will be placed in a
sleep state indefinitely.
**/
VOID
EFIAPI
CpuSleep (
VOID
)
{
}

View File

@ -0,0 +1,78 @@
/** @file
Switch Stack functions.
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: SetJumpLongJump.c
**/
/**
Worker function that checks ASSERT condition for JumpBuffer
Checks ASSERT condition for JumpBuffer.
If JumpBuffer is NULL, then ASSERT().
For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
@param JumpBuffer A pointer to CPU context buffer.
**/
VOID
InternalAssertJumpBuffer (
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
);
/**
Saves the current CPU context that can be restored with a call to LongJump() and returns 0.
Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial
call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero
value to be returned by SetJump().
If JumpBuffer is NULL, then ASSERT().
For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
@param JumpBuffer A pointer to CPU context buffer.
**/
UINTN
EFIAPI
SetJump (
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
)
{
InternalAssertJumpBuffer (JumpBuffer);
return 0;
}
/**
Restores the CPU context that was saved with SetJump().
Restores the CPU context from the buffer specified by JumpBuffer.
This function never returns to the caller.
Instead is resumes execution based on the state of JumpBuffer.
@param JumpBuffer A pointer to CPU context buffer.
@param Value The value to return when the SetJump() context is restored.
**/
VOID
EFIAPI
InternalLongJump (
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
IN UINTN Value
)
{
//
// This function cannot work on EBC
//
ASSERT (FALSE);
}

View File

@ -0,0 +1,64 @@
/** @file
Switch Stack functions.
Copyright (c) 2006 - 2007, Intel Corporation<BR>
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: SwitchStack.c
**/
/**
Transfers control to a function starting with a new stack.
Transfers control to the function specified by EntryPoint using the
new stack specified by NewStack and passing in the parameters specified
by Context1 and Context2. Context1 and Context2 are optional and may
be NULL. The function EntryPoint must never return.
Marker will be ignored on IA-32, x64, and EBC.
IPF CPUs expect one additional parameter of type VOID * that specifies
the new backing store pointer.
If EntryPoint is NULL, then ASSERT().
If NewStack is NULL, then ASSERT().
@param EntryPoint A pointer to function to call with the new stack.
@param Context1 A pointer to the context to pass into the EntryPoint
function.
@param Context2 A pointer to the context to pass into the EntryPoint
function.
@param NewStack A pointer to the new stack to use for the EntryPoint
function.
@param Marker VA_LIST marker for the variable argument list.
**/
VOID
EFIAPI
InternalSwitchStack (
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
IN VOID *Context1, OPTIONAL
IN VOID *Context2, OPTIONAL
IN VOID *NewStack,
IN VA_LIST Marker
)
{
//
// This version of this function does not actually change the stack pointer
// This is to support compilation of CPU types that do not support assemblers
// such as EBC
//
//
// Stack should be aligned with CPU_STACK_ALIGNMENT
//
ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
EntryPoint (Context1, Context2);
}

View File

@ -0,0 +1,99 @@
/** @file
Implementation of synchronization functions on EBC.
Copyright (c) 2006, Intel Corporation<BR>
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: Synchronization.c
**/
UINT32
EFIAPI
InternalSyncCompareExchange32 (
IN volatile UINT32 *Value,
IN UINT32 CompareValue,
IN UINT32 ExchangeValue
)
{
return *Value != CompareValue ? *Value :
((*Value = ExchangeValue), CompareValue);
}
/**
Performs an atomic compare exchange operation on a 64-bit unsigned integer.
Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
The compare exchange operation must be performed using MP safe mechanisms.
@param Value A pointer to the 64-bit value for the compare exchange
operation.
@param CompareValue 64-bit value used in compare operation.
@param ExchangeValue 64-bit value used in exchange operation.
@return The original *Value before exchange.
**/
UINT64
EFIAPI
InternalSyncCompareExchange64 (
IN volatile UINT64 *Value,
IN UINT64 CompareValue,
IN UINT64 ExchangeValue
)
{
return *Value != CompareValue ? *Value :
((*Value = ExchangeValue), CompareValue);
}
/**
Performs an atomic increment of an 32-bit unsigned integer.
Performs an atomic increment of the 32-bit unsigned integer specified by
Value and returns the incremented value. The increment operation must be
performed using MP safe mechanisms. The state of the return value is not
guaranteed to be MP safe.
@param Value A pointer to the 32-bit value to increment.
@return The incremented value.
**/
UINT32
EFIAPI
InternalSyncIncrement (
IN volatile UINT32 *Value
)
{
return ++*Value;
}
/**
Performs an atomic decrement of an 32-bit unsigned integer.
Performs an atomic decrement of the 32-bit unsigned integer specified by
Value and returns the decrement value. The decrement operation must be
performed using MP safe mechanisms. The state of the return value is not
guaranteed to be MP safe.
@param Value A pointer to the 32-bit value to decrement.
@return The decrement value.
**/
UINT32
EFIAPI
InternalSyncDecrement (
IN volatile UINT32 *Value
)
{
return --*Value;
}

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------ ;
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------ ;
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,72 +1,67 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# 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:
#
# CpuIdEx.Asm
#
# Abstract:
#
# AsmCpuidEx function
#
# Notes:
#
#------------------------------------------------------------------------------
.686:
.code:
#------------------------------------------------------------------------------
# UINT32
# EFIAPI
# AsmCpuidEx (
# IN UINT32 RegisterInEax,
# IN UINT32 RegisterInEcx,
# OUT UINT32 *RegisterOutEax OPTIONAL,
# OUT UINT32 *RegisterOutEbx OPTIONAL,
# OUT UINT32 *RegisterOutEcx OPTIONAL,
# OUT UINT32 *RegisterOutEdx OPTIONAL
# )
#------------------------------------------------------------------------------
.globl ASM_PFX(AsmCpuidEx)
ASM_PFX(AsmCpuidEx):
push %ebx
push %ebp
movl %esp, %ebp
movl 12(%ebp), %eax
movl 16(%ebp), %ecx
cpuid
push %ecx
movl 20(%ebp), %ecx
jecxz L1
movl %eax, (%ecx)
L1:
movl 24(%ebp), %ecx
jecxz L2
movl %ebx, (%ecx)
L2:
movl 28(%ebp), %ecx
jecxz L3
popl (%ecx)
L3:
movl 32(%ebp), %edx
jecxz L4
movl %edx, (%ecx)
L4:
movl 12(%ebp), %eax
leave
pop %ebx
ret
#------------------------------------------------------------------------------
#
# 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:
#
# CpuIdEx.Asm
#
# Abstract:
#
# AsmCpuidEx function
#
# Notes:
#
#------------------------------------------------------------------------------
.686:
.code:
#------------------------------------------------------------------------------
# UINT32
# EFIAPI
# AsmCpuidEx (
# IN UINT32 RegisterInEax,
# IN UINT32 RegisterInEcx,
# OUT UINT32 *RegisterOutEax OPTIONAL,
# OUT UINT32 *RegisterOutEbx OPTIONAL,
# OUT UINT32 *RegisterOutEcx OPTIONAL,
# OUT UINT32 *RegisterOutEdx OPTIONAL
# )
#------------------------------------------------------------------------------
.globl ASM_PFX(AsmCpuidEx)
ASM_PFX(AsmCpuidEx):
push %ebx
push %ebp
movl %esp, %ebp
movl 12(%ebp), %eax
movl 16(%ebp), %ecx
cpuid
push %ecx
movl 20(%ebp), %ecx
jecxz L1
movl %eax, (%ecx)
L1:
movl 24(%ebp), %ecx
jecxz L2
movl %ebx, (%ecx)
L2:
movl 28(%ebp), %ecx
jecxz L3
popl (%ecx)
L3:
movl 32(%ebp), %edx
jecxz L4
movl %edx, (%ecx)
L4:
movl 12(%ebp), %eax
leave
pop %ebx
ret

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------ ;
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------ ;
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,46 +1,41 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# 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:
#
# DivU64x32.asm
#
# Abstract:
#
# Calculate the quotient of a 64-bit integer by a 32-bit integer
#
#------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathDivU64x32)
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathDivU64x32 (
# IN UINT64 Dividend,
# IN UINT32 Divisor
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalMathDivU64x32):
movl 8(%esp), %eax
movl 12(%esp), %ecx
xorl %edx, %edx
divl %ecx
push %eax
movl 8(%esp), %eax
divl %ecx
pop %edx
ret
#------------------------------------------------------------------------------
#
# 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:
#
# DivU64x32.asm
#
# Abstract:
#
# Calculate the quotient of a 64-bit integer by a 32-bit integer
#
#------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathDivU64x32)
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathDivU64x32 (
# IN UINT64 Dividend,
# IN UINT32 Divisor
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalMathDivU64x32):
movl 8(%esp), %eax
movl 12(%esp), %ecx
xorl %edx, %edx
divl %ecx
push %eax
movl 8(%esp), %eax
divl %ecx
pop %edx
ret

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,46 +1,41 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# 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:
#
# LShiftU64.asm
#
# Abstract:
#
# 64-bit left shift function for IA-32
#
#------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathLShiftU64)
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathLShiftU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalMathLShiftU64):
movb 12(%esp), %cl
xorl %eax, %eax
movl 4(%esp), %edx
testb $32, %cl
cmovz %edx, %eax
cmovz 0x8(%esp), %edx
shld %cl, %eax, %edx
shl %cl, %eax
ret
#------------------------------------------------------------------------------
#
# 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:
#
# LShiftU64.asm
#
# Abstract:
#
# 64-bit left shift function for IA-32
#
#------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathLShiftU64)
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathLShiftU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalMathLShiftU64):
movb 12(%esp), %cl
xorl %eax, %eax
movl 4(%esp), %edx
testb $32, %cl
cmovz %edx, %eax
cmovz 0x8(%esp), %edx
shld %cl, %eax, %edx
shl %cl, %eax
ret

View File

@ -1,46 +1,41 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# 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:
#
# LongJump.Asm
#
# Abstract:
#
# Implementation of _LongJump() on IA-32.
#
#------------------------------------------------------------------------------
.globl ASM_PFX(InternalLongJump)
#------------------------------------------------------------------------------
# VOID
# EFIAPI
# InternalLongJump (
# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
# IN UINTN Value
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalLongJump):
pop %eax
pop %edx
pop %eax
movl (%edx), %ebx
movl 4(%edx), %esi
movl 8(%edx), %edi
movl 12(%edx), %ebp
movl 16(%edx), %esp
jmp *20(%edx)
#------------------------------------------------------------------------------
#
# 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:
#
# LongJump.Asm
#
# Abstract:
#
# Implementation of _LongJump() on IA-32.
#
#------------------------------------------------------------------------------
.globl ASM_PFX(InternalLongJump)
#------------------------------------------------------------------------------
# VOID
# EFIAPI
# InternalLongJump (
# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
# IN UINTN Value
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalLongJump):
pop %eax
pop %edx
pop %eax
movl (%edx), %ebx
movl 4(%edx), %esi
movl 8(%edx), %edi
movl 12(%edx), %ebp
movl 16(%edx), %esp
jmp *20(%edx)

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,46 +1,41 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# 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:
#
# MultU64x32.asm
#
# Abstract:
#
# Calculate the product of a 64-bit integer and a 32-bit integer
#
#------------------------------------------------------------------------------
.386:
.code:
.globl ASM_PFX(InternalMathMultU64x32)
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathMultU64x32 (
# IN UINT64 Multiplicand,
# IN UINT32 Multiplier
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalMathMultU64x32):
movl 12(%esp), %ecx
movl %ecx, %eax
imull 8(%esp), %ecx
mull 0x4(%esp)
addl %ecx, %edx
ret
#------------------------------------------------------------------------------
#
# 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:
#
# MultU64x32.asm
#
# Abstract:
#
# Calculate the product of a 64-bit integer and a 32-bit integer
#
#------------------------------------------------------------------------------
.386:
.code:
.globl ASM_PFX(InternalMathMultU64x32)
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathMultU64x32 (
# IN UINT64 Multiplicand,
# IN UINT32 Multiplier
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalMathMultU64x32):
movl 12(%esp), %ecx
movl %ecx, %eax
imull 8(%esp), %ecx
mull 0x4(%esp)
addl %ecx, %edx
ret

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,49 +1,44 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# 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:
#
# RShiftU64.asm
#
# Abstract:
#
# 64-bit logical right shift function for IA-32
#
#------------------------------------------------------------------------------
.686:
.code:
.globl ASM_PFX(InternalMathRShiftU64)
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathRShiftU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalMathRShiftU64):
movb 12(%esp), %cl
xorl %edx, %edx
movl 8(%esp), %eax
testb $32, %cl
cmovz %eax, %edx
cmovz 0x4(%esp), %eax
shrdl %cl, %edx, %eax
shr %cl, %edx
ret
#------------------------------------------------------------------------------
#
# 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:
#
# RShiftU64.asm
#
# Abstract:
#
# 64-bit logical right shift function for IA-32
#
#------------------------------------------------------------------------------
.686:
.code:
.globl ASM_PFX(InternalMathRShiftU64)
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathRShiftU64 (
# IN UINT64 Operand,
# IN UINTN Count
# );
#------------------------------------------------------------------------------
ASM_PFX(InternalMathRShiftU64):
movb 12(%esp), %cl
xorl %edx, %edx
movl 8(%esp), %eax
testb $32, %cl
cmovz %eax, %edx
cmovz 0x4(%esp), %eax
shrdl %cl, %edx, %eax
shr %cl, %edx
ret

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,43 +1,38 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# 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:
#
# CpuId.Asm
#
# Abstract:
#
# AsmCpuid function
#
# Notes:
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathSwapBytes64 (
# IN UINT64 Operand
# );
#------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathSwapBytes64)
ASM_PFX(InternalMathSwapBytes64):
movl 8(%esp), %eax
movl 4(%esp), %edx
bswapl %eax
bswapl %edx
ret
#------------------------------------------------------------------------------
#
# 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:
#
# CpuId.Asm
#
# Abstract:
#
# AsmCpuid function
#
# Notes:
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# UINT64
# EFIAPI
# InternalMathSwapBytes64 (
# IN UINT64 Operand
# );
#------------------------------------------------------------------------------
.globl ASM_PFX(InternalMathSwapBytes64)
ASM_PFX(InternalMathSwapBytes64):
movl 8(%esp), %eax
movl 4(%esp), %edx
bswapl %eax
bswapl %edx
ret

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

View File

@ -1,8 +1,3 @@
//
// Include common header file for this module.
//
#include "CommonHeader.h"
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation

Some files were not shown because too many files have changed in this diff Show More