]> git.proxmox.com Git - mirror_edk2.git/blame - PcAtChipsetPkg/KbcResetDxe/ResetEntry.c
Fix a security hole in shell binaries:
[mirror_edk2.git] / PcAtChipsetPkg / KbcResetDxe / ResetEntry.c
CommitLineData
c69dd9df 1/*++\r
2\r
6583c358 3Copyright (c) 2009, Intel Corporation \r
c69dd9df 4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
c69dd9df 12\r
c69dd9df 13\r
14--*/\r
15\r
16#include "Reset.h"\r
17\r
18//\r
19// The handle onto which the Reset Architectural Protocol is installed\r
20//\r
21EFI_HANDLE mResetHandle = NULL;\r
22\r
23\r
24EFI_STATUS\r
25EFIAPI\r
26InitializeReset (\r
27 IN EFI_HANDLE ImageHandle,\r
28 IN EFI_SYSTEM_TABLE *SystemTable\r
29 )\r
30/*++\r
31\r
32Routine Description:\r
33\r
34 Initialize the state information for the Reset Architectural Protocol\r
35\r
36Arguments:\r
37\r
38 ImageHandle of the loaded driver\r
39 Pointer to the System Table\r
40\r
41Returns:\r
42\r
43 Status\r
44\r
45 EFI_SUCCESS - thread can be successfully created\r
46 EFI_OUT_OF_RESOURCES - cannot allocate protocol data structure\r
47 EFI_DEVICE_ERROR - cannot create the timer service\r
48\r
49--*/\r
50// TODO: SystemTable - add argument and description to function comment\r
51{\r
52 EFI_STATUS Status;\r
53\r
54 //\r
55 // Make sure the Reset Architectural Protocol is not already installed in the system\r
56 //\r
57 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiResetArchProtocolGuid);\r
58\r
59 //\r
60 // Hook the runtime service table\r
61 //\r
62 SystemTable->RuntimeServices->ResetSystem = KbcResetSystem;\r
63\r
64 //\r
65 // Now install the Reset RT AP on a new handle\r
66 //\r
67 Status = gBS->InstallMultipleProtocolInterfaces (\r
68 &mResetHandle,\r
69 &gEfiResetArchProtocolGuid,\r
70 NULL,\r
71 NULL\r
72 );\r
73 ASSERT_EFI_ERROR (Status);\r
74\r
75 return Status;\r
76}\r