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