[PARISC] Kill off the last vestiges of ASM_PAGE_SIZE
[sfrench/cifs-2.6.git] / arch / parisc / kernel / head.S
index 0b47afc2069038a8d9774e085762eb90e2db882f..369919d828fb10baac656a64b85df584d303dd58 100644 (file)
@@ -2,7 +2,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1999 by Helge Deller
+ * Copyright (C) 1999-2007 by Helge Deller <deller@gmx.de>
  * Copyright 1999 SuSE GmbH (Philipp Rumpf)
  * Copyright 1999 Philipp Rumpf (prumpf@tux.org)
  * Copyright 2000 Hewlett Packard (Paul Bame, bame@puffin.external.hp.com)
@@ -12,8 +12,6 @@
  * Initial Version 04-23-1999 by Helge Deller <deller@gmx.de>
  */
 
-#include <linux/config.h>      /* for CONFIG_SMP */
-
 #include <asm/asm-offsets.h>
 #include <asm/psw.h>
 #include <asm/pdc.h>
 #include <asm/assembly.h>
 #include <asm/pgtable.h>
 
+#include <linux/linkage.h>
+
        .level  LEVEL
 
        .data
-
-       .export boot_args
-boot_args:
+ENTRY(boot_args)
        .word 0 /* arg0 */
        .word 0 /* arg1 */
        .word 0 /* arg2 */
        .word 0 /* arg3 */
+END(boot_args)
 
        .text
        .align  4
@@ -40,10 +39,9 @@ boot_args:
         .import fault_vector_11,code    /* IVA parisc 1.1 32 bit */
        .import $global$                /* forward declaration */
 #endif /*!CONFIG_64BIT*/
-       .export stext
        .export _stext,data             /* Kernel want it this way! */
 _stext:
-stext:
+ENTRY(stext)
        .proc
        .callinfo
 
@@ -76,16 +74,16 @@ $bss_loop:
        mtctl           %r4,%cr24       /* Initialize kernel root pointer */
        mtctl           %r4,%cr25       /* Initialize user root pointer */
 
-#ifdef CONFIG_64BIT
+#if PT_NLEVELS == 3
        /* Set pmd in pgd */
        load32          PA(pmd0),%r5
        shrd            %r5,PxD_VALUE_SHIFT,%r3 
-        ldo             (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3     
+       ldo             (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
        stw             %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4)
        ldo             ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r4
 #else
        /* 2-level page table, so pmd == pgd */
-        ldo             ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4
+       ldo             ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4
 #endif
 
        /* Fill in pmd with enough pte directories */
@@ -97,9 +95,9 @@ $bss_loop:
 
 1:
        stw             %r3,0(%r4)
-       ldo             (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
+       ldo             (PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
        addib,>         -1,%r1,1b
-#ifdef CONFIG_64BIT
+#if PT_NLEVELS == 3
        ldo             ASM_PMD_ENTRY_SIZE(%r4),%r4
 #else
        ldo             ASM_PGD_ENTRY_SIZE(%r4),%r4
@@ -107,13 +105,14 @@ $bss_loop:
 
 
        /* Now initialize the PTEs themselves */
-       ldo             _PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
+       ldo             0+_PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
+       ldi             (1<<(KERNEL_INITIAL_ORDER-PAGE_SHIFT)),%r11 /* PFN count */
        load32          PA(pg0),%r1
 
 $pgt_fill_loop:
        STREGM          %r3,ASM_PTE_ENTRY_SIZE(%r1)
-       ldo             ASM_PAGE_SIZE(%r3),%r3
-       bb,>=           %r3,31-KERNEL_INITIAL_ORDER,$pgt_fill_loop
+       ldo             (1<<PFN_PTE_SHIFT)(%r3),%r3 /* add one PFN */
+       addib,>         -1,%r11,$pgt_fill_loop
        nop
 
        /* Load the return address...er...crash 'n burn */
@@ -344,6 +343,9 @@ smp_slave_stext:
 
        .procend
 #endif /* CONFIG_SMP */
+
+ENDPROC(stext)
+
 #ifndef CONFIG_64BIT
        .data