]> git.proxmox.com Git - mirror_edk2.git/blob - PcAtChipsetPkg/KbcResetDxe/Reset.c
Fix a security hole in shell binaries:
[mirror_edk2.git] / PcAtChipsetPkg / KbcResetDxe / Reset.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. 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 Reset.c
14
15 Abstract:
16
17 Reset Architectural Protocol implementation
18
19 --*/
20
21 #include "Reset.h"
22
23 VOID
24 EFIAPI
25 KbcResetSystem (
26 IN EFI_RESET_TYPE ResetType,
27 IN EFI_STATUS ResetStatus,
28 IN UINTN DataSize,
29 IN VOID *ResetData OPTIONAL
30 )
31 /*++
32
33 Routine Description:
34
35 Reset the system.
36
37 Arguments:
38
39 ResetType - warm or cold
40 ResetStatus - possible cause of reset
41 DataSize - Size of ResetData in bytes
42 ResetData - Optional Unicode string
43 For details, see efiapi.h
44
45 Returns:
46 Does not return if the reset takes place.
47 EFI_INVALID_PARAMETER If ResetType is invalid.
48
49 --*/
50 {
51 UINT8 Data;
52
53 switch (ResetType) {
54 case EfiResetWarm:
55 case EfiResetCold:
56 case EfiResetShutdown:
57 Data = 0xfe;
58 IoWrite8 (0x64, Data);
59 break;
60
61 default:
62 return ;
63 }
64
65 //
66 // Given we should have reset getting here would be bad
67 //
68 ASSERT (FALSE);
69 }
70