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.

87 lines
1.1 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. nxamd64.w
  5. Abstract:
  6. User mode visible AMD64 specific structures and constants.
  7. This file contains platform specific definitions that are included
  8. after all other files have been included from nt.h.
  9. Author:
  10. David N. Cutler (davec) 6-May-2000
  11. Revision History:
  12. --*/
  13. #ifndef _NXAMD64_
  14. #define _NXAMD64_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. //
  22. // Define platform specific functions to access the TEB.
  23. //
  24. // begin_winnt
  25. #if defined(_M_AMD64) && !defined(__midl)
  26. // end_winnt
  27. __forceinline
  28. PTEB
  29. NtCurrentTeb (
  30. VOID
  31. )
  32. {
  33. return (PTEB)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
  34. }
  35. // begin_winnt
  36. __forceinline
  37. PVOID
  38. GetCurrentFiber (
  39. VOID
  40. )
  41. {
  42. return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData));
  43. }
  44. __forceinline
  45. PVOID
  46. GetFiberData (
  47. VOID
  48. )
  49. {
  50. return *(PVOID *)GetCurrentFiber();
  51. }
  52. #endif // _M_AMD64 && !defined(__midl)
  53. // end_winnt
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif // _NXAMD64_