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.

81 lines
1.7 KiB

  1. title "Jump Unwind"
  2. ;++
  3. ;
  4. ; Copyright (c) 2000 Microsoft Corporation
  5. ;
  6. ; Module Name:
  7. ;
  8. ; jmpunwind.asm
  9. ;
  10. ; Abstract:
  11. ;
  12. ; This module implements the AMD64 specific routine to perform jump unwind.
  13. ;
  14. ; Author:
  15. ;
  16. ; David N. Cutler (davec) 22-Dec-2000
  17. ;
  18. ; Environment:
  19. ;
  20. ; Any mode.
  21. ;
  22. ;--
  23. include ksamd64.inc
  24. extern RtlUnwindEx:proc
  25. subttl "Jump Unwind"
  26. ;++
  27. ;
  28. ; VOID
  29. ; _local_unwind (
  30. ; IN PVOID TargetFrame,
  31. ; IN PVOID TargetIp
  32. ; )
  33. ;
  34. ; Routine Description:
  35. ;
  36. ; This function performs a transfer of control to unwind for local unwinds.
  37. ;
  38. ; Arguments:
  39. ;
  40. ; TargetFrame (rcx) - Supplies the establisher frame pointer of the
  41. ; target of the unwind.
  42. ;
  43. ; TargetIp (rdx) - Supplies the target instruction address where control
  44. ; is to be transferred to after the unwind operation is complete.
  45. ;
  46. ; Return Value:
  47. ;
  48. ; None.
  49. ;
  50. ;--
  51. NESTED_ENTRY _local_unwind, _TEXT$00
  52. alloc_stack (CONTEXT_FRAME_LENGTH + 8) ; allocate stack
  53. END_PROLOGUE
  54. ;
  55. ; The first two arguments to the unwind routine are the same as the two
  56. ; arguments to this routine.
  57. ;
  58. xor r8, r8 ; set NULL exception record address
  59. xor r9, r9 ; set zero return value
  60. ;
  61. ; The context frame has space allocated for six argument home addresses.
  62. ;
  63. mov CxP5Home[rsp], rsp ; set context frame address argument
  64. mov CxP6Home[rsp], r8 ; set NULL history table address
  65. call RtlUnwindEx ; perform unwind operation
  66. add rsp, CONTEXT_FRAME_LENGTH + 8 ; deallocate stack frame
  67. ret ; return
  68. NESTED_END _local_unwind, _TEXT$00
  69. end