• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   Base Library CPU functions for Itanium
3 
4   Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5   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 "BaseLibInternals.h"
17 
18 /**
19   Generates a breakpoint on the CPU.
20 
21   Generates a breakpoint on the CPU. The breakpoint must be implemented such
22   that code can resume normal execution after the breakpoint.
23 
24 **/
25 VOID
26 EFIAPI
CpuBreakpoint(VOID)27 CpuBreakpoint (
28   VOID
29   )
30 {
31   __break (0);
32 }
33 
34 /**
35   Used to serialize load and store operations.
36 
37   All loads and stores that proceed calls to this function are guaranteed to be
38   globally visible when this function returns.
39 
40 **/
41 VOID
42 EFIAPI
MemoryFence(VOID)43 MemoryFence (
44   VOID
45   )
46 {
47   __mfa ();
48 }
49 
50 /**
51   Disables CPU interrupts.
52 
53   Disables CPU interrupts.
54 
55 **/
56 VOID
57 EFIAPI
DisableInterrupts(VOID)58 DisableInterrupts (
59   VOID
60   )
61 {
62   _disable ();
63 }
64 
65 /**
66   Enables CPU interrupts.
67 
68   Enables CPU interrupts.
69 
70 **/
71 VOID
72 EFIAPI
EnableInterrupts(VOID)73 EnableInterrupts (
74   VOID
75   )
76 {
77   _enable ();
78 }
79 
80 /**
81   Enables CPU interrupts for the smallest window required to capture any
82   pending interrupts.
83 
84   Enables CPU interrupts for the smallest window required to capture any
85   pending interrupts.
86 
87 **/
88 VOID
89 EFIAPI
EnableDisableInterrupts(VOID)90 EnableDisableInterrupts (
91   VOID
92   )
93 {
94   EnableInterrupts ();
95   DisableInterrupts ();
96 }
97