add internal command header reference
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ebc / CpuBreakpoint.c
1 /** @file
2 Base Library CPU Functions for EBC
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 // Include common header file for this module.
16 //
17 #include <BaseLibInternals.h>
18
19 extern
20 UINT64
21 _break (
22 CHAR8 BreakCode
23 );
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 (3);
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 }
55
56 /**
57 Disables CPU interrupts.
58
59 Disables CPU interrupts.
60
61 **/
62 VOID
63 EFIAPI
64 DisableInterrupts (
65 VOID
66 )
67 {
68 ASSERT (FALSE);
69 }
70
71 /**
72 Enables CPU interrupts.
73
74 Enables CPU interrupts.
75
76 **/
77 VOID
78 EFIAPI
79 EnableInterrupts (
80 VOID
81 )
82 {
83 ASSERT (FALSE);
84 }
85
86 /**
87 Retrieves the current CPU interrupt state.
88
89 Retrieves the current CPU interrupt state. Returns TRUE is interrupts are
90 currently enabled. Otherwise returns FALSE.
91
92 @retval TRUE CPU interrupts are enabled.
93 @retval FALSE CPU interrupts are disabled.
94
95 **/
96 BOOLEAN
97 EFIAPI
98 GetInterruptState (
99 VOID
100 )
101 {
102 ASSERT (FALSE);
103 return FALSE;
104 }
105
106 /**
107 Enables CPU interrupts for the smallest window required to capture any
108 pending interrupts.
109
110 Enables CPU interrupts for the smallest window required to capture any
111 pending interrupts.
112
113 **/
114 VOID
115 EFIAPI
116 EnableDisableInterrupts (
117 VOID
118 )
119 {
120 EnableInterrupts ();
121 DisableInterrupts ();
122 }
123
124 /**
125 Requests CPU to pause for a short period of time.
126
127 Requests CPU to pause for a short period of time. Typically used in MP
128 systems to prevent memory starvation while waiting for a spin lock.
129
130 **/
131 VOID
132 EFIAPI
133 CpuPause (
134 VOID
135 )
136 {
137 }
138
139 /**
140 Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
141
142 Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
143
144 **/
145 VOID
146 EFIAPI
147 CpuFlushTlb (
148 VOID
149 )
150 {
151 ASSERT (FALSE);
152 }
153
154 /**
155 Places the CPU in a sleep state until an interrupt is received.
156
157 Places the CPU in a sleep state until an interrupt is received. If interrupts
158 are disabled prior to calling this function, then the CPU will be placed in a
159 sleep state indefinitely.
160
161 **/
162 VOID
163 EFIAPI
164 CpuSleep (
165 VOID
166 )
167 {
168 }