arch/microblaze/mm/pgtable.c

Source file repositories/reference/linux-study-clean/arch/microblaze/mm/pgtable.c

File Facts

System
Linux kernel
Corpus path
arch/microblaze/mm/pgtable.c
Extension
.c
Size
6450 bytes
Lines
265
Domain
Architecture Layer
Bucket
arch/microblaze
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (pmd_present(*pmd)) {
			pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
			if (pte) {
				retval = 1;
				*ptep = pte;
			}
		}
	}
	return retval;
}

/* Find physical address for this virtual address.  Normally used by
 * I/O functions, but anyone can call it.
 */
unsigned long iopa(unsigned long addr)
{
	unsigned long pa;

	pte_t *pte;
	struct mm_struct *mm;

	/* Allow mapping of user addresses (within the thread)
	 * for DMA if necessary.
	 */
	if (addr < TASK_SIZE)
		mm = current->mm;
	else
		mm = &init_mm;

	pa = 0;
	if (get_pteptr(mm, addr, &pte))
		pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK);

	return pa;
}

__ref pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
{
	if (mem_init_done)
		return __pte_alloc_one_kernel(mm);
	else
		return memblock_alloc_try_nid(PAGE_SIZE, PAGE_SIZE,
					      MEMBLOCK_LOW_LIMIT,
					      memory_start + kernel_tlb,
					      NUMA_NO_NODE);
}

void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags)
{
	unsigned long address = __fix_to_virt(idx);

	if (idx >= __end_of_fixed_addresses)
		BUG();

	map_page(address, phys, pgprot_val(flags));
}

Annotation

Implementation Notes