[MIPS] tlbex.c: use __cacheline_aligned instead of __tlb_handler_align
[safe/jmp/linux-2.6] / arch / mips / kernel / head.S
index bdf6f6e..50be56c 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 1994, 1995 Waldorf Electronics
  * Written by Ralf Baechle and Andreas Busse
- * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 Ralf Baechle
+ * Copyright (C) 1994 - 99, 2003, 06 Ralf Baechle
  * Copyright (C) 1996 Paul M. Antoine
  * Modified for DECStation and hence R3000 support by Paul M. Antoine
  * Further modifications by David S. Miller and Harald Koerfgen
  * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/threads.h>
 
+#include <asm/addrspace.h>
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
+#include <asm/irqflags.h>
 #include <asm/regdef.h>
 #include <asm/page.h>
 #include <asm/mipsregs.h>
 
 #include <kernel-entry-init.h>
 
-       .macro  ARC64_TWIDDLE_PC
-#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL)
-       /* We get launched at a XKPHYS address but the kernel is linked to
-          run at a KSEG0 address, so jump there.  */
-       PTR_LA  t0, \@f
-       jr      t0
-\@:
-#endif
-       .endm
-
        /*
         * inputs are the text nasid in t1, data nasid in t2.
         */
@@ -96,7 +87,7 @@
        /* Clear TKSU, leave IXMT */
        xori    t0, 0x00001800
        mtc0    t0, CP0_TCSTATUS
-       ehb
+       _ehb
        /* We need to leave the global IE bit set, but clear EXL...*/
        mfc0    t0, CP0_STATUS
        or      t0, ST0_CU0 | ST0_EXL | ST0_ERL | \set | \clr
 #endif
        .endm
 
+#ifndef CONFIG_NO_EXCEPT_FILL
        /*
         * Reserved space for exception handlers.
         * Necessary for machines which link their kernels at KSEG0.
         */
        .fill   0x400
+#endif
 
-EXPORT(stext)                                  # used for profiling
 EXPORT(_stext)
 
-#if defined(CONFIG_QEMU) || defined(CONFIG_MIPS_SIM)
+#ifdef CONFIG_BOOT_RAW
        /*
         * Give us a fighting chance of running if execution beings at the
         * kernel load address.  This is needed because this platform does
         * not have a ELF loader yet.
         */
+FEXPORT(__kernel_entry)
        j       kernel_entry
 #endif
-       __INIT
+
+       __INIT_REFOK
 
 NESTED(kernel_entry, 16, sp)                   # kernel entry point
 
@@ -154,7 +148,11 @@ NESTED(kernel_entry, 16, sp)                       # kernel entry point
 
        setup_c0_status_pri
 
-       ARC64_TWIDDLE_PC
+       /* We might not get launched at the address the kernel is linked to,
+          so we jump there.  */
+       PTR_LA  t0, 0f
+       jr      t0
+0:
 
 #ifdef CONFIG_MIPS_MT_SMTC
        /*
@@ -189,16 +187,15 @@ NESTED(kernel_entry, 16, sp)                      # kernel entry point
 
        MTC0            zero, CP0_CONTEXT       # clear context register
        PTR_LA          $28, init_thread_union
-       PTR_ADDIU       sp, $28, _THREAD_SIZE - 32
+       PTR_LI          sp, _THREAD_SIZE - 32
+       PTR_ADDU        sp, $28
        set_saved_sp    sp, t0, t1
        PTR_SUBU        sp, 4 * SZREG           # init stack pointer
 
        j               start_kernel
        END(kernel_entry)
 
-#ifdef CONFIG_QEMU
        __INIT
-#endif
 
 #ifdef CONFIG_SMP
 /*
@@ -230,25 +227,3 @@ NESTED(smp_bootstrap, 16, sp)
 #endif /* CONFIG_SMP */
 
        __FINIT
-
-       .comm   kernelsp,    NR_CPUS * 8, 8
-       .comm   pgd_current, NR_CPUS * 8, 8
-
-       .comm   fw_arg0, SZREG, SZREG           # firmware arguments
-       .comm   fw_arg1, SZREG, SZREG
-       .comm   fw_arg2, SZREG, SZREG
-       .comm   fw_arg3, SZREG, SZREG
-
-       .macro page name, order
-       .comm   \name, (_PAGE_SIZE << \order), (_PAGE_SIZE << \order)
-       .endm
-
-       /*
-        * On 64-bit we've got three-level pagetables with a slightly
-        * different layout ...
-        */
-       page    swapper_pg_dir, _PGD_ORDER
-#ifdef CONFIG_64BIT
-       page    invalid_pmd_table, _PMD_ORDER
-#endif
-       page    invalid_pte_table, _PTE_ORDER