Windows NT 4.0 source code leak
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.

79 lines
1.6 KiB

4 years ago
  1. // TITLE("Processor Idle")
  2. //++
  3. //
  4. // Copyright (c) 1994 Microsoft Corporation
  5. //
  6. // Module Name:
  7. //
  8. // xxidle.s
  9. //
  10. // Abstract:
  11. //
  12. // This module implements system platform dependent power management
  13. // support.
  14. //
  15. // Author:
  16. //
  17. // David N. Cutler (davec) 5-Mar-1994
  18. //
  19. // Environment:
  20. //
  21. // Kernel mode only.
  22. //
  23. // Revision History:
  24. //
  25. //--
  26. #include "halmips.h"
  27. SBTTL("Processor Idle")
  28. //++
  29. //
  30. // VOID
  31. // HalProcessorIdle(
  32. // VOID
  33. // )
  34. //
  35. // Routine Description:
  36. //
  37. // This function is called when the current processor is idle with
  38. // interrupts disabled. There is no thread active and there are no
  39. // DPCs to process. Therefore, power can be switched to a standby
  40. // mode until the the next interrupt occurs on the current processor.
  41. //
  42. // N.B. This routine is entered with IE in PSR clear. This routine
  43. // must do any power management enabling necessary, set the IE
  44. // bit in PSR, then either return or wait for an interrupt.
  45. //
  46. // Arguments:
  47. //
  48. // None.
  49. //
  50. // Return Value:
  51. //
  52. // None.
  53. //
  54. //--
  55. LEAF_ENTRY(HalProcessorIdle)
  56. //
  57. // Perform power management enabling.
  58. //
  59. .set noreorder
  60. .set noat
  61. mfc0 v0,psr // get current PSR
  62. nop // fill
  63. or v0,v0,1 << PSR_IE // set interrupt enable.
  64. mtc0 v0,psr // enable interrupts
  65. .set at
  66. .set reorder
  67. //
  68. // Wait for an interrupt if supported.
  69. //
  70. j ra // return
  71. .end HalProcessorIdle