]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c
1. Port X64, IPF and EBC arch for BaseLib
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ipf / CpuBreakpoint.c
1 /** @file
2 Base Library CPU functions for Itanium
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 //
16 // Include common header file for this module.
17 //
18 #include <BaseLibInternals.h>
19
20 //void __mfa (void);
21
22 #pragma intrinsic (_enable)
23 #pragma intrinsic (_disable)
24 #pragma intrinsic (__break)
25 #pragma intrinsic (__mfa)
26
27
28 /**
29 Generates a breakpoint on the CPU.
30
31 Generates a breakpoint on the CPU. The breakpoint must be implemented such
32 that code can resume normal execution after the breakpoint.
33
34 **/
35 VOID
36 EFIAPI
37 CpuBreakpoint (
38 VOID
39 )
40 {
41 __break (0);
42 }
43
44 /**
45 Used to serialize load and store operations.
46
47 All loads and stores that proceed calls to this function are guaranteed to be
48 globally visible when this function returns.
49
50 **/
51 VOID
52 EFIAPI
53 MemoryFence (
54 VOID
55 )
56 {
57 __mfa ();
58 }
59
60 /**
61 Disables CPU interrupts.
62
63 Disables CPU interrupts.
64
65 **/
66 VOID
67 EFIAPI
68 DisableInterrupts (
69 VOID
70 )
71 {
72 _disable ();
73 }
74
75 /**
76 Enables CPU interrupts.
77
78 Enables CPU interrupts.
79
80 **/
81 VOID
82 EFIAPI
83 EnableInterrupts (
84 VOID
85 )
86 {
87 _enable ();
88 }
89
90 /**
91 Enables CPU interrupts for the smallest window required to capture any
92 pending interrupts.
93
94 Enables CPU interrupts for the smallest window required to capture any
95 pending interrupts.
96
97 **/
98 VOID
99 EFIAPI
100 EnableDisableInterrupts (
101 VOID
102 )
103 {
104 EnableInterrupts ();
105 DisableInterrupts ();
106 }
107
108 /**
109 Places the CPU in a sleep state until an interrupt is received.
110
111 Places the CPU in a sleep state until an interrupt is received. If interrupts
112 are disabled prior to calling this function, then the CPU will be placed in a
113 sleep state indefinitely.
114
115 **/
116 VOID
117 EFIAPI
118 CpuSleep (
119 VOID
120 )
121 {
122 PalCallStatic (NULL, 29, 0, 0, 0);
123 }