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.

146 lines
3.5 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. if DBG
  48. mov [rsp]+08h, rcx
  49. mov [rsp]+10h, rdx
  50. mov [rsp]+18h, r8
  51. mov [rsp]+20h, r9
  52. endif
  53. cli ; disable interrupts
  54. mov rax, rsp ; save stack address
  55. sub rsp, 16 ; alignment and dummy SS selector
  56. pushq rax ; save previous stack pointer
  57. pushfq ; push EFLAGS on stack
  58. pushq KGDT64_R0_CODE ; push CS selector
  59. lea rax, KiServiceLinkage ; push service linkage RIP
  60. pushq rax ; push return address
  61. mov eax, ServiceNumber ; set service number
  62. jmp KiSystemService ; finish in service dispatcher
  63. push_frame ; mark machine frame push
  64. END_PROLOGUE
  65. NESTED_END Zw&Name, _TEXT$00
  66. endm
  67. SYSSTUBS_ENTRY2 macro ServiceNumber, Name, NumArgs
  68. endm
  69. SYSSTUBS_ENTRY3 macro ServiceNumber, Name, NumArgs
  70. endm
  71. SYSSTUBS_ENTRY4 macro ServiceNumber, Name, NumArgs
  72. endm
  73. SYSSTUBS_ENTRY5 macro ServiceNumber, Name, NumArgs
  74. endm
  75. SYSSTUBS_ENTRY6 macro ServiceNumber, Name, NumArgs
  76. endm
  77. SYSSTUBS_ENTRY7 macro ServiceNumber, Name, NumArgs
  78. endm
  79. SYSSTUBS_ENTRY8 macro ServiceNumber, Name, NumArgs
  80. endm
  81. USRSTUBS_ENTRY1 macro ServiceNumber, Name, NumArgs
  82. altentry Nt&Name
  83. endm
  84. USRSTUBS_ENTRY2 macro ServiceNumber, Name, NumArgs
  85. LEAF_ENTRY Zw&Name, _TEXT$00
  86. ALTERNATE_ENTRY Nt&Name
  87. if DBG
  88. mov [rsp]+08h, rcx
  89. mov [rsp]+10h, rdx
  90. mov [rsp]+18h, r8
  91. mov [rsp]+20h, r9
  92. endif
  93. mov r10, rcx
  94. mov eax, ServiceNumber
  95. syscall
  96. ret
  97. LEAF_END Zw&Name, _TEXT$00
  98. endm
  99. USRSTUBS_ENTRY3 macro ServiceNumber, Name, NumArgs
  100. endm
  101. USRSTUBS_ENTRY4 macro ServiceNumber, Name, NumArgs
  102. endm
  103. USRSTUBS_ENTRY5 macro ServiceNumber, Name, NumArgs
  104. endm
  105. USRSTUBS_ENTRY6 macro ServiceNumber, Name, NumArgs
  106. endm
  107. USRSTUBS_ENTRY7 macro ServiceNumber, Name, NumArgs
  108. endm
  109. USRSTUBS_ENTRY8 macro ServiceNumber, Name, NumArgs
  110. endm
  111. STUBS_BEGIN1 <"System Service Stub Procedures">
  112. STUBS_BEGIN2 <"System Service Stub Procedures">
  113. STUBS_BEGIN3 <"System Service Stub Procedures">
  114. STUBS_BEGIN4 <"System Service Stub Procedures">
  115. STUBS_BEGIN5 <"System Service Stub Procedures">
  116. STUBS_BEGIN6 <"System Service Stub Procedures">
  117. STUBS_BEGIN7 <"System Service Stub Procedures">
  118. STUBS_BEGIN8 <"System Service Stub Procedures">