Lines Matching full:md
269 is_memory_available (efi_memory_desc_t *md) in is_memory_available() argument
271 if (!(md->attribute & EFI_MEMORY_WB)) in is_memory_available()
274 switch (md->type) { in is_memory_available()
293 #define efi_md_size(md) (md->num_pages << EFI_PAGE_SHIFT) argument
302 efi_md_end(efi_memory_desc_t *md) in efi_md_end() argument
304 return (md->phys_addr + efi_md_size(md)); in efi_md_end()
308 efi_wb(efi_memory_desc_t *md) in efi_wb() argument
310 return (md->attribute & EFI_MEMORY_WB); in efi_wb()
314 efi_uc(efi_memory_desc_t *md) in efi_uc() argument
316 return (md->attribute & EFI_MEMORY_UC); in efi_uc()
366 efi_memory_desc_t *md; in efi_get_pal_addr() local
376 md = p; in efi_get_pal_addr()
377 if (md->type != EFI_PAL_CODE) in efi_get_pal_addr()
382 "dropped @ %llx\n", md->phys_addr); in efi_get_pal_addr()
390 vaddr = PAGE_OFFSET + md->phys_addr; in efi_get_pal_addr()
411 if (efi_md_size(md) > IA64_GRANULE_SIZE) in efi_get_pal_addr()
419 smp_processor_id(), md->phys_addr, in efi_get_pal_addr()
420 md->phys_addr + efi_md_size(md), in efi_get_pal_addr()
423 return __va(md->phys_addr); in efi_get_pal_addr()
561 efi_memory_desc_t *md; in efi_init() local
572 md = p; in efi_init()
573 size = md->num_pages << EFI_PAGE_SHIFT; in efi_init()
591 i, efi_md_typeattr_format(buf, sizeof(buf), md), in efi_init()
592 md->phys_addr, in efi_init()
593 md->phys_addr + efi_md_size(md), size, unit); in efi_init()
606 efi_memory_desc_t *md; in efi_enter_virtual_mode() local
615 md = p; in efi_enter_virtual_mode()
616 if (md->attribute & EFI_MEMORY_RUNTIME) { in efi_enter_virtual_mode()
621 if (md->attribute & EFI_MEMORY_WB) { in efi_enter_virtual_mode()
622 md->virt_addr = (u64) __va(md->phys_addr); in efi_enter_virtual_mode()
623 } else if (md->attribute & EFI_MEMORY_UC) { in efi_enter_virtual_mode()
624 md->virt_addr = (u64) ioremap(md->phys_addr, 0); in efi_enter_virtual_mode()
625 } else if (md->attribute & EFI_MEMORY_WC) { in efi_enter_virtual_mode()
627 md->virt_addr = ia64_remap(md->phys_addr, in efi_enter_virtual_mode()
636 md->virt_addr = (u64) ioremap(md->phys_addr, 0); in efi_enter_virtual_mode()
638 } else if (md->attribute & EFI_MEMORY_WT) { in efi_enter_virtual_mode()
640 md->virt_addr = ia64_remap(md->phys_addr, in efi_enter_virtual_mode()
649 md->virt_addr = (u64) ioremap(md->phys_addr, 0); in efi_enter_virtual_mode()
691 efi_memory_desc_t *md; in efi_get_iobase() local
699 md = p; in efi_get_iobase()
700 if (md->type == EFI_MEMORY_MAPPED_IO_PORT_SPACE) { in efi_get_iobase()
701 if (md->attribute & EFI_MEMORY_UC) in efi_get_iobase()
702 return md->phys_addr; in efi_get_iobase()
711 struct kern_memdesc *md; in kern_memory_descriptor() local
713 for (md = kern_memmap; md->start != ~0UL; md++) { in kern_memory_descriptor()
714 if (phys_addr - md->start < (md->num_pages << EFI_PAGE_SHIFT)) in kern_memory_descriptor()
715 return md; in kern_memory_descriptor()
724 efi_memory_desc_t *md; in efi_memory_descriptor() local
732 md = p; in efi_memory_descriptor()
734 if (phys_addr - md->phys_addr < efi_md_size(md)) in efi_memory_descriptor()
735 return md; in efi_memory_descriptor()
744 efi_memory_desc_t *md; in efi_memmap_intersects() local
755 md = p; in efi_memmap_intersects()
756 if (md->phys_addr < end && efi_md_end(md) > phys_addr) in efi_memmap_intersects()
765 efi_memory_desc_t *md = efi_memory_descriptor(phys_addr); in efi_mem_type() local
767 if (md) in efi_mem_type()
768 return md->type; in efi_mem_type()
775 efi_memory_desc_t *md = efi_memory_descriptor(phys_addr); in efi_mem_attributes() local
777 if (md) in efi_mem_attributes()
778 return md->attribute; in efi_mem_attributes()
787 efi_memory_desc_t *md = efi_memory_descriptor(phys_addr); in efi_mem_attribute() local
790 if (!md) in efi_mem_attribute()
797 attr = md->attribute & ~EFI_MEMORY_RUNTIME; in efi_mem_attribute()
799 unsigned long md_end = efi_md_end(md); in efi_mem_attribute()
804 md = efi_memory_descriptor(md_end); in efi_mem_attribute()
805 if (!md || (md->attribute & ~EFI_MEMORY_RUNTIME) != attr) in efi_mem_attribute()
807 } while (md); in efi_mem_attribute()
815 struct kern_memdesc *md; in kern_mem_attribute() local
829 md = kern_memory_descriptor(phys_addr); in kern_mem_attribute()
830 if (!md) in kern_mem_attribute()
833 attr = md->attribute; in kern_mem_attribute()
835 unsigned long md_end = kmd_end(md); in kern_mem_attribute()
840 md = kern_memory_descriptor(md_end); in kern_mem_attribute()
841 if (!md || md->attribute != attr) in kern_mem_attribute()
843 } while (md); in kern_mem_attribute()
976 efi_memory_desc_t *md, *pmd = NULL, *check_md; in find_memmap_space() local
992 for (p = efi_map_start; p < efi_map_end; pmd = md, p += efi_desc_size) { in find_memmap_space()
993 md = p; in find_memmap_space()
994 if (!efi_wb(md)) { in find_memmap_space()
998 efi_md_end(pmd) != md->phys_addr) { in find_memmap_space()
999 contig_low = GRANULEROUNDUP(md->phys_addr); in find_memmap_space()
1000 contig_high = efi_md_end(md); in find_memmap_space()
1012 if (!is_memory_available(md) || md->type == EFI_LOADER_DATA) in find_memmap_space()
1016 as = max(contig_low, md->phys_addr); in find_memmap_space()
1017 ae = min(contig_high, efi_md_end(md)); in find_memmap_space()
1053 efi_memory_desc_t *md, *pmd = NULL, *check_md; in efi_memmap_init() local
1063 for (p = efi_map_start; p < efi_map_end; pmd = md, p += efi_desc_size) { in efi_memmap_init()
1064 md = p; in efi_memmap_init()
1065 if (!efi_wb(md)) { in efi_memmap_init()
1066 if (efi_uc(md) && in efi_memmap_init()
1067 (md->type == EFI_CONVENTIONAL_MEMORY || in efi_memmap_init()
1068 md->type == EFI_BOOT_SERVICES_DATA)) { in efi_memmap_init()
1070 k->start = md->phys_addr; in efi_memmap_init()
1071 k->num_pages = md->num_pages; in efi_memmap_init()
1077 efi_md_end(pmd) != md->phys_addr) { in efi_memmap_init()
1078 contig_low = GRANULEROUNDUP(md->phys_addr); in efi_memmap_init()
1079 contig_high = efi_md_end(md); in efi_memmap_init()
1091 if (!is_memory_available(md)) in efi_memmap_init()
1098 if (md->phys_addr < contig_low) { in efi_memmap_init()
1099 lim = min(efi_md_end(md), contig_low); in efi_memmap_init()
1100 if (efi_uc(md)) { in efi_memmap_init()
1103 kmd_end(k-1) == md->phys_addr) { in efi_memmap_init()
1105 (lim - md->phys_addr) in efi_memmap_init()
1109 k->start = md->phys_addr; in efi_memmap_init()
1110 k->num_pages = (lim - md->phys_addr) in efi_memmap_init()
1117 as = md->phys_addr; in efi_memmap_init()
1119 if (efi_md_end(md) > contig_high) { in efi_memmap_init()
1120 lim = max(md->phys_addr, contig_high); in efi_memmap_init()
1121 if (efi_uc(md)) { in efi_memmap_init()
1122 if (lim == md->phys_addr && k > kern_memmap && in efi_memmap_init()
1124 kmd_end(k-1) == md->phys_addr) { in efi_memmap_init()
1125 (k-1)->num_pages += md->num_pages; in efi_memmap_init()
1129 k->num_pages = (efi_md_end(md) - lim) in efi_memmap_init()
1136 ae = efi_md_end(md); in efi_memmap_init()
1150 if (prev && kmd_end(prev) == md->phys_addr) { in efi_memmap_init()
1177 efi_memory_desc_t *md; in efi_initialize_iomem_resources() local
1189 md = p; in efi_initialize_iomem_resources()
1191 if (md->num_pages == 0) /* should not happen */ in efi_initialize_iomem_resources()
1197 switch (md->type) { in efi_initialize_iomem_resources()
1208 if (md->attribute & EFI_MEMORY_WP) { in efi_initialize_iomem_resources()
1211 } else if (md->attribute == EFI_MEMORY_UC) { in efi_initialize_iomem_resources()
1251 res->start = md->phys_addr; in efi_initialize_iomem_resources()
1252 res->end = md->phys_addr + efi_md_size(md) - 1; in efi_initialize_iomem_resources()
1288 efi_memory_desc_t *md; in kdump_find_rsvd_region() local
1296 md = p; in kdump_find_rsvd_region()
1297 if (!efi_wb(md)) in kdump_find_rsvd_region()
1299 start = ALIGN(md->phys_addr, alignment); in kdump_find_rsvd_region()
1300 end = efi_md_end(md); in kdump_find_rsvd_region()
1329 efi_memory_desc_t *md; in vmcore_find_descriptor_size() local
1338 md = p; in vmcore_find_descriptor_size()
1339 if (efi_wb(md) && md->type == EFI_LOADER_DATA in vmcore_find_descriptor_size()
1340 && md->phys_addr == address) { in vmcore_find_descriptor_size()
1341 ret = efi_md_size(md); in vmcore_find_descriptor_size()