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.

89 lines
2.0 KiB

  1. title "Hal Processor Idle"
  2. ;++
  3. ;
  4. ;Copyright (c) 1991 Microsoft Corporation
  5. ;
  6. ;Module Name:
  7. ;
  8. ; ixidle.asm
  9. ;
  10. ;Abstract:
  11. ;
  12. ;
  13. ;Author:
  14. ;
  15. ;
  16. ;Revision History:
  17. ;
  18. ;--
  19. .386p
  20. .xlist
  21. include hal386.inc
  22. include callconv.inc ; calling convention macros
  23. include i386\kimacro.inc
  24. include mac386.inc
  25. .list
  26. _TEXT$01 SEGMENT DWORD PUBLIC 'CODE'
  27. ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
  28. page ,132
  29. subttl "HalProcessorIdle"
  30. ;++
  31. ;
  32. ; VOID
  33. ; HalProcessorIdle(
  34. ; VOID
  35. ; )
  36. ;
  37. ; Routine Description:
  38. ;
  39. ; This function is called when the current processor is idle.
  40. ;
  41. ; This function is called with interrupts disabled, and the processor
  42. ; is idle until it receives an interrupt. The does not need to return
  43. ; until an interrupt is received by the current processor.
  44. ;
  45. ; This is the lowest level of processor idle. It occurs frequently,
  46. ; and this function (alone) should not put the processor into a
  47. ; power savings mode which requeres large amount of time to enter & exit.
  48. ;
  49. ; Return Value:
  50. ;
  51. ;--
  52. cPublicProc _HalProcessorIdle, 0
  53. cPublicFpo 0,0
  54. ;
  55. ; the following code sequence "sti-halt" puts the processor
  56. ; into a Halted state, with interrupts enabled, without processing
  57. ; an interrupt before halting. The STI instruction has a delay
  58. ; slot such that it does not take effect until after the instruction
  59. ; following it - this has the effect of HALTing without allowing
  60. ; a possible interrupt and then enabling interrupts while HALTed.
  61. ;
  62. ;
  63. ; On an MP hal we don't stop the processor, since that causes
  64. ; the SNOOP to slow down as well
  65. ;
  66. sti
  67. ifdef NT_UP
  68. hlt
  69. endif
  70. ;
  71. ; Now return to the system. If there's still no work, then it
  72. ; will call us back to halt again.
  73. ;
  74. stdRET _HalProcessorIdle
  75. stdENDP _HalProcessorIdle
  76. _TEXT$01 ends
  77. end