Unify memory types.
* grub-core/Makefile.am (KERNEL_HEADER_FILES): Include memory.h. * grub-core/commands/lsmmap.c (grub_cmd_lsmmap): Output user-readable types. * grub-core/kern/i386/multiboot_mmap.c (grub_lower_mem): Removed. (grub_upper_mem): Likewise. * grub-core/kern/ieee1275/init.c (grub_upper_mem): Likewise. * include/grub/memory.h (grub_memory_type_t): New enum. All users updated.
This commit is contained in:
commit
a1d84a5e5e
52 changed files with 315 additions and 443 deletions
|
@ -27,10 +27,10 @@ grub_relocator_firmware_get_max_events (void)
|
|||
int counter = 0;
|
||||
auto int NESTED_FUNC_ATTR count (grub_uint64_t addr __attribute__ ((unused)),
|
||||
grub_uint64_t len __attribute__ ((unused)),
|
||||
grub_uint32_t type __attribute__ ((unused)));
|
||||
grub_memory_type_t type __attribute__ ((unused)));
|
||||
int NESTED_FUNC_ATTR count (grub_uint64_t addr __attribute__ ((unused)),
|
||||
grub_uint64_t len __attribute__ ((unused)),
|
||||
grub_uint32_t type __attribute__ ((unused)))
|
||||
grub_memory_type_t type __attribute__ ((unused)))
|
||||
{
|
||||
counter++;
|
||||
return 0;
|
||||
|
@ -47,11 +47,11 @@ grub_relocator_firmware_fill_events (struct grub_relocator_mmap_event *events)
|
|||
{
|
||||
int counter = 0;
|
||||
auto int NESTED_FUNC_ATTR fill (grub_uint64_t addr, grub_uint64_t len,
|
||||
grub_uint32_t type);
|
||||
grub_memory_type_t type);
|
||||
int NESTED_FUNC_ATTR fill (grub_uint64_t addr, grub_uint64_t len,
|
||||
grub_uint32_t type)
|
||||
grub_memory_type_t type)
|
||||
{
|
||||
if (type != GRUB_MACHINE_MEMORY_AVAILABLE)
|
||||
if (type != GRUB_MEMORY_AVAILABLE)
|
||||
return 0;
|
||||
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM))
|
||||
|
|
|
@ -1379,11 +1379,13 @@ grub_relocator_alloc_chunk_align (struct grub_relocator *rel,
|
|||
|
||||
{
|
||||
int found = 0;
|
||||
auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t);
|
||||
int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t sz, grub_uint32_t type)
|
||||
auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t,
|
||||
grub_memory_type_t);
|
||||
int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t sz,
|
||||
grub_memory_type_t type)
|
||||
{
|
||||
grub_uint64_t candidate;
|
||||
if (type != GRUB_MACHINE_MEMORY_AVAILABLE)
|
||||
if (type != GRUB_MEMORY_AVAILABLE)
|
||||
return 0;
|
||||
candidate = ALIGN_UP (addr, align);
|
||||
if (candidate < min_addr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue