Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1999 Intel Corporation
  3. Module Name:
  4. reset.c
  5. Abstract:
  6. Revision History
  7. --*/
  8. #include "shell.h"
  9. EFI_STATUS
  10. InitializeReset (
  11. IN EFI_HANDLE ImageHandle,
  12. IN EFI_SYSTEM_TABLE *SystemTable
  13. );
  14. EFI_DRIVER_ENTRY_POINT(InitializeReset)
  15. EFI_STATUS
  16. InitializeReset (
  17. IN EFI_HANDLE ImageHandle,
  18. IN EFI_SYSTEM_TABLE *SystemTable
  19. )
  20. /*+++
  21. reset [warm]
  22. --*/
  23. {
  24. EFI_RESET_TYPE ResetType;
  25. UINTN DataSize;
  26. CHAR16 *ResetData, *Str;
  27. InstallInternalShellCommand (
  28. ImageHandle, SystemTable, InitializeReset,
  29. L"reset", /* command */
  30. L"reset [/warm] [reset string]", /* command syntax */
  31. L"Cold or Warm reset", /* 1 line descriptor */
  32. NULL /* command help page */
  33. );
  34. InitializeShellApplication (ImageHandle, SystemTable);
  35. ResetType = EfiResetCold;
  36. if (SI->Argc > 1) {
  37. Str = SI->Argv[1];
  38. if (Str[0] == '-' || Str[0] == '/') {
  39. if (Str[1] = 'W' || Str[1] == 'w') {
  40. ResetType = EfiResetWarm;
  41. } else {
  42. Print(L"reset [/warm] [reset string]\n");
  43. return EFI_SUCCESS;
  44. }
  45. }
  46. }
  47. DataSize = 0;
  48. ResetData = NULL;
  49. if (SI->Argc > 2) {
  50. ResetData = SI->Argv[2];
  51. DataSize = StrSize(ResetData);
  52. }
  53. return RT->ResetSystem(ResetType, EFI_SUCCESS, DataSize, ResetData);
  54. }