Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / memory.h
blob083cfb6802e84d6db6f0e3b9c219ee31967c6b4f
1 /* memory.h - describe the memory map */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2002,2007,2008 Free Software Foundation, Inc.
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.
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.
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/>.
20 #ifndef GRUB_MEMORY_HEADER
21 #define GRUB_MEMORY_HEADER 1
23 #include <grub/types.h>
24 #include <grub/err.h>
26 typedef enum grub_memory_type
28 GRUB_MEMORY_AVAILABLE = 1,
29 GRUB_MEMORY_RESERVED = 2,
30 GRUB_MEMORY_ACPI = 3,
31 GRUB_MEMORY_NVS = 4,
32 GRUB_MEMORY_BADRAM = 5,
33 GRUB_MEMORY_COREBOOT_TABLES = 16,
34 GRUB_MEMORY_CODE = 20,
35 /* This one is special: it's used internally but is never reported
36 by firmware. Don't use -1 as it's used internally for other purposes. */
37 GRUB_MEMORY_HOLE = -2,
38 GRUB_MEMORY_MAX = 0x10000
39 } grub_memory_type_t;
41 typedef int (*grub_memory_hook_t) (grub_uint64_t,
42 grub_uint64_t,
43 grub_memory_type_t,
44 void *);
46 grub_err_t grub_mmap_iterate (grub_memory_hook_t hook, void *hook_data);
48 #ifdef GRUB_MACHINE_EFI
49 grub_err_t
50 grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data,
51 int avoid_efi_boot_services);
52 #endif
54 #if !defined (GRUB_MACHINE_EMU) && !defined (GRUB_MACHINE_EFI)
55 grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) (grub_memory_hook_t hook,
56 void *hook_data);
57 #else
58 grub_err_t grub_machine_mmap_iterate (grub_memory_hook_t hook,
59 void *hook_data);
60 #endif
62 int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type);
63 grub_err_t grub_mmap_unregister (int handle);
65 void *grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size,
66 int *handle, int type, int flags);
68 void grub_mmap_free_and_unregister (int handle);
70 #ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE
72 struct grub_mmap_region
74 struct grub_mmap_region *next;
75 grub_uint64_t start;
76 grub_uint64_t end;
77 grub_memory_type_t type;
78 int handle;
79 int priority;
82 extern struct grub_mmap_region *grub_mmap_overlays;
83 #endif
85 #endif /* ! GRUB_MEMORY_HEADER */