]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ebc/CpuBreakpoint.c
ec7df5ea47f7560299235596043fa38995a3adb0
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ebc / CpuBreakpoint.c
1 /** @file
2 Base Library CPU Functions for EBC
3
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "BaseLibInternals.h"
10
11 extern
12 UINT64
13 _break (
14 CHAR8 BreakCode
15 );
16
17 /**
18 Generates a breakpoint on the CPU.
19
20 Generates a breakpoint on the CPU. The breakpoint must be implemented such
21 that code can resume normal execution after the breakpoint.
22
23 **/
24 VOID
25 EFIAPI
26 CpuBreakpoint (
27 VOID
28 )
29 {
30 _break (3);
31 }
32
33 /**
34 Used to serialize load and store operations.
35
36 All loads and stores that proceed calls to this function are guaranteed to be
37 globally visible when this function returns.
38
39 **/
40 VOID
41 EFIAPI
42 MemoryFence (
43 VOID
44 )
45 {
46 }
47
48 /**
49 Disables CPU interrupts.
50
51 **/
52 VOID
53 EFIAPI
54 DisableInterrupts (
55 VOID
56 )
57 {
58 ASSERT (FALSE);
59 }
60
61 /**
62 Enables CPU interrupts.
63
64 **/
65 VOID
66 EFIAPI
67 EnableInterrupts (
68 VOID
69 )
70 {
71 ASSERT (FALSE);
72 }
73
74 /**
75 Retrieves the current CPU interrupt state.
76
77 Returns TRUE means interrupts are currently enabled. Otherwise,
78 returns FALSE.
79
80 @retval TRUE CPU interrupts are enabled.
81 @retval FALSE CPU interrupts are disabled.
82
83 **/
84 BOOLEAN
85 EFIAPI
86 GetInterruptState (
87 VOID
88 )
89 {
90 ASSERT (FALSE);
91 return FALSE;
92 }
93
94 /**
95 Enables CPU interrupts for the smallest window required to capture any
96 pending interrupts.
97
98 **/
99 VOID
100 EFIAPI
101 EnableDisableInterrupts (
102 VOID
103 )
104 {
105 EnableInterrupts ();
106 DisableInterrupts ();
107 }
108
109 /**
110 Requests CPU to pause for a short period of time.
111
112 Requests CPU to pause for a short period of time. Typically used in MP
113 systems to prevent memory starvation while waiting for a spin lock.
114
115 **/
116 VOID
117 EFIAPI
118 CpuPause (
119 VOID
120 )
121 {
122 }