Use intrinsic

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1669 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
mdkinney 2006-10-04 23:50:23 +00:00
parent c4bbb32b30
commit 9730cac8a1
6 changed files with 218 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/** @file
InterlockedCompareExchange32 function
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.
**/
#if _MSC_EXTENSIONS
//
// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
//
long _InterlockedCompareExchange(
long volatile * Destination,
long Exchange,
long Comperand
);
#pragma intrinsic(_InterlockedCompareExchange)
UINT32
EFIAPI
InternalSyncCompareExchange32 (
IN UINT32 *Value,
IN UINT32 CompareValue,
IN UINT32 ExchangeValue
)
{
return _InterlockedCompareExchange (Value, ExchangeValue, CompareValue);
}
#endif

View File

@ -0,0 +1,39 @@
/** @file
InterlockedCompareExchange64 function
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.
**/
#if _MSC_EXTENSIONS
//
// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
//
__int64 _InterlockedCompareExchange64(
__int64 volatile * Destination,
__int64 Exchange,
__int64 Comperand
);
#pragma intrinsic(_InterlockedCompareExchange64)
UINT64
EFIAPI
InternalSyncCompareExchange64 (
IN UINT64 *Value,
IN UINT64 CompareValue,
IN UINT64 ExchangeValue
)
{
return _InterlockedCompareExchange64 (Value, ExchangeValue, CompareValue);
}
#endif

View File

@ -0,0 +1,35 @@
/** @file
InterlockedDecrement function
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.
**/
#if _MSC_EXTENSIONS
//
// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
//
long _InterlockedDecrement(
long * lpAddend
);
#pragma intrinsic(_InterlockedDecrement)
UINT32
EFIAPI
InternalSyncDecrement (
IN UINT32 *Value
)
{
return _InterlockedDecrement (Value);
}
#endif

View File

@ -0,0 +1,35 @@
/** @file
InterLockedIncrement function
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.
**/
#if _MSC_EXTENSIONS
//
// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
//
long _InterlockedIncrement(
long * lpAddend
);
#pragma intrinsic(_InterlockedIncrement)
UINT32
EFIAPI
InternalSyncIncrement (
IN UINT32 *Value
)
{
return _InterlockedIncrement (Value);
}
#endif

View File

@ -0,0 +1,34 @@
/** @file
CpuBreakpoint function.
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.
**/
#if _MSC_EXTENSIONS
//
// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
//
unsigned __int64 __readmsr (int register);
#pragma intrinsic(__readmsr)
UINT64
EFIAPI
AsmReadMsr64 (
IN UINT32 Index
)
{
return __readmsr (Index);
}
#endif

View File

@ -0,0 +1,35 @@
/** @file
CpuBreakpoint function.
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.
**/
#if _MSC_EXTENSIONS
//
// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
//
void __writemsr (unsigned long Register, unsigned __int64 Value);
#pragma intrinsic(__writemsr)
UINT64
EFIAPI
AsmWriteMsr64 (
IN UINT32 Index,
IN UINT64 Value
)
{
__writemsr (Index, Value);
return Value;
}
#endif