TianoCore EDK2
master
Loading...
Searching...
No Matches
DxeResetSystemLibMicrovm.c
Go to the documentation of this file.
1
9
#include <Base.h>
// BIT1
10
#include <
PiDxe.h
>
11
12
#include <
Library/BaseLib.h
>
// CpuDeadLoop()
13
#include <
Library/DebugLib.h
>
// ASSERT()
14
#include <
Library/DxeServicesTableLib.h
>
15
#include <
Library/IoLib.h
>
// IoWrite8()
16
#include <
Library/ResetSystemLib.h
>
// ResetCold()
17
#include <
Library/TimerLib.h
>
// MicroSecondDelay()
18
#include <
Library/UefiRuntimeLib.h
>
// EfiGoneVirtual()
19
#include <
OvmfPlatforms.h
>
// PIIX4_PMBA_VALUE
20
21
EFI_STATUS
22
EFIAPI
23
DxeResetSystemLibMicrovmConstructor (
24
IN
EFI_HANDLE
ImageHandle,
25
IN
EFI_SYSTEM_TABLE
*SystemTable
26
)
27
{
28
UINTN
Address = MICROVM_GED_MMIO_BASE;
29
EFI_STATUS
Status;
30
EFI_GCD_MEMORY_SPACE_DESCRIPTOR
Descriptor;
31
32
DEBUG
((DEBUG_INFO,
"%a: start\n"
, __func__));
33
34
Status =
gDS
->GetMemorySpaceDescriptor (Address, &Descriptor);
35
if
(EFI_ERROR (Status)) {
36
DEBUG
((DEBUG_INFO,
"%a: GetMemorySpaceDescriptor failed\n"
, __func__));
37
return
RETURN_UNSUPPORTED
;
38
}
39
40
Status =
gDS
->SetMemorySpaceAttributes (
41
Address,
42
SIZE_4KB,
43
Descriptor.
Attributes
| EFI_MEMORY_RUNTIME
44
);
45
if
(EFI_ERROR (Status)) {
46
DEBUG
((DEBUG_INFO,
"%a: SetMemorySpaceAttributes failed\n"
, __func__));
47
return
RETURN_UNSUPPORTED
;
48
}
49
50
DEBUG
((DEBUG_INFO,
"%a: done\n"
, __func__));
51
return
EFI_SUCCESS
;
52
}
UINTN
UINT64 UINTN
Definition:
ProcessorBind.h:112
BaseLib.h
DxeServicesTableLib.h
gDS
EFI_DXE_SERVICES * gDS
Definition:
DxeServicesTableLib.c:29
IoLib.h
RETURN_UNSUPPORTED
#define RETURN_UNSUPPORTED
Definition:
Base.h:1081
IN
#define IN
Definition:
Base.h:279
DebugLib.h
DEBUG
#define DEBUG(Expression)
Definition:
DebugLib.h:434
OvmfPlatforms.h
PiDxe.h
ResetSystemLib.h
TimerLib.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_HANDLE
VOID * EFI_HANDLE
Definition:
UefiBaseType.h:33
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
UefiRuntimeLib.h
EFI_GCD_MEMORY_SPACE_DESCRIPTOR
Definition:
PiDxeCis.h:124
EFI_GCD_MEMORY_SPACE_DESCRIPTOR::Attributes
UINT64 Attributes
Definition:
PiDxeCis.h:147
EFI_SYSTEM_TABLE
Definition:
UefiSpec.h:2028
OvmfPkg
Library
ResetSystemLib
DxeResetSystemLibMicrovm.c
Generated on Fri Nov 15 2024 18:01:21 for TianoCore EDK2 by
1.9.6