VirtualBox

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

最後變更 在這個檔案從80721是 80721,由 vboxsync 提交於 6 年 前

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

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

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