]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Cpu.c
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Cpu.c
1 /*++
2
3 Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13 Module Name:
14
15 Cpu.c
16
17 Abstract:
18
19 Base Library CPU Functions for all architectures.
20
21 --*/
22
23 #include "BaseLibInternals.h"
24
25 /**
26 Disables CPU interrupts and returns the interrupt state prior to the disable
27 operation.
28
29 Disables CPU interrupts and returns the interrupt state prior to the disable
30 operation.
31
32 @retval TRUE CPU interrupts were enabled on entry to this call.
33 @retval FALSE CPU interrupts were disabled on entry to this call.
34
35 **/
36 BOOLEAN
37 EFIAPI
38 SaveAndDisableInterrupts (
39 VOID
40 )
41 {
42 BOOLEAN InterruptState;
43
44 InterruptState = GetInterruptState ();
45 DisableInterrupts ();
46 return InterruptState;
47 }
48
49 /**
50 Set the current CPU interrupt state.
51
52 Sets the current CPU interrupt state to the state specified by
53 InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
54 InterruptState is FALSE, then interrupts are disabled. InterruptState is
55 returned.
56
57 @param InterruptState TRUE if interrupts should enabled. FALSE if
58 interrupts should be disabled.
59
60 @return InterruptState
61
62 **/
63 BOOLEAN
64 EFIAPI
65 SetInterruptState (
66 IN BOOLEAN InterruptState
67 )
68 {
69 if (InterruptState) {
70 EnableInterrupts ();
71 } else {
72 DisableInterrupts ();
73 }
74 return InterruptState;
75 }