public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after execution.
@ 2018-05-05 14:25 Marvin Häuser
  2018-05-07  1:51 ` Zeng, Star
  0 siblings, 1 reply; 3+ messages in thread
From: Marvin Häuser @ 2018-05-05 14:25 UTC (permalink / raw)
  To: edk2-devel@lists.01.org
  Cc: star.zeng@intel.com, eric.dong@intel.com, ruiyu.ni@intel.com

AcpiPlatformDxe solely performs one-time tasks and does not expose
any services or create any events. Hence it can safely be unloaded
after the Entry Point execution by returning an error code.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
index 44bdd94fa8db..8772961bfd31 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
@@ -1,7 +1,7 @@
 /** @file
   Sample ACPI Platform Driver
 
-  Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -255,6 +255,9 @@ AcpiPlatformEntryPoint (
     }
   }
 
-  return EFI_SUCCESS;
+  //
+  // Return an error code so that the driver is unloaded.
+  //
+  return EFI_ALREADY_STARTED;
 }
 
-- 
2.17.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after execution.
  2018-05-05 14:25 Marvin Häuser
@ 2018-05-07  1:51 ` Zeng, Star
  0 siblings, 0 replies; 3+ messages in thread
From: Zeng, Star @ 2018-05-07  1:51 UTC (permalink / raw)
  To: Marvin.Haeuser@outlook.com, edk2-devel@lists.01.org
  Cc: Dong, Eric, Ni, Ruiyu, Zeng, Star

It is a good change. :)

Only one minor comment. How about using EFI_REQUEST_UNLOAD_IMAGE instead?


///
/// If this value is returned by an EFI image, then the image should be unloaded.
///
#define EFI_REQUEST_UNLOAD_IMAGE  DXE_ERROR (1)


Thanks,
Star
-----Original Message-----
From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com] 
Sent: Saturday, May 5, 2018 10:26 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
Subject: [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after execution.

AcpiPlatformDxe solely performs one-time tasks and does not expose any services or create any events. Hence it can safely be unloaded after the Entry Point execution by returning an error code.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
index 44bdd94fa8db..8772961bfd31 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
@@ -1,7 +1,7 @@
 /** @file
   Sample ACPI Platform Driver
 
-  Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2008 - 2018, Intel Corporation. All rights 
+ reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at @@ -255,6 +255,9 @@ AcpiPlatformEntryPoint (
     }
   }
 
-  return EFI_SUCCESS;
+  //
+  // Return an error code so that the driver is unloaded.
+  //
+  return EFI_ALREADY_STARTED;
 }
 
--
2.17.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after execution.
@ 2018-05-07  8:49 Marvin Häuser
  0 siblings, 0 replies; 3+ messages in thread
From: Marvin Häuser @ 2018-05-07  8:49 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: Zeng, Star

Sorry, I did not realize that error code was a thing.
Sure, I will submit a V2 soon, thanks!

Best regards,
Marvin

> -----Ursprüngliche Nachricht-----
> Von: Zeng, Star <star.zeng@intel.com>
> Gesendet: Montag, 7. Mai 2018 03:52
> An: Marvin.Haeuser@outlook.com; edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; Zeng,
> Star <star.zeng@intel.com>
> Betreff: RE: [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after
> execution.
> 
> It is a good change. :)
> 
> Only one minor comment. How about using EFI_REQUEST_UNLOAD_IMAGE
> instead?
> 
> 
> ///
> /// If this value is returned by an EFI image, then the image should be
> unloaded.
> ///
> #define EFI_REQUEST_UNLOAD_IMAGE  DXE_ERROR (1)
> 
> 
> Thanks,
> Star
> -----Original Message-----
> From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com]
> Sent: Saturday, May 5, 2018 10:26 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni,
> Ruiyu <ruiyu.ni@intel.com>
> Subject: [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after execution.
> 
> AcpiPlatformDxe solely performs one-time tasks and does not expose any
> services or create any events. Hence it can safely be unloaded after the Entry
> Point execution by returning an error code.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c | 7 +++++-
> -
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
> b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
> index 44bdd94fa8db..8772961bfd31 100644
> --- a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
> +++ b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c
> @@ -1,7 +1,7 @@
>  /** @file
>    Sample ACPI Platform Driver
> 
> -  Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2008 - 2018, Intel Corporation. All rights
> + reserved.<BR>
>    This program and the accompanying materials
>    are licensed and made available under the terms and conditions of the BSD
> License
>    which accompanies this distribution.  The full text of the license may be
> found at @@ -255,6 +255,9 @@ AcpiPlatformEntryPoint (
>      }
>    }
> 
> -  return EFI_SUCCESS;
> +  //
> +  // Return an error code so that the driver is unloaded.
> +  //
> +  return EFI_ALREADY_STARTED;
>  }
> 
> --
> 2.17.0.windows.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-07  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-07  8:49 [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after execution Marvin Häuser
  -- strict thread matches above, loose matches on Subject: below --
2018-05-05 14:25 Marvin Häuser
2018-05-07  1:51 ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox