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.

122 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1999-2001 Microsoft Corporation. All Rights Reserved.
  3. Module Name:
  4. common.h
  5. Abstract:
  6. This module is the common internal header file for rt.
  7. Author:
  8. Joseph Ballantyne
  9. Environment:
  10. Kernel Mode
  11. Revision History:
  12. --*/
  13. #ifndef UNDER_NT
  14. #include <wdm.h>
  15. #else
  16. #include <ntddk.h>
  17. #endif
  18. #include <windef.h>
  19. // On Win9x we have a guard page on all realtime stacks.
  20. // NOTE: We need to implement the guard page feature on NT.
  21. #ifndef UNDER_NT
  22. #define GUARD_PAGE 1
  23. #endif
  24. // We make sure the processor can wake up every MS on even agressively
  25. // power managed machines by setting the system timer resolution to 1ms.
  26. #define WAKE_EVERY_MS 1
  27. // Make sure our debug code works properly on NT.
  28. #if defined(UNDER_NT) && DBG
  29. #define DEBUG 1
  30. #endif
  31. // Trap macro stops on debug builds, does nothing on retail.
  32. #ifdef DEBUG
  33. #define Trap() __asm int 3
  34. #else
  35. #define Trap()
  36. #endif
  37. // Break macro stops on both debug and retail.
  38. #define Break() __asm int 3
  39. // Debug output defines and macros.
  40. #ifdef DEBUG
  41. // This controls whether or not to use the NTKERN internal debug buffer
  42. // when doing debug printing.
  43. #define USE_NTKERN_DEBUG_BUFFER 0
  44. #if USE_NTKERN_DEBUG_BUFFER
  45. #define QDBG "'"
  46. #else
  47. #define QDBG ""
  48. #endif
  49. // Generate debug output in printf type format.
  50. #define dprintf( _x_ ) { DbgPrint(QDBG"RT: "); DbgPrint _x_ ; DbgPrint(QDBG"\r\n"); }
  51. #else // DEBUG
  52. #define dprintf(x)
  53. #endif // DEBUG
  54. // These control where code and data are located: in pageable or non pageable memory.
  55. // Much of the code and data in rt are in non pageable memory.
  56. // However, the total amount of both code and data in rt is small.
  57. #define INIT_CODE code_seg("INIT", "CODE")
  58. #define INIT_DATA data_seg("INIT", "DATA")
  59. #define LOCKED_CODE code_seg(".text", "CODE")
  60. #define LOCKED_DATA data_seg(".data", "DATA")
  61. #define PAGEABLE_CODE code_seg("PAGE", "CODE")
  62. #define PAGEABLE_DATA data_seg("PAGEDATA", "DATA")
  63. #pragma PAGEABLE_CODE
  64. #pragma PAGEABLE_DATA