Commit d4bbe676 authored by David Mosberger's avatar David Mosberger

More EFI fixes.

parent f6e0f291
...@@ -259,7 +259,8 @@ efi_map_pal_code (void) ...@@ -259,7 +259,8 @@ efi_map_pal_code (void)
mask = ~((1 << IA64_GRANULE_SHIFT) - 1); mask = ~((1 << IA64_GRANULE_SHIFT) - 1);
printk("CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", printk("CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n",
smp_processor_id(), md->phys_addr, md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), smp_processor_id(), md->phys_addr,
md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE);
/* /*
...@@ -375,7 +376,8 @@ efi_init (void) ...@@ -375,7 +376,8 @@ efi_init (void)
md = p; md = p;
printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n", printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n",
i, md->type, md->attribute, md->phys_addr, i, md->type, md->attribute, md->phys_addr,
md->phys_addr + (md->num_pages<<EFI_PAGE_SHIFT) - 1, md->num_pages >> 8); md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1,
md->num_pages >> (20 - EFI_PAGE_SHIFT));
} }
} }
#endif #endif
...@@ -495,6 +497,7 @@ efi_mem_type (u64 phys_addr) ...@@ -495,6 +497,7 @@ efi_mem_type (u64 phys_addr)
for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
md = p; md = p;
if ((md->phys_addr <= phys_addr) && (phys_addr <= if ((md->phys_addr <= phys_addr) && (phys_addr <=
(md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1))) (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1)))
return md->type; return md->type;
...@@ -502,8 +505,29 @@ efi_mem_type (u64 phys_addr) ...@@ -502,8 +505,29 @@ efi_mem_type (u64 phys_addr)
return 0; return 0;
} }
u64
efi_mem_attributes (u64 phys_addr)
{
void *efi_map_start, *efi_map_end, *p;
efi_memory_desc_t *md;
u64 efi_desc_size;
efi_map_start = __va(ia64_boot_param->efi_memmap);
efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
efi_desc_size = ia64_boot_param->efi_memdesc_size;
for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
md = p;
if ((md->phys_addr <= phys_addr) && (phys_addr <=
(md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1)))
return md->attribute;
}
return 0;
}
static void __exit static void __exit
efivars_exit(void) efivars_exit (void)
{ {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
remove_proc_entry(efi_dir->name, NULL); remove_proc_entry(efi_dir->name, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment