@@ -671,6 +671,39 @@ static void __init gateway_init(void)
671
671
PAGE_SIZE , PAGE_GATEWAY , 1 );
672
672
}
673
673
674
+ static void __init fixmap_init (void )
675
+ {
676
+ unsigned long addr = FIXMAP_START ;
677
+ unsigned long end = FIXMAP_START + FIXMAP_SIZE ;
678
+ pgd_t * pgd = pgd_offset_k (addr );
679
+ p4d_t * p4d = p4d_offset (pgd , addr );
680
+ pud_t * pud = pud_offset (p4d , addr );
681
+ pmd_t * pmd ;
682
+
683
+ BUILD_BUG_ON (FIXMAP_SIZE > PMD_SIZE );
684
+
685
+ #if CONFIG_PGTABLE_LEVELS == 3
686
+ if (pud_none (* pud )) {
687
+ pmd = memblock_alloc (PAGE_SIZE << PMD_TABLE_ORDER ,
688
+ PAGE_SIZE << PMD_TABLE_ORDER );
689
+ if (!pmd )
690
+ panic ("fixmap: pmd allocation failed.\n" );
691
+ pud_populate (NULL , pud , pmd );
692
+ }
693
+ #endif
694
+
695
+ pmd = pmd_offset (pud , addr );
696
+ do {
697
+ pte_t * pte = memblock_alloc (PAGE_SIZE , PAGE_SIZE );
698
+ if (!pte )
699
+ panic ("fixmap: pte allocation failed.\n" );
700
+
701
+ pmd_populate_kernel (& init_mm , pmd , pte );
702
+
703
+ addr += PAGE_SIZE ;
704
+ } while (addr < end );
705
+ }
706
+
674
707
static void __init parisc_bootmem_free (void )
675
708
{
676
709
unsigned long max_zone_pfn [MAX_NR_ZONES ] = { 0 , };
@@ -685,6 +718,7 @@ void __init paging_init(void)
685
718
setup_bootmem ();
686
719
pagetable_init ();
687
720
gateway_init ();
721
+ fixmap_init ();
688
722
flush_cache_all_local (); /* start with known state */
689
723
flush_tlb_all_local (NULL );
690
724
0 commit comments