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.

102 lines
2.2 KiB

  1. /**
  2. *** Copyright (C) 1996-97 Intel Corporation. All rights reserved.
  3. ***
  4. *** The information and source code contained herein is the exclusive
  5. *** property of Intel Corporation and may not be disclosed, examined
  6. *** or reproduced in whole or in part without explicit written authorization
  7. *** from the company.
  8. **/
  9. //++
  10. //
  11. // Module Name:
  12. //
  13. // setjmpex.s
  14. //
  15. // Abstract:
  16. //
  17. // This module implements the IA64 specific routine to perform a setjmp.
  18. //
  19. // N.B. This module has two entry points that provide SAFE and UNSAFE
  20. // handling of setjmp.
  21. //
  22. // Author:
  23. //
  24. // William K. Cheung (wcheung) 27-Jan-1996
  25. //
  26. // Environment:
  27. //
  28. // Any mode.
  29. //
  30. // Revision History:
  31. //
  32. // Modified to support mixed ISA.
  33. //
  34. //--
  35. #include "ksia64.h"
  36. .global _setjmpex
  37. .type _setjmpex, @function
  38. .global _setjmp_common
  39. .type _setjmp_common, @function
  40. .sdata
  41. .align 8
  42. _setjmpexused::
  43. data8 _setjmpex
  44. //++
  45. //
  46. // int
  47. // setjmpex (
  48. // IN jmp_buf JumpBuffer
  49. // )
  50. //
  51. // Routine Description:
  52. //
  53. // This function saved the current nonvolatile register state in the
  54. // specified jump buffer and returns a function vlaue of zero.
  55. //
  56. // Arguments:
  57. //
  58. // JumpBuffer (a0) - Supplies the address of a jump buffer to store the
  59. // jump information.
  60. //
  61. // MemoryStackFp (a1) - Supplies the memory stack frame pointer (psp)
  62. // of the caller. It's an optional argument.
  63. //
  64. // Return Value:
  65. //
  66. // A value of zero is returned.
  67. //
  68. //--
  69. NESTED_ENTRY(_setjmpex)
  70. LEAF_SETUP(3, 0, 0, 0)
  71. rUnat = t8
  72. rFpsr = t9
  73. rPsp = a1
  74. rBsp = a2
  75. movl t4 = 0x130324356 // ascii code of "VC20"
  76. mov rUnat = ar.unat
  77. mov rFpsr = ar.fpsr
  78. add t2 = JbCookie, a0
  79. ;;
  80. st8.nta [t2] = t4, JbUnwindData-JbCookie // save the magic cookie
  81. add t3 = JbUnwindData+8, a0
  82. ;;
  83. st8.nta [t2] = rPsp, 8
  84. st8.nta [t3] = rBsp
  85. br.sptk.many _setjmp_common
  86. ;;
  87. NESTED_EXIT(_setjmpex)