Lines Matching refs:md

220 is_available_memory (efi_memory_desc_t *md)  in is_available_memory()  argument
222 if (!(md->attribute & EFI_MEMORY_WB)) in is_available_memory()
225 switch (md->type) { in is_available_memory()
242 trim_bottom (efi_memory_desc_t *md, u64 start_addr) in trim_bottom() argument
246 if (md->phys_addr >= start_addr || !md->num_pages) in trim_bottom()
249 num_skipped_pages = (start_addr - md->phys_addr) >> EFI_PAGE_SHIFT; in trim_bottom()
250 if (num_skipped_pages > md->num_pages) in trim_bottom()
251 num_skipped_pages = md->num_pages; in trim_bottom()
253 if (is_available_memory(md)) in trim_bottom()
257 md->phys_addr, start_addr - IA64_GRANULE_SIZE); in trim_bottom()
263 md->phys_addr += num_skipped_pages << EFI_PAGE_SHIFT; in trim_bottom()
264 md->num_pages -= num_skipped_pages; in trim_bottom()
268 trim_top (efi_memory_desc_t *md, u64 end_addr) in trim_top() argument
272 md_end_addr = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT); in trim_top()
274 if (md_end_addr <= end_addr || !md->num_pages) in trim_top()
278 if (num_dropped_pages > md->num_pages) in trim_top()
279 num_dropped_pages = md->num_pages; in trim_top()
281 if (is_available_memory(md)) in trim_top()
285 md->phys_addr, end_addr); in trim_top()
286 md->num_pages -= num_dropped_pages; in trim_top()
302 efi_memory_desc_t *md, *check_md; in efi_memmap_walk() local
310 md = p; in efi_memmap_walk()
313 if (!(md->attribute & EFI_MEMORY_WB)) in efi_memmap_walk()
321 granule_addr = md->phys_addr & ~(IA64_GRANULE_SIZE - 1); in efi_memmap_walk()
324 if (first_non_wb_addr < md->phys_addr) { in efi_memmap_walk()
325 trim_bottom(md, granule_addr + IA64_GRANULE_SIZE); in efi_memmap_walk()
326 granule_addr = md->phys_addr & ~(IA64_GRANULE_SIZE - 1); in efi_memmap_walk()
341 if (last_granule_addr < md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) in efi_memmap_walk()
342 trim_top(md, last_granule_addr); in efi_memmap_walk()
344 if (is_available_memory(md)) { in efi_memmap_walk()
345 if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) { in efi_memmap_walk()
346 if (md->phys_addr > mem_limit) in efi_memmap_walk()
348 md->num_pages = (mem_limit - md->phys_addr) >> EFI_PAGE_SHIFT; in efi_memmap_walk()
351 if (md->num_pages == 0) in efi_memmap_walk()
354 curr.start = PAGE_OFFSET + md->phys_addr; in efi_memmap_walk()
355 curr.end = curr.start + (md->num_pages << EFI_PAGE_SHIFT); in efi_memmap_walk()
394 efi_memory_desc_t *md; in efi_map_pal_code() local
408 md = p; in efi_map_pal_code()
409 if (md->type != EFI_PAL_CODE) in efi_map_pal_code()
414 md->phys_addr); in efi_map_pal_code()
422 vaddr = PAGE_OFFSET + md->phys_addr; in efi_map_pal_code()
442 if (md->num_pages << EFI_PAGE_SHIFT > IA64_GRANULE_SIZE) in efi_map_pal_code()
448 smp_processor_id(), md->phys_addr, in efi_map_pal_code()
449 md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), in efi_map_pal_code()
458 pte_val(mk_pte_phys(md->phys_addr, PAGE_KERNEL)), IA64_GRANULE_SHIFT); in efi_map_pal_code()
467 ia64_mca_tlb_list[cpu].pal_paddr= pte_val(mk_pte_phys(md->phys_addr, PAGE_KERNEL)); in efi_map_pal_code()
570 efi_memory_desc_t *md; in efi_init() local
574 md = p; in efi_init()
576 i, md->type, md->attribute, md->phys_addr, in efi_init()
577 md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), in efi_init()
578 md->num_pages >> (20 - EFI_PAGE_SHIFT)); in efi_init()
591 efi_memory_desc_t *md; in efi_enter_virtual_mode() local
600 md = p; in efi_enter_virtual_mode()
601 if (md->attribute & EFI_MEMORY_RUNTIME) { in efi_enter_virtual_mode()
606 if (md->attribute & EFI_MEMORY_WB) { in efi_enter_virtual_mode()
607 md->virt_addr = (u64) __va(md->phys_addr); in efi_enter_virtual_mode()
608 } else if (md->attribute & EFI_MEMORY_UC) { in efi_enter_virtual_mode()
609 md->virt_addr = (u64) ioremap(md->phys_addr, 0); in efi_enter_virtual_mode()
610 } else if (md->attribute & EFI_MEMORY_WC) { in efi_enter_virtual_mode()
612 md->virt_addr = ia64_remap(md->phys_addr, (_PAGE_A | _PAGE_P in efi_enter_virtual_mode()
619 md->virt_addr = (u64) ioremap(md->phys_addr, 0); in efi_enter_virtual_mode()
621 } else if (md->attribute & EFI_MEMORY_WT) { in efi_enter_virtual_mode()
623 md->virt_addr = ia64_remap(md->phys_addr, (_PAGE_A | _PAGE_P in efi_enter_virtual_mode()
629 md->virt_addr = (u64) ioremap(md->phys_addr, 0); in efi_enter_virtual_mode()
666 efi_memory_desc_t *md; in efi_get_iobase() local
674 md = p; in efi_get_iobase()
675 if (md->type == EFI_MEMORY_MAPPED_IO_PORT_SPACE) { in efi_get_iobase()
676 if (md->attribute & EFI_MEMORY_UC) in efi_get_iobase()
677 return md->phys_addr; in efi_get_iobase()
687 efi_memory_desc_t *md; in efi_mem_type() local
695 md = p; in efi_mem_type()
697 if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) in efi_mem_type()
698 return md->type; in efi_mem_type()
707 efi_memory_desc_t *md; in efi_mem_attributes() local
715 md = p; in efi_mem_attributes()
717 if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) in efi_mem_attributes()
718 return md->attribute; in efi_mem_attributes()