Current DxeResetSystemLib depends on UefiRuntimeLib because it calls
EfiResetSystem() API exposed by UefiRuntimeLib.
Due to the commit XXX which reverts UefiRuntimeLib to only support
DXE_RUNTIME_DRIVER, removing UefiRuntimeLib dependency makes the
DxeResetSystemLib can be used by DXE drivers.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c | 10 +++++-----
MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf | 3 +--
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
index ea452e3231..76bca223ae 100644
--- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
+++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
@@ -14,7 +14,7 @@
#include <PiDxe.h>
#include <Library/ResetSystemLib.h>
-#include <Library/UefiRuntimeLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
/**
This function causes a system-wide reset (cold reset), in which
@@ -30,7 +30,7 @@ ResetCold (
VOID
)
{
- EfiResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
+ gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
}
/**
@@ -45,7 +45,7 @@ ResetWarm (
VOID
)
{
- EfiResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
+ gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
}
/**
@@ -60,7 +60,7 @@ ResetShutdown (
VOID
)
{
- EfiResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
+ gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
}
/**
@@ -94,5 +94,5 @@ ResetPlatformSpecific (
IN VOID *ResetData
)
{
- EfiResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, ResetData);
+ gRT->ResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, ResetData);
}
diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
index 6eb2766b93..0d97d5899b 100644
--- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
+++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
@@ -35,5 +35,4 @@ [Packages]
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
- UefiRuntimeLib
-
+ UefiRuntimeServicesTableLib
--
2.16.1.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Hi Ray, On 06/01/18 09:22, Ruiyu Ni wrote: > Current DxeResetSystemLib depends on UefiRuntimeLib because it calls > EfiResetSystem() API exposed by UefiRuntimeLib. > > Due to the commit XXX which reverts UefiRuntimeLib to only support I really just cursorily skimmed the commit messages here, but I think you forgot to update the XXX placeholder above. Thanks! Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Haha, you are correct! I forgot to update the commit messages! My bad!! I will post a new version to address all concerns, including Star's. Thanks/Ray > -----Original Message----- > From: Laszlo Ersek <lersek@redhat.com> > Sent: Saturday, June 2, 2018 3:06 AM > To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org > Cc: Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com> > Subject: Re: [edk2] [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid > depending on UefiRuntimeLib > > Hi Ray, > > On 06/01/18 09:22, Ruiyu Ni wrote: > > Current DxeResetSystemLib depends on UefiRuntimeLib because it calls > > EfiResetSystem() API exposed by UefiRuntimeLib. > > > > Due to the commit XXX which reverts UefiRuntimeLib to only support > > I really just cursorily skimmed the commit messages here, but I think you > forgot to update the XXX placeholder above. > > Thanks! > Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Could interfaces in DxeResetSystemLib be used by runtime code?
If yes, gRT needs to be converted for runtime environment as we discussed about it at https://lists.01.org/pipermail/edk2-devel/2018-February/021260.html before.
Thanks,
Star
-----Original Message-----
From: Ni, Ruiyu
Sent: Friday, June 1, 2018 3:22 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid depending on UefiRuntimeLib
Current DxeResetSystemLib depends on UefiRuntimeLib because it calls
EfiResetSystem() API exposed by UefiRuntimeLib.
Due to the commit XXX which reverts UefiRuntimeLib to only support DXE_RUNTIME_DRIVER, removing UefiRuntimeLib dependency makes the DxeResetSystemLib can be used by DXE drivers.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c | 10 +++++-----
MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf | 3 +--
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
index ea452e3231..76bca223ae 100644
--- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
+++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
@@ -14,7 +14,7 @@
#include <PiDxe.h>
#include <Library/ResetSystemLib.h>
-#include <Library/UefiRuntimeLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
/**
This function causes a system-wide reset (cold reset), in which @@ -30,7 +30,7 @@ ResetCold (
VOID
)
{
- EfiResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
+ gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
}
/**
@@ -45,7 +45,7 @@ ResetWarm (
VOID
)
{
- EfiResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
+ gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
}
/**
@@ -60,7 +60,7 @@ ResetShutdown (
VOID
)
{
- EfiResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
+ gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
}
/**
@@ -94,5 +94,5 @@ ResetPlatformSpecific (
IN VOID *ResetData
)
{
- EfiResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, ResetData);
+ gRT->ResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize,
+ ResetData);
}
diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
index 6eb2766b93..0d97d5899b 100644
--- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
+++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
@@ -35,5 +35,4 @@ [Packages]
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
- UefiRuntimeLib
-
+ UefiRuntimeServicesTableLib
--
2.16.1.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
No.
DxeResetSystemLib cannot be used by runtime driver.
1. the gRT is not converted by itself.
2. Even if we change the library implementation to convert gRT in VirtualAddressChange callback,
when DXE driver links to this library, the problem similar to UefiRuntimeLib still occurs.
So I will make a V2 patch to remove runtime driver support.
Thanks/Ray
> -----Original Message-----
> From: Zeng, Star
> Sent: Monday, June 4, 2018 10:37 AM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: RE: [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid
> depending on UefiRuntimeLib
>
> Could interfaces in DxeResetSystemLib be used by runtime code?
> If yes, gRT needs to be converted for runtime environment as we discussed
> about it at https://lists.01.org/pipermail/edk2-devel/2018-
> February/021260.html before.
>
>
>
> Thanks,
> Star
>
> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Friday, June 1, 2018 3:22 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid depending
> on UefiRuntimeLib
>
> Current DxeResetSystemLib depends on UefiRuntimeLib because it calls
> EfiResetSystem() API exposed by UefiRuntimeLib.
>
> Due to the commit XXX which reverts UefiRuntimeLib to only support
> DXE_RUNTIME_DRIVER, removing UefiRuntimeLib dependency makes the
> DxeResetSystemLib can be used by DXE drivers.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> ---
> MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c | 10
> +++++-----
> MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf | 3 +--
> 2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git
> a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
> b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
> index ea452e3231..76bca223ae 100644
> --- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
> +++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c
> @@ -14,7 +14,7 @@
>
> #include <PiDxe.h>
> #include <Library/ResetSystemLib.h>
> -#include <Library/UefiRuntimeLib.h>
> +#include <Library/UefiRuntimeServicesTableLib.h>
>
> /**
> This function causes a system-wide reset (cold reset), in which @@ -30,7
> +30,7 @@ ResetCold (
> VOID
> )
> {
> - EfiResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
> + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
> }
>
> /**
> @@ -45,7 +45,7 @@ ResetWarm (
> VOID
> )
> {
> - EfiResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
> + gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
> }
>
> /**
> @@ -60,7 +60,7 @@ ResetShutdown (
> VOID
> )
> {
> - EfiResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
> + gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
> }
>
> /**
> @@ -94,5 +94,5 @@ ResetPlatformSpecific (
> IN VOID *ResetData
> )
> {
> - EfiResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize,
> ResetData);
> + gRT->ResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize,
> + ResetData);
> }
> diff --git
> a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
> b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
> index 6eb2766b93..0d97d5899b 100644
> --- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
> +++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
> @@ -35,5 +35,4 @@ [Packages]
> MdeModulePkg/MdeModulePkg.dec
>
> [LibraryClasses]
> - UefiRuntimeLib
> -
> + UefiRuntimeServicesTableLib
> --
> 2.16.1.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
© 2016 - 2026 Red Hat, Inc.