Leaked source code of windows server 2003
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.4 KiB

  1. /*++
  2. Copyright (c) 1998 Intel Corporation
  3. Module Name:
  4. getmtc
  5. Abstract:
  6. Get next monotonic count
  7. Revision History
  8. --*/
  9. #include "shell.h"
  10. /*
  11. *
  12. */
  13. EFI_STATUS
  14. InitializeGetMTC (
  15. IN EFI_HANDLE ImageHandle,
  16. IN EFI_SYSTEM_TABLE *SystemTable
  17. );
  18. /*
  19. *
  20. */
  21. EFI_DRIVER_ENTRY_POINT(InitializeGetMTC)
  22. EFI_STATUS
  23. InitializeGetMTC (
  24. IN EFI_HANDLE ImageHandle,
  25. IN EFI_SYSTEM_TABLE *SystemTable
  26. )
  27. {
  28. UINT64 mtc;
  29. EFI_STATUS Status;
  30. /*
  31. * Check to see if the app is to install as a "internal command"
  32. * to the shell
  33. */
  34. InstallInternalShellCommand (
  35. ImageHandle, SystemTable, InitializeGetMTC,
  36. L"getmtc", /* command */
  37. L"getmtc", /* command syntax */
  38. L"Get next monotonic count", /* 1 line descriptor */
  39. NULL /* command help page */
  40. );
  41. /*
  42. * Initialize app
  43. */
  44. InitializeShellApplication (ImageHandle, SystemTable);
  45. Status = BS->GetNextMonotonicCount(&mtc);
  46. if (EFI_ERROR(Status)) {
  47. Print (L"Failed to get Monotonic count - %r\n", Status);
  48. } else {
  49. Print (L"Monotonic count = %hlx\n", mtc);
  50. }
  51. return EFI_SUCCESS;
  52. }