VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c@ 58459

Last change on this file since 58459 was 58459, checked in by vboxsync, 9 years ago

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

  • Property svn:eol-style set to native
File size: 3.6 KB
Line 
1/** @file
2 Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol
3 and DevPathToText Protocol.
4
5Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
6This program and the accompanying materials
7are licensed and made available under the terms and conditions of the BSD License
8which accompanies this distribution. The full text of the license may be found at
9http://opensource.org/licenses/bsd-license.php
10
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14**/
15
16#include <Uefi.h>
17#include <Protocol/DevicePathUtilities.h>
18#include <Protocol/DevicePathToText.h>
19#include <Protocol/DevicePathFromText.h>
20#include <Library/UefiDriverEntryPoint.h>
21#include <Library/UefiBootServicesTableLib.h>
22#include <Library/DevicePathLib.h>
23#include <Library/PcdLib.h>
24
25GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {
26 GetDevicePathSize,
27 DuplicateDevicePath,
28 AppendDevicePath,
29 AppendDevicePathNode,
30 AppendDevicePathInstance,
31 GetNextDevicePathInstance,
32 IsDevicePathMultiInstance,
33 CreateDeviceNode
34};
35
36GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {
37 ConvertDeviceNodeToText,
38 ConvertDevicePathToText
39};
40
41GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {
42 ConvertTextToDeviceNode,
43 ConvertTextToDevicePath
44};
45
46/**
47 The user Entry Point for DevicePath module.
48
49 This is the entry point for DevicePath module. It installs the UEFI Device Path Utility Protocol and
50 optionally the Device Path to Text and Device Path from Text protocols based on feature flags.
51
52 @param[in] ImageHandle The firmware allocated handle for the EFI image.
53 @param[in] SystemTable A pointer to the EFI System Table.
54
55 @retval EFI_SUCCESS The entry point is executed successfully.
56 @retval Others Some error occurs when executing this entry point.
57
58**/
59EFI_STATUS
60EFIAPI
61DevicePathEntryPoint (
62 IN EFI_HANDLE ImageHandle,
63 IN EFI_SYSTEM_TABLE *SystemTable
64 )
65{
66 EFI_STATUS Status;
67 EFI_HANDLE Handle;
68
69 Handle = NULL;
70 Status = EFI_UNSUPPORTED;
71 if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {
72 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {
73 Status = gBS->InstallMultipleProtocolInterfaces (
74 &Handle,
75 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
76 &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,
77 &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,
78 NULL
79 );
80 } else {
81 Status = gBS->InstallMultipleProtocolInterfaces (
82 &Handle,
83 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
84 &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,
85 NULL
86 );
87 }
88 } else {
89 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {
90 Status = gBS->InstallMultipleProtocolInterfaces (
91 &Handle,
92 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
93 &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,
94 NULL
95 );
96 } else {
97 Status = gBS->InstallMultipleProtocolInterfaces (
98 &Handle,
99 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
100 NULL
101 );
102 }
103 }
104 return Status;
105}
Note: See TracBrowser for help on using the repository browser.

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