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.

67 lines
1003 B

  1. /*++
  2. Copyright (c) 2000-2002 Microsoft Corporation
  3. Module Name:
  4. largemem.h
  5. Abstract:
  6. The public definition of large memory allocator interfaces.
  7. Author:
  8. George V. Reilly (GeorgeRe) 10-Nov-2000
  9. Revision History:
  10. --*/
  11. #ifndef _LARGEMEM_H_
  12. #define _LARGEMEM_H_
  13. NTSTATUS
  14. UlLargeMemInitialize(
  15. );
  16. VOID
  17. UlLargeMemTerminate(
  18. VOID
  19. );
  20. ULONG
  21. UlLargeMemUsagePercentage(
  22. VOID
  23. );
  24. PMDL
  25. UlLargeMemAllocate(
  26. IN ULONG Length
  27. );
  28. VOID
  29. UlLargeMemFree(
  30. IN PMDL pMdl
  31. );
  32. BOOLEAN
  33. UlLargeMemSetData(
  34. IN PMDL pMdl,
  35. IN PUCHAR pBuffer,
  36. IN ULONG Length,
  37. IN ULONG Offset
  38. );
  39. // 2^20 = 1MB
  40. #define MEGABYTE_SHIFT 20
  41. C_ASSERT(PAGE_SHIFT < MEGABYTE_SHIFT);
  42. #define PAGES_TO_MEGABYTES(P) ((P) >> (MEGABYTE_SHIFT - PAGE_SHIFT))
  43. #define MEGABYTES_TO_PAGES(M) ((M) << (MEGABYTE_SHIFT - PAGE_SHIFT))
  44. #define MEGABYTES_TO_BYTES(M) ((M) << (MEGABYTE_SHIFT))
  45. #endif // _LARGEMEM_H_