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