]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/X64/WriteMsr64.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / WriteMsr64.c
1 /** @file
2 CpuBreakpoint function.
3
4 Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 /**
10 Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
11 **/
12
13 #include <Library/RegisterFilterLib.h>
14
15 void
16 __writemsr (
17 unsigned long Register,
18 unsigned __int64 Value
19 );
20
21 #pragma intrinsic(__writemsr)
22
23 /**
24 Write data to MSR.
25
26 @param Index The register index of MSR.
27 @param Value Data wants to be written.
28
29 @return Value written to MSR.
30
31 **/
32 UINT64
33 EFIAPI
34 AsmWriteMsr64 (
35 IN UINT32 Index,
36 IN UINT64 Value
37 )
38 {
39 BOOLEAN Flag;
40
41 Flag = FilterBeforeMsrWrite (Index, &Value);
42 if (Flag) {
43 __writemsr (Index, Value);
44 }
45
46 FilterAfterMsrWrite (Index, &Value);
47
48 return Value;
49 }