]>
Commit | Line | Data |
---|---|---|
c69dd9df | 1 | /*++\r |
2 | \r | |
6583c358 | 3 | Copyright (c) 2009, Intel Corporation \r |
c69dd9df | 4 | All rights reserved. This program and the accompanying materials \r |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT 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 | |
21 | EFI_HANDLE mResetHandle = NULL;\r | |
22 | \r | |
23 | \r | |
24 | EFI_STATUS\r | |
25 | EFIAPI\r | |
26 | InitializeReset (\r | |
27 | IN EFI_HANDLE ImageHandle,\r | |
28 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
29 | )\r | |
30 | /*++\r | |
31 | \r | |
32 | Routine Description:\r | |
33 | \r | |
34 | Initialize the state information for the Reset Architectural Protocol\r | |
35 | \r | |
36 | Arguments:\r | |
37 | \r | |
38 | ImageHandle of the loaded driver\r | |
39 | Pointer to the System Table\r | |
40 | \r | |
41 | Returns:\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 |