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