]>
Commit | Line | Data |
---|---|---|
75aadf59 | 1 | /** @file\r |
2 | Main file for NULL named library for install1 shell command functions.\r | |
3 | \r | |
4 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include "UefiShellInstall1CommandsLib.h"\r | |
16 | \r | |
17 | STATIC CONST CHAR16 mFileName[] = L"ShellCommands";\r | |
18 | EFI_HANDLE gShellInstall1HiiHandle = NULL;\r | |
19 | CONST EFI_GUID gShellInstall1HiiGuid = \\r | |
20 | { \\r | |
21 | 0x7d574d54, 0xd364, 0x4d4a, { 0x95, 0xe3, 0x49, 0x45, 0xdb, 0x7a, 0xd3, 0xee } \\r | |
22 | };\r | |
23 | \r | |
24 | CONST CHAR16*\r | |
25 | EFIAPI\r | |
26 | ShellCommandGetManFileNameInstall1 (\r | |
27 | VOID\r | |
28 | )\r | |
29 | {\r | |
30 | return (mFileName);\r | |
31 | }\r | |
32 | \r | |
33 | /**\r | |
34 | Constructor for the Shell Level 1 Commands library.\r | |
35 | \r | |
36 | Install the handlers for level 1 UEFI Shell 2.0 commands.\r | |
37 | \r | |
38 | @param ImageHandle the image handle of the process\r | |
39 | @param SystemTable the EFI System Table pointer\r | |
40 | \r | |
41 | @retval EFI_SUCCESS the shell command handlers were installed sucessfully\r | |
42 | @retval EFI_UNSUPPORTED the shell level required was not found.\r | |
43 | **/\r | |
44 | EFI_STATUS\r | |
45 | EFIAPI\r | |
46 | ShellInstall1CommandsLibConstructor (\r | |
47 | IN EFI_HANDLE ImageHandle,\r | |
48 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
49 | )\r | |
50 | {\r | |
51 | //\r | |
52 | // check our bit of the profiles mask\r | |
53 | //\r | |
54 | if ((PcdGet8(PcdShellProfileMask) & BIT2) == 0) {\r | |
55 | return (EFI_UNSUPPORTED);\r | |
56 | }\r | |
57 | \r | |
58 | gShellInstall1HiiHandle = HiiAddPackages (&gShellInstall1HiiGuid, gImageHandle, UefiShellInstall1CommandsLibStrings, NULL);\r | |
59 | if (gShellInstall1HiiHandle == NULL) {\r | |
60 | return (EFI_DEVICE_ERROR);\r | |
61 | }\r | |
62 | \r | |
63 | //\r | |
64 | // install our shell command handlers that are always installed\r | |
65 | //\r | |
66 | ShellCommandRegisterCommandName(L"bcfg", ShellCommandRunBcfgInstall , ShellCommandGetManFileNameInstall1, 0, L"Install", FALSE, gShellInstall1HiiHandle, STRING_TOKEN(STR_GET_HELP_BCFG));\r | |
67 | \r | |
68 | return (EFI_SUCCESS);\r | |
69 | }\r | |
70 | \r | |
71 | /**\r | |
72 | Destructor for the library. free any resources.\r | |
73 | **/\r | |
74 | EFI_STATUS\r | |
75 | EFIAPI\r | |
76 | ShellInstall1CommandsLibDestructor (\r | |
77 | IN EFI_HANDLE ImageHandle,\r | |
78 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
79 | )\r | |
80 | {\r | |
81 | if (gShellInstall1HiiHandle != NULL) {\r | |
82 | HiiRemovePackages(gShellInstall1HiiHandle);\r | |
83 | }\r | |
84 | return (EFI_SUCCESS);\r | |
85 | }\r |