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 #pragma intrinsic (_enable) 19 #pragma intrinsic (_disable) 20 #pragma intrinsic (__break) 21 #pragma intrinsic (__mfa) 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 CpuBreakpoint(VOID)32CpuBreakpoint ( 33 VOID 34 ) 35 { 36 __break (0); 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 MemoryFence(VOID)48MemoryFence ( 49 VOID 50 ) 51 { 52 __mfa (); 53 } 54 55 /** 56 Disables CPU interrupts. 57 58 Disables CPU interrupts. 59 60 **/ 61 VOID 62 EFIAPI DisableInterrupts(VOID)63DisableInterrupts ( 64 VOID 65 ) 66 { 67 _disable (); 68 } 69 70 /** 71 Enables CPU interrupts. 72 73 Enables CPU interrupts. 74 75 **/ 76 VOID 77 EFIAPI EnableInterrupts(VOID)78EnableInterrupts ( 79 VOID 80 ) 81 { 82 _enable (); 83 } 84 85 /** 86 Enables CPU interrupts for the smallest window required to capture any 87 pending interrupts. 88 89 Enables CPU interrupts for the smallest window required to capture any 90 pending interrupts. 91 92 **/ 93 VOID 94 EFIAPI EnableDisableInterrupts(VOID)95EnableDisableInterrupts ( 96 VOID 97 ) 98 { 99 EnableInterrupts (); 100 DisableInterrupts (); 101 } 102 103