mmu.c (2612e3bbc0386368a850140a6c9b990cd496a5ec) mmu.c (358d1c39c82afaed58778633f6ed76c8fe9dbf9c)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mm/mmu.c
4 *
5 * Copyright (C) 1995-2005 Russell King
6 */
7#include <linux/module.h>
8#include <linux/kernel.h>

--- 723 unchanged lines hidden (view full) ---

732 panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
733 __func__, sz, sz);
734
735 return ptr;
736}
737
738static void *__init late_alloc(unsigned long sz)
739{
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mm/mmu.c
4 *
5 * Copyright (C) 1995-2005 Russell King
6 */
7#include <linux/module.h>
8#include <linux/kernel.h>

--- 723 unchanged lines hidden (view full) ---

732 panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
733 __func__, sz, sz);
734
735 return ptr;
736}
737
738static void *__init late_alloc(unsigned long sz)
739{
740 void *ptr = (void *)__get_free_pages(GFP_PGTABLE_KERNEL, get_order(sz));
740 void *ptdesc = pagetable_alloc(GFP_PGTABLE_KERNEL & ~__GFP_HIGHMEM,
741 get_order(sz));
741
742
742 if (!ptr || !pgtable_pte_page_ctor(virt_to_page(ptr)))
743 if (!ptdesc || !pagetable_pte_ctor(ptdesc))
743 BUG();
744 BUG();
744 return ptr;
745 return ptdesc_to_virt(ptdesc);
745}
746
747static pte_t * __init arm_pte_alloc(pmd_t *pmd, unsigned long addr,
748 unsigned long prot,
749 void *(*alloc)(unsigned long sz))
750{
751 if (pmd_none(*pmd)) {
752 pte_t *pte = alloc(PTE_HWTABLE_OFF + PTE_HWTABLE_SIZE);

--- 1060 unchanged lines hidden ---
746}
747
748static pte_t * __init arm_pte_alloc(pmd_t *pmd, unsigned long addr,
749 unsigned long prot,
750 void *(*alloc)(unsigned long sz))
751{
752 if (pmd_none(*pmd)) {
753 pte_t *pte = alloc(PTE_HWTABLE_OFF + PTE_HWTABLE_SIZE);

--- 1060 unchanged lines hidden ---