2007-07-02 11:34:25 +02:00
|
|
|
/** @file
|
|
|
|
CpuBreakpoint function.
|
|
|
|
|
2021-03-12 11:05:07 +01:00
|
|
|
Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
|
2019-04-04 01:06:00 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2007-07-02 11:34:25 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
2008-07-25 14:21:57 +02:00
|
|
|
/**
|
|
|
|
Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
|
|
|
|
**/
|
2008-10-24 10:18:36 +02:00
|
|
|
|
2021-03-12 11:05:07 +01:00
|
|
|
#include <Library/RegisterFilterLib.h>
|
|
|
|
|
2007-07-02 11:34:25 +02:00
|
|
|
void __writemsr (unsigned long Register, unsigned __int64 Value);
|
|
|
|
|
|
|
|
#pragma intrinsic(__writemsr)
|
|
|
|
|
2008-07-25 14:21:57 +02:00
|
|
|
/**
|
|
|
|
Write data to MSR.
|
|
|
|
|
2010-06-24 02:20:35 +02:00
|
|
|
@param Index The register index of MSR.
|
2008-07-25 14:21:57 +02:00
|
|
|
@param Value Data wants to be written.
|
|
|
|
|
|
|
|
@return Value written to MSR.
|
|
|
|
|
|
|
|
**/
|
2007-07-02 11:34:25 +02:00
|
|
|
UINT64
|
|
|
|
EFIAPI
|
|
|
|
AsmWriteMsr64 (
|
|
|
|
IN UINT32 Index,
|
|
|
|
IN UINT64 Value
|
|
|
|
)
|
|
|
|
{
|
2021-03-12 11:05:07 +01:00
|
|
|
BOOLEAN Flag;
|
|
|
|
|
|
|
|
Flag = FilterBeforeMsrWrite (Index, &Value);
|
|
|
|
if (Flag) {
|
|
|
|
__writemsr (Index, Value);
|
|
|
|
}
|
|
|
|
FilterAfterMsrWrite (Index, &Value);
|
|
|
|
|
2007-07-02 11:34:25 +02:00
|
|
|
return Value;
|
|
|
|
}
|
|
|
|
|