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.

119 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. amd64cpu.h
  5. Abstract:
  6. This module contains the AMD64 platfrom specific cpu information.
  7. Author:
  8. Samer Arafeh (samera) 12-Dec-2001
  9. --*/
  10. #ifndef _AMD64CPU_INCLUDE
  11. #define _AMD64CPU_INCLUDE
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. //
  16. // 32-bit Cpu context.
  17. //
  18. //
  19. // Indicate that the XMMI registers needs to be reloaded by the tranision code
  20. //
  21. #define TRAP_FRAME_RESTORE_VOLATILE 0x00000001
  22. #pragma pack(push, 4)
  23. typedef struct _CpuContext {
  24. //
  25. // Make the extended registers field aligned.
  26. //
  27. DWORD Reserved;
  28. //
  29. // X86 trap frame when jumping to amd64
  30. //
  31. CONTEXT32 Context;
  32. //
  33. // Trap flags
  34. //
  35. ULONG TrapFrameFlags;
  36. } CPUCONTEXT, *PCPUCONTEXT;
  37. #pragma pack(pop)
  38. //
  39. // CPU-internal shared functions. They are also used by the debugger extension.
  40. //
  41. NTSTATUS
  42. GetContextRecord (
  43. IN PCPUCONTEXT cpu,
  44. IN PCONTEXT Amd64Context,
  45. IN OUT PCONTEXT32 Context
  46. );
  47. NTSTATUS
  48. SetContextRecord(
  49. IN OUT PCPUCONTEXT cpu,
  50. IN OUT PCONTEXT ContextAmd64,
  51. IN PCONTEXT32 Context,
  52. IN OUT PBOOLEAN UpdateNativeContext
  53. );
  54. NTSTATUS
  55. CpupGetContextThread (
  56. IN HANDLE ThreadHandle,
  57. IN HANDLE ProcessHandle,
  58. IN PTEB Teb,
  59. IN OUT PCONTEXT32 Context
  60. );
  61. NTSTATUS
  62. CpupSetContextThread(
  63. IN HANDLE ThreadHandle,
  64. IN HANDLE ProcessHandle,
  65. IN PTEB Teb,
  66. IN OUT PCONTEXT32 Context
  67. );
  68. //
  69. // Context conversion routines
  70. //
  71. VOID Wow64CtxFromAmd64(
  72. IN ULONG X86ContextFlags,
  73. IN PCONTEXT ContextAmd64,
  74. IN OUT PCONTEXT32 ContextX86);
  75. VOID Wow64CtxToAmd64(
  76. IN ULONG X86ContextFlags,
  77. IN PCONTEXT32 ContextX86,
  78. IN OUT PCONTEXT ContextAmd64);
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif