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