memory.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* memory.h - describe the memory map */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2002,2007,2008 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef GRUB_MEMORY_HEADER
  20. #define GRUB_MEMORY_HEADER 1
  21. #include <grub/types.h>
  22. #include <grub/err.h>
  23. #include <grub/machine/memory.h>
  24. grub_err_t grub_mmap_iterate (int (*hook) (grub_uint64_t, grub_uint64_t,
  25. grub_uint32_t, void *), void *);
  26. int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type);
  27. grub_err_t grub_mmap_unregister (int handle);
  28. void *grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size,
  29. int *handle, int type, int flags);
  30. void grub_mmap_free_and_unregister (int handle);
  31. #ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE
  32. struct grub_mmap_region
  33. {
  34. struct grub_mmap_region *next;
  35. grub_uint64_t start;
  36. grub_uint64_t end;
  37. int type;
  38. int handle;
  39. };
  40. extern struct grub_mmap_region *grub_mmap_overlays;
  41. #endif
  42. #endif /* ! GRUB_MEMORY_HEADER */