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