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.

134 lines
3.1 KiB

  1. ;++
  2. ;
  3. ; Copyright (c) 2000 Microsoft Corporation
  4. ;
  5. ; Module Name:
  6. ;
  7. ; sysstubs.asm
  8. ;
  9. ; Abstract:
  10. ;
  11. ; This module implements the system service dispatch stub procedures.
  12. ;
  13. ; Author:
  14. ;
  15. ; David N. Cutler (davec) 10-Jul-2000
  16. ;
  17. ; Environment:
  18. ;
  19. ; User or kernel mode.
  20. ;
  21. ;--
  22. include ksamd64.inc
  23. STUBS_BEGIN1 macro t
  24. title t
  25. endm
  26. STUBS_BEGIN2 macro t
  27. endm
  28. STUBS_BEGIN3 macro t
  29. endm
  30. STUBS_BEGIN4 macro t
  31. endm
  32. STUBS_BEGIN5 macro t
  33. endm
  34. STUBS_BEGIN6 macro t
  35. endm
  36. STUBS_BEGIN7 macro t
  37. endm
  38. STUBS_BEGIN8 macro t
  39. endm
  40. STUBS_END macro t
  41. end
  42. endm
  43. SYSSTUBS_ENTRY1 macro ServiceNumber, Name, NumArgs
  44. extern KiServiceLinkage:proc
  45. extern KiSystemService:proc
  46. NESTED_ENTRY Zw&Name, _TEXT$00
  47. cli ; disable interrupts
  48. mov rax, rsp ; save stack address
  49. sub rsp, 16 ; alignment and dummy SS selector
  50. pushq rax ; save previous stack pointer
  51. pushfd ; push EFLAGS on stack
  52. pushq KGDT64_R0_CODE ; push CS selector
  53. lea rax, KiServiceLinkage ; push service linkage RIP
  54. pushq rax ; push return address
  55. mov rax, ServiceNumber ; set service number
  56. jmp KiSystemService ; finish in service dispatcher
  57. push_frame ; mark machine frame push
  58. END_PROLOGUE
  59. NESTED_END Zw&Name, _TEXT$00
  60. endm
  61. SYSSTUBS_ENTRY2 macro ServiceNumber, Name, NumArgs
  62. endm
  63. SYSSTUBS_ENTRY3 macro ServiceNumber, Name, NumArgs
  64. endm
  65. SYSSTUBS_ENTRY4 macro ServiceNumber, Name, NumArgs
  66. endm
  67. SYSSTUBS_ENTRY5 macro ServiceNumber, Name, NumArgs
  68. endm
  69. SYSSTUBS_ENTRY6 macro ServiceNumber, Name, NumArgs
  70. endm
  71. SYSSTUBS_ENTRY7 macro ServiceNumber, Name, NumArgs
  72. endm
  73. SYSSTUBS_ENTRY8 macro ServiceNumber, Name, NumArgs
  74. endm
  75. USRSTUBS_ENTRY1 macro ServiceNumber, Name, NumArgs
  76. altentry Nt&Name
  77. endm
  78. USRSTUBS_ENTRY2 macro ServiceNumber, Name, NumArgs
  79. LEAF_ENTRY Zw&Name, _TEXT$00
  80. ALTERNATE_ENTRY Nt&Name
  81. mov r10, rcx
  82. mov eax, ServiceNumber
  83. syscall
  84. ret
  85. LEAF_END Zw&Name, _TEXT$00
  86. endm
  87. USRSTUBS_ENTRY3 macro ServiceNumber, Name, NumArgs
  88. endm
  89. USRSTUBS_ENTRY4 macro ServiceNumber, Name, NumArgs
  90. endm
  91. USRSTUBS_ENTRY5 macro ServiceNumber, Name, NumArgs
  92. endm
  93. USRSTUBS_ENTRY6 macro ServiceNumber, Name, NumArgs
  94. endm
  95. USRSTUBS_ENTRY7 macro ServiceNumber, Name, NumArgs
  96. endm
  97. USRSTUBS_ENTRY8 macro ServiceNumber, Name, NumArgs
  98. endm
  99. STUBS_BEGIN1 <"System Service Stub Procedures">
  100. STUBS_BEGIN2 <"System Service Stub Procedures">
  101. STUBS_BEGIN3 <"System Service Stub Procedures">
  102. STUBS_BEGIN4 <"System Service Stub Procedures">
  103. STUBS_BEGIN5 <"System Service Stub Procedures">
  104. STUBS_BEGIN6 <"System Service Stub Procedures">
  105. STUBS_BEGIN7 <"System Service Stub Procedures">
  106. STUBS_BEGIN8 <"System Service Stub Procedures">