Merge gingold3 into ia64
This commit is contained in:
commit
7ba7efc371
5 changed files with 39 additions and 32 deletions
7
ChangeLog.gingold3
Normal file
7
ChangeLog.gingold3
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
2008-01-28 Tristan Gingold <gingold@free.fr>
|
||||||
|
2010-01-18 Robert Millan <rmh.grub@aybabtu.com>
|
||||||
|
2010-08-31 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/commands/efi/lsefimmap.c: New file.
|
||||||
|
* grub-core/Makefile.core.def (lsefimmap): New module.
|
||||||
|
* include/grub/efi/api.h (PRIxGRUB_EFI_UINTN_T): New definition.
|
|
@ -12,7 +12,6 @@
|
||||||
* normal/ia64/longjmp.S: New file (from glibc).
|
* normal/ia64/longjmp.S: New file (from glibc).
|
||||||
* loader/ia64/efi/linux.c: New file.
|
* loader/ia64/efi/linux.c: New file.
|
||||||
* conf/ia64-efi.rmk: New file.
|
* conf/ia64-efi.rmk: New file.
|
||||||
* commands/efi/memmap.c: New file.
|
|
||||||
* include/grub/efi/efi.h: Declare grub_efi_allocate_boot_pages and
|
* include/grub/efi/efi.h: Declare grub_efi_allocate_boot_pages and
|
||||||
grub_efi_free_boot_pages.
|
grub_efi_free_boot_pages.
|
||||||
* include/grub/kernel.h: Export grub_machine_fini.
|
* include/grub/kernel.h: Export grub_machine_fini.
|
||||||
|
|
|
@ -453,6 +453,14 @@ module = {
|
||||||
enable = efi;
|
enable = efi;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module = {
|
||||||
|
name = lsefimmap;
|
||||||
|
|
||||||
|
common = commands/efi/lsefimmap.c;
|
||||||
|
|
||||||
|
enable = efi;
|
||||||
|
};
|
||||||
|
|
||||||
module = {
|
module = {
|
||||||
name = blocklist;
|
name = blocklist;
|
||||||
common = commands/blocklist.c;
|
common = commands/blocklist.c;
|
||||||
|
@ -1419,9 +1427,3 @@ module = {
|
||||||
name = datehook;
|
name = datehook;
|
||||||
common = hook/datehook.c;
|
common = hook/datehook.c;
|
||||||
};
|
};
|
||||||
|
|
||||||
module = {
|
|
||||||
name = memmap;
|
|
||||||
common = commands/efi/memmap.c;
|
|
||||||
enable = ia64_efi;
|
|
||||||
};
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include <grub/types.h>
|
#include <grub/types.h>
|
||||||
#include <grub/mm.h>
|
#include <grub/mm.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/normal.h>
|
|
||||||
#include <grub/efi/api.h>
|
#include <grub/efi/api.h>
|
||||||
#include <grub/efi/efi.h>
|
#include <grub/efi/efi.h>
|
||||||
#include <grub/command.h>
|
#include <grub/command.h>
|
||||||
|
@ -28,9 +27,9 @@
|
||||||
((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size)))
|
((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size)))
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_cmd_memmap (grub_command_t cmd __attribute__ ((unused)),
|
grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)),
|
||||||
int argc __attribute__ ((unused)),
|
int argc __attribute__ ((unused)),
|
||||||
char **args __attribute__ ((unused)))
|
char **args __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
grub_efi_uintn_t map_size;
|
grub_efi_uintn_t map_size;
|
||||||
grub_efi_memory_descriptor_t *memory_map;
|
grub_efi_memory_descriptor_t *memory_map;
|
||||||
|
@ -44,21 +43,19 @@ grub_cmd_memmap (grub_command_t cmd __attribute__ ((unused)),
|
||||||
|
|
||||||
memory_map = grub_malloc (map_size);
|
memory_map = grub_malloc (map_size);
|
||||||
if (memory_map == NULL)
|
if (memory_map == NULL)
|
||||||
return 0;
|
return grub_errno;
|
||||||
if (grub_efi_get_memory_map (&map_size, memory_map, NULL, &desc_size, 0) < 0)
|
if (grub_efi_get_memory_map (&map_size, memory_map, NULL, &desc_size, 0) <= 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
grub_set_more (1);
|
|
||||||
|
|
||||||
grub_printf
|
grub_printf
|
||||||
("Type Physical start - end #Pages "
|
("Type Physical start - end #Pages "
|
||||||
" Size Attributes\n");
|
" Size Attributes\n");
|
||||||
memory_map_end = ADD_MEMORY_DESCRIPTOR(memory_map, map_size);
|
memory_map_end = ADD_MEMORY_DESCRIPTOR (memory_map, map_size);
|
||||||
for (desc = memory_map;
|
for (desc = memory_map;
|
||||||
desc < memory_map_end;
|
desc < memory_map_end;
|
||||||
desc = ADD_MEMORY_DESCRIPTOR (desc, desc_size))
|
desc = ADD_MEMORY_DESCRIPTOR (desc, desc_size))
|
||||||
{
|
{
|
||||||
grub_efi_uintn_t size;
|
grub_efi_uint64_t size;
|
||||||
grub_efi_uint64_t attr;
|
grub_efi_uint64_t attr;
|
||||||
static const char types_str[][9] =
|
static const char types_str[][9] =
|
||||||
{
|
{
|
||||||
|
@ -77,28 +74,30 @@ grub_cmd_memmap (grub_command_t cmd __attribute__ ((unused)),
|
||||||
"IO-ports",
|
"IO-ports",
|
||||||
"PAL-code"
|
"PAL-code"
|
||||||
};
|
};
|
||||||
if (desc->type < sizeof (types_str) / sizeof (types_str[0]))
|
if (desc->type < ARRAY_SIZE (types_str))
|
||||||
grub_printf ("%s ", types_str[desc->type]);
|
grub_printf ("%s ", types_str[desc->type]);
|
||||||
else
|
else
|
||||||
grub_printf ("Unk %02x ", desc->type);
|
grub_printf ("Unk %02x ", desc->type);
|
||||||
|
|
||||||
grub_printf (" %016llx-%016llx %08lx",
|
grub_printf (" %016" PRIxGRUB_UINT64_T "-%016" PRIxGRUB_UINT64_T
|
||||||
(unsigned long long) desc->physical_start,
|
" %08" PRIxGRUB_EFI_UINTN_T,
|
||||||
(unsigned long long) desc->physical_start + (desc->num_pages << 12) - 1,
|
desc->physical_start,
|
||||||
(unsigned long) desc->num_pages);
|
desc->physical_start + (desc->num_pages << 12) - 1,
|
||||||
|
desc->num_pages);
|
||||||
|
|
||||||
size = desc->num_pages << (12 - 10);
|
size = desc->num_pages;
|
||||||
|
size <<= (12 - 10);
|
||||||
if (size < 1024)
|
if (size < 1024)
|
||||||
grub_printf (" %4uKB", (unsigned) size);
|
grub_printf (" %4" PRIuGRUB_UINT64_T "KB", size);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size /= 1024;
|
size /= 1024;
|
||||||
if (size < 1024)
|
if (size < 1024)
|
||||||
grub_printf (" %4uMB", (unsigned) size);
|
grub_printf (" %4" PRIuGRUB_UINT64_T "MB", size);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size /= 1024;
|
size /= 1024;
|
||||||
grub_printf (" %4uGB", (unsigned) size);
|
grub_printf (" %4" PRIuGRUB_UINT64_T "GB", size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,8 +124,6 @@ grub_cmd_memmap (grub_command_t cmd __attribute__ ((unused)),
|
||||||
grub_printf ("\n");
|
grub_printf ("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_set_more (0);
|
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
grub_free (memory_map);
|
grub_free (memory_map);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -134,13 +131,13 @@ grub_cmd_memmap (grub_command_t cmd __attribute__ ((unused)),
|
||||||
|
|
||||||
static grub_command_t cmd;
|
static grub_command_t cmd;
|
||||||
|
|
||||||
GRUB_MOD_INIT(memmap)
|
GRUB_MOD_INIT(lsefimmap)
|
||||||
{
|
{
|
||||||
cmd = grub_register_command ("memmap", grub_cmd_memmap,
|
cmd = grub_register_command ("lsefimmap", grub_cmd_lsefimmap,
|
||||||
"", "Display memory map.");
|
"", "Display EFI memory map.");
|
||||||
}
|
}
|
||||||
|
|
||||||
GRUB_MOD_FINI(memmap)
|
GRUB_MOD_FINI(lsefimmap)
|
||||||
{
|
{
|
||||||
grub_unregister_command (cmd);
|
grub_unregister_command (cmd);
|
||||||
}
|
}
|
|
@ -287,6 +287,8 @@ typedef grub_uint64_t grub_efi_uint64_t;
|
||||||
typedef grub_uint8_t grub_efi_char8_t;
|
typedef grub_uint8_t grub_efi_char8_t;
|
||||||
typedef grub_uint16_t grub_efi_char16_t;
|
typedef grub_uint16_t grub_efi_char16_t;
|
||||||
|
|
||||||
|
#define PRIxGRUB_EFI_UINTN_T "lx"
|
||||||
|
|
||||||
typedef grub_efi_intn_t grub_efi_status_t;
|
typedef grub_efi_intn_t grub_efi_status_t;
|
||||||
|
|
||||||
#define GRUB_EFI_ERROR_CODE(value) \
|
#define GRUB_EFI_ERROR_CODE(value) \
|
||||||
|
|
Loading…
Reference in a new issue