]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/CpuBreakpoint.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ebc / CpuBreakpoint.c
1 /*++
2
3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. 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 CpuBreakpoint.c
16
17 Abstract:
18
19
20 --*/
21
22 #include "..\BaseLibInternal.h"
23
24 extern
25 UINT64
26 _break (
27 CHAR8 BreakCode
28 );
29
30 /**
31 Generates a breakpoint on the CPU.
32
33 Generates a breakpoint on the CPU. The breakpoint must be implemented such
34 that code can resume normal execution after the breakpoint.
35
36 **/
37 VOID
38 EFIAPI
39 CpuBreakpoint (
40 VOID
41 )
42 {
43 _break (3);
44 }
45
46 /**
47 Used to serialize load and store operations.
48
49 All loads and stores that proceed calls to this function are guaranteed to be
50 globally visible when this function returns.
51
52 **/
53 VOID
54 EFIAPI
55 MemoryFence (
56 VOID
57 )
58 {
59 }
60
61 /**
62 Disables CPU interrupts.
63
64 Disables CPU interrupts.
65
66 **/
67 VOID
68 EFIAPI
69 DisableInterrupts (
70 VOID
71 )
72 {
73 ASSERT (FALSE);
74 }
75
76 /**
77 Enables CPU interrupts.
78
79 Enables CPU interrupts.
80
81 **/
82 VOID
83 EFIAPI
84 EnableInterrupts (
85 VOID
86 )
87 {
88 ASSERT (FALSE);
89 }
90
91 /**
92 Retrieves the current CPU interrupt state.
93
94 Retrieves the current CPU interrupt state. Returns TRUE is interrupts are
95 currently enabled. Otherwise returns FALSE.
96
97 @retval TRUE CPU interrupts are enabled.
98 @retval FALSE CPU interrupts are disabled.
99
100 **/
101 BOOLEAN
102 EFIAPI
103 GlueGetInterruptState (
104 VOID
105 )
106 {
107 ASSERT (FALSE);
108 return FALSE;
109 }
110
111 /**
112 Enables CPU interrupts for the smallest window required to capture any
113 pending interrupts.
114
115 Enables CPU interrupts for the smallest window required to capture any
116 pending interrupts.
117
118 **/
119 VOID
120 EFIAPI
121 EnableDisableInterrupts (
122 VOID
123 )
124 {
125 EnableInterrupts ();
126 DisableInterrupts ();
127 }
128
129 /**
130 Requests CPU to pause for a short period of time.
131
132 Requests CPU to pause for a short period of time. Typically used in MP
133 systems to prevent memory starvation while waiting for a spin lock.
134
135 **/
136 VOID
137 EFIAPI
138 CpuPause (
139 VOID
140 )
141 {
142 }
143
144 /**
145 Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
146
147 Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
148
149 **/
150 VOID
151 EFIAPI
152 CpuFlushTlb (
153 VOID
154 )
155 {
156 ASSERT (FALSE);
157 }
158
159 /**
160 Places the CPU in a sleep state until an interrupt is received.
161
162 Places the CPU in a sleep state until an interrupt is received. If interrupts
163 are disabled prior to calling this function, then the CPU will be placed in a
164 sleep state indefinitely.
165
166 **/
167 VOID
168 EFIAPI
169 CpuSleep (
170 VOID
171 )
172 {
173 }