]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ipf/CpuBreakpointMsc.c
74911b27649659cbca734f251a34fabbe30a7a53
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ipf / CpuBreakpointMsc.c
1 /** @file
2 Base Library CPU functions for Itanium
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 //
16 // Include common header file for this module.
17 //
18 #include <BaseLibInternals.h>
19
20 #pragma intrinsic (_enable)
21 #pragma intrinsic (_disable)
22 #pragma intrinsic (__break)
23 #pragma intrinsic (__mfa)
24
25 /**
26 Generates a breakpoint on the CPU.
27
28 Generates a breakpoint on the CPU. The breakpoint must be implemented such
29 that code can resume normal execution after the breakpoint.
30
31 **/
32 VOID
33 EFIAPI
34 CpuBreakpoint (
35 VOID
36 )
37 {
38 __break (0);
39 }
40
41 /**
42 Used to serialize load and store operations.
43
44 All loads and stores that proceed calls to this function are guaranteed to be
45 globally visible when this function returns.
46
47 **/
48 VOID
49 EFIAPI
50 MemoryFence (
51 VOID
52 )
53 {
54 __mfa ();
55 }
56
57 /**
58 Disables CPU interrupts.
59
60 Disables CPU interrupts.
61
62 **/
63 VOID
64 EFIAPI
65 DisableInterrupts (
66 VOID
67 )
68 {
69 _disable ();
70 }
71
72 /**
73 Enables CPU interrupts.
74
75 Enables CPU interrupts.
76
77 **/
78 VOID
79 EFIAPI
80 EnableInterrupts (
81 VOID
82 )
83 {
84 _enable ();
85 }
86
87 /**
88 Enables CPU interrupts for the smallest window required to capture any
89 pending interrupts.
90
91 Enables CPU interrupts for the smallest window required to capture any
92 pending interrupts.
93
94 **/
95 VOID
96 EFIAPI
97 EnableDisableInterrupts (
98 VOID
99 )
100 {
101 EnableInterrupts ();
102 DisableInterrupts ();
103 }
104