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.

75 lines
2.6 KiB

  1. 0 // 8 is the actual number of argument registers
  2. //++
  3. //
  4. // Copyright (c) 1989 Microsoft Corporation
  5. //
  6. // Module Name:
  7. //
  8. // systable.s
  9. //
  10. // Abstract:
  11. //
  12. // This module implements the system service dispatch table.
  13. //
  14. // Author:
  15. //
  16. // David N. Cutler (davec) 29-Apr-1989
  17. //
  18. // Environment:
  19. //
  20. // Kernel mode only.
  21. //
  22. // Revision History:
  23. //
  24. //--
  25. //
  26. // To add a system service simply add the name of the service to the below
  27. // table. If the system service has in memory arguments, then immediately
  28. // follow the name of the serice with a comma and following that the number
  29. // of bytes of in memory arguments, e.g. CreateObject,40.
  30. //
  31. // N.B. Note that the gp corresponding to KiServiceTable must be placed
  32. // just before KiServiceTable.
  33. // Given that code must be at least 16-byte aligned, bits 1-3 are used
  34. // used to encode number of arguments up to a value of 7. The following
  35. // forumal is used numargs > 8 ? (((numargs - 8 + 1)/2) + 8) : numargs
  36. //
  37. #define TABLE_BEGIN1( t ) .##sdata
  38. #define TABLE_BEGIN2( t ) .##align 8
  39. #define TABLE_BEGIN3( t ) .##global W32pServiceTableGp
  40. #define TABLE_BEGIN4( t ) W32pServiceTableGp: data8 _gp
  41. #define TABLE_BEGIN5( t ) .##global W32pServiceTable
  42. #define TABLE_BEGIN6( t ) W32pServiceTable:
  43. #define TABLE_BEGIN7( t )
  44. #define TABLE_BEGIN8( t )
  45. #define TABLE_ENTRY( l,bias,numargs ) .##global Nt##l; .##type Nt##l, @function; data8 Nt##l+(((numargs%9)>>((numargs/9)*4))+((8+((numargs-7)/2))*(((numargs/9)+1)>>1)))
  46. #define TABLE_END( n ) .##sdata ; .##global W32pServiceLimit ; W32pServiceLimit: data4 n + 1
  47. #define ARGTBL_BEGIN .##sdata ; .##align 4 ; .##global W32pArgumentTable ; W32pArgumentTable:
  48. #define ARGTBL_ENTRY( e0,e1,e2,e3,e4,e5,e6,e7 ) \
  49. data1 e0,e1,e2,e3,e4,e5,e6,e7
  50. #define ARGTBL_END
  51. #define ERRTBL_BEGIN
  52. #define ERRTBL_ENTRY( e0,e1,e2,e3,e4,e5,e6,e7 ) \
  53. data1 e0,e1,e2,e3,e4,e5,e6,e7
  54. #define ERRTBL_END
  55. #define DECLARE_DISPATCH_COUNT( ServiceCount, ArgsCount) .##sdata ; .##align 4 ; .##global gDispatchTableValues ; gDispatchTableValues: data4 ServiceCount, ArgsCount
  56. TABLE_BEGIN1( "System Service Dispatch Table" )
  57. TABLE_BEGIN2( "System Service Dispatch Table" )
  58. TABLE_BEGIN3( "System Service Dispatch Table" )
  59. TABLE_BEGIN4( "System Service Dispatch Table" )
  60. TABLE_BEGIN5( "System Service Dispatch Table" )
  61. TABLE_BEGIN6( "System Service Dispatch Table" )
  62. TABLE_BEGIN7( "System Service Dispatch Table" )
  63. TABLE_BEGIN8( "System Service Dispatch Table" )