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.

78 lines
1.7 KiB

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