]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/GenericBdsLib/Ipf/ShadowRom.c
Clean up GenericBdsLib library Instance.
[mirror_edk2.git] / MdeModulePkg / Library / GenericBdsLib / Ipf / ShadowRom.c
CommitLineData
897f0eee 1/** @file\r
2 Shadow all option rom\r
3\r
4Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
897f0eee 15#include "InternalBdsLib.h"\r
16\r
17UINT8 mShadowRomFlag = 0;\r
18\r
11ef23f9 19/**\r
20 Shadow all opton ROM if the it is not done.\r
21**/\r
897f0eee 22VOID\r
11ef23f9 23ShadowAllOptionRom(\r
24 VOID\r
25 )\r
897f0eee 26{\r
27 EFI_STATUS Status;\r
28 EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;\r
29 //\r
30 // Rom shadow only do once.\r
31 //\r
32 if (mShadowRomFlag == 0) {\r
33 Status = gBS->LocateProtocol (\r
34 &gEfiLegacyBiosProtocolGuid,\r
35 NULL,\r
36 (VOID **) &LegacyBios\r
37 );\r
38 if (!EFI_ERROR (Status)) {\r
39 LegacyBios->PrepareToBootEfi (LegacyBios, NULL, NULL);\r
40 }\r
41\r
42 mShadowRomFlag = 1;\r
43 }\r
44\r
45 return ;\r
46}\r