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.

95 lines
1.7 KiB

  1. // TITLE("LdrInitializeThunk")
  2. //++
  3. //
  4. // Copyright (c) 1989 Microsoft Corporation
  5. // Copyright (c) 1992 Digital Equipment Corporation
  6. //
  7. // Module Name:
  8. //
  9. // ldrthunk.s
  10. //
  11. // Abstract:
  12. //
  13. // This module implements the thunk for the LdrpInitialize APC routine.
  14. //
  15. // Author:
  16. //
  17. // Steven R. Wood (stevewo) 27-Apr-1990
  18. //
  19. // Environment:
  20. //
  21. // Any mode.
  22. //
  23. // Revision History:
  24. //
  25. // Thomas Van Baak (tvb) 18-May-1992
  26. //
  27. // Adapted for Alpha AXP.
  28. //
  29. //--
  30. #include "ksalpha.h"
  31. //++
  32. //
  33. // VOID
  34. // LdrInitializeThunk (
  35. // IN PVOID NormalContext,
  36. // IN PVOID SystemArgument1,
  37. // IN PVOID SystemArgument2
  38. // )
  39. //
  40. // Routine Description:
  41. //
  42. // This function computes a pointer to the context record on the stack
  43. // and jumps to the LdrpInitialize function with that pointer as its
  44. // parameter.
  45. //
  46. // Arguments:
  47. //
  48. // NormalContext (a0) - User Mode APC context parameter (ignored).
  49. //
  50. // SystemArgument1 (a1) - User Mode APC system argument 1 (ignored).
  51. //
  52. // SystemArgument2 (a2) - User Mode APC system argument 2 (ignored).
  53. //
  54. // Return Value:
  55. //
  56. // None.
  57. //
  58. //--
  59. LEAF_ENTRY(LdrInitializeThunk)
  60. mov sp, a0 // get address of context record
  61. br zero, LdrpInitialize // jump to LdrpInitialize
  62. .end LdrInitializeThunk
  63. //++
  64. //
  65. // VOID
  66. // LdrpSetGp(
  67. // IN ULONG GpValue
  68. // )
  69. //
  70. // Routine Description:
  71. //
  72. // This function sets the value of the Gp register.
  73. //
  74. // Arguments:
  75. //
  76. // GpValue (a0) - Supplies the value for Gp.
  77. //
  78. // Return Value:
  79. //
  80. // None.
  81. //
  82. //--
  83. LEAF_ENTRY(LdrpSetGp)
  84. mov a0, gp // set global pointer register
  85. ret zero, (ra) // return
  86. .end LdrpSetGp