]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/ResetRuntimeDxe/reset.c
MdePkg: Add ASSERT to handle local APIC not config properly
[mirror_edk2.git] / Nt32Pkg / ResetRuntimeDxe / reset.c
1 /**@file
2
3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Reset.c
15
16 Abstract:
17
18 Reset Architectural Protocol as defined in Tiano under NT Emulation
19
20 **/
21
22 #include <Uefi.h>
23 #include <WinNtDxe.h>
24 #include <Protocol/Reset.h>
25 #include <Library/DebugLib.h>
26 #include <Library/UefiDriverEntryPoint.h>
27 #include <Library/WinNtLib.h>
28 #include <Library/UefiBootServicesTableLib.h>
29
30
31 EFI_STATUS
32 EFIAPI
33 InitializeNtReset (
34 IN EFI_HANDLE ImageHandle,
35 IN EFI_SYSTEM_TABLE *SystemTable
36 );
37
38 VOID
39 EFIAPI
40 WinNtResetSystem (
41 IN EFI_RESET_TYPE ResetType,
42 IN EFI_STATUS ResetStatus,
43 IN UINTN DataSize,
44 IN VOID *ResetData OPTIONAL
45 );
46
47
48 EFI_STATUS
49 EFIAPI
50 InitializeNtReset (
51 IN EFI_HANDLE ImageHandle,
52 IN EFI_SYSTEM_TABLE *SystemTable
53 )
54 /*++
55
56 Routine Description:
57
58
59 Arguments:
60
61 ImageHandle of the loaded driver
62 Pointer to the System Table
63
64 Returns:
65
66 Status
67 --*/
68 // TODO: SystemTable - add argument and description to function comment
69 {
70 EFI_STATUS Status;
71 EFI_HANDLE Handle;
72
73 SystemTable->RuntimeServices->ResetSystem = WinNtResetSystem;
74
75 Handle = NULL;
76 Status = gBS->InstallMultipleProtocolInterfaces (
77 &Handle,
78 &gEfiResetArchProtocolGuid,
79 NULL,
80 NULL
81 );
82 ASSERT_EFI_ERROR (Status);
83
84 return Status;
85 }
86
87 VOID
88 EFIAPI
89 WinNtResetSystem (
90 IN EFI_RESET_TYPE ResetType,
91 IN EFI_STATUS ResetStatus,
92 IN UINTN DataSize,
93 IN VOID *ResetData OPTIONAL
94 )
95 /*++
96
97 Routine Description:
98
99 TODO: Add function description
100
101 Arguments:
102
103 ResetType - TODO: add argument description
104 ResetStatus - TODO: add argument description
105 DataSize - TODO: add argument description
106 ResetData - TODO: add argument description
107
108 Returns:
109
110 EFI_SUCCESS - TODO: Add description for return value
111
112 --*/
113 {
114 //
115 // BUGBUG Need to kill all console windows later
116 //
117 //
118 // Discard ResetType, always return 0 as exit code
119 //
120 gWinNt->ExitProcess (0);
121
122 //
123 // Should never go here
124 //
125 ASSERT (FALSE);
126 }