VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseLib/Cpu.c@ 77599

最後變更 在這個檔案從77599是 48674,由 vboxsync 提交於 12 年 前

EFI: Export newly imported tinaocore UEFI sources to OSE.

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.6 KB
 
1/** @file
2 Base Library CPU Functions for all architectures.
3
4 Copyright (c) 2006 - 2010, 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#include "BaseLibInternals.h"
16
17
18/**
19 Disables CPU interrupts and returns the interrupt state prior to the disable
20 operation.
21
22 @retval TRUE CPU interrupts were enabled on entry to this call.
23 @retval FALSE CPU interrupts were disabled on entry to this call.
24
25**/
26BOOLEAN
27EFIAPI
28SaveAndDisableInterrupts (
29 VOID
30 )
31{
32 BOOLEAN InterruptState;
33
34 InterruptState = GetInterruptState ();
35 DisableInterrupts ();
36 return InterruptState;
37}
38
39/**
40 Set the current CPU interrupt state.
41
42 Sets the current CPU interrupt state to the state specified by
43 InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
44 InterruptState is FALSE, then interrupts are disabled. InterruptState is
45 returned.
46
47 @param InterruptState TRUE if interrupts should be enabled. FALSE if
48 interrupts should be disabled.
49
50 @return InterruptState
51
52**/
53BOOLEAN
54EFIAPI
55SetInterruptState (
56 IN BOOLEAN InterruptState
57 )
58{
59 if (InterruptState) {
60 EnableInterrupts ();
61 } else {
62 DisableInterrupts ();
63 }
64 return InterruptState;
65}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette