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.

76 lines
1.0 KiB

  1. /*++
  2. Copyright (c) 2000-2001 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. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. NTSTATUS
  17. UlLargeMemInitialize(
  18. IN PUL_CONFIG pConfig
  19. );
  20. VOID
  21. UlLargeMemTerminate(
  22. VOID
  23. );
  24. UINT
  25. UlLargeMemUsagePercentage(
  26. VOID
  27. );
  28. PMDL
  29. UlLargeMemAllocate(
  30. IN ULONG Length,
  31. OUT PBOOLEAN pLongTermCacheable
  32. );
  33. VOID
  34. UlLargeMemFree(
  35. IN PMDL pMdl
  36. );
  37. BOOLEAN
  38. UlLargeMemSetData(
  39. IN PMDL pMdl,
  40. IN PUCHAR pBuffer,
  41. IN ULONG Length,
  42. IN ULONG Offset
  43. );
  44. // 2^20 = 1MB
  45. #define MEGABYTE_SHIFT 20
  46. C_ASSERT(PAGE_SHIFT < MEGABYTE_SHIFT);
  47. #define PAGES_TO_MEGABYTES(P) ((P) >> (MEGABYTE_SHIFT - PAGE_SHIFT))
  48. #define MEGABYTES_TO_PAGES(M) ((M) << (MEGABYTE_SHIFT - PAGE_SHIFT))
  49. #ifdef __cplusplus
  50. }; // extern "C"
  51. #endif // __cplusplus
  52. #endif // _LARGEMEM_H_