OSDN Git Service

Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[uclinux-h8/linux.git] / arch / arc / mm / tlbex.S
index d572f1c..f6f4c3c 100644 (file)
@@ -35,8 +35,6 @@
  * Rahul Trivedi, Amit Bhor: Codito Technologies 2004
  */
 
-       .cpu A7
-
 #include <linux/linkage.h>
 #include <asm/entry.h>
 #include <asm/mmu.h>
@@ -46,6 +44,7 @@
 #include <asm/processor.h>
 #include <asm/tlb-mmu1.h>
 
+#ifdef CONFIG_ISA_ARCOMPACT
 ;-----------------------------------------------------------------
 ; ARC700 Exception Handling doesn't auto-switch stack and it only provides
 ; ONE scratch AUX reg "ARC_REG_SCRATCH_DATA0"
@@ -123,6 +122,24 @@ ex_saved_reg1:
 #endif
 .endm
 
+#else  /* ARCv2 */
+
+.macro TLBMISS_FREEUP_REGS
+       PUSH  r0
+       PUSH  r1
+       PUSH  r2
+       PUSH  r3
+.endm
+
+.macro TLBMISS_RESTORE_REGS
+       POP   r3
+       POP   r2
+       POP   r1
+       POP   r0
+.endm
+
+#endif
+
 ;============================================================================
 ;  Troubleshooting Stuff
 ;============================================================================
@@ -241,6 +258,7 @@ ex_saved_reg1:
 ; Commit the TLB entry into MMU
 
 .macro COMMIT_ENTRY_TO_MMU
+#if (CONFIG_ARC_MMU_VER < 4)
 
        /* Get free TLB slot: Set = computed from vaddr, way = random */
        sr  TLBGetIndex, [ARC_REG_TLBCOMMAND]
@@ -251,6 +269,10 @@ ex_saved_reg1:
 #else
        sr TLBWrite, [ARC_REG_TLBCOMMAND]
 #endif
+
+#else
+       sr TLBInsertEntry, [ARC_REG_TLBCOMMAND]
+#endif
 .endm
 
 
@@ -291,6 +313,7 @@ ENTRY(EV_TLBMissI)
        CONV_PTE_TO_TLB
        COMMIT_ENTRY_TO_MMU
        TLBMISS_RESTORE_REGS
+EV_TLBMissI_fast_ret:  ; additional label for VDK OS-kit instrumentation
        rtie
 
 END(EV_TLBMissI)
@@ -356,6 +379,7 @@ ENTRY(EV_TLBMissD)
 
        COMMIT_ENTRY_TO_MMU
        TLBMISS_RESTORE_REGS
+EV_TLBMissD_fast_ret:  ; additional label for VDK OS-kit instrumentation
        rtie
 
 ;-------- Common routine to call Linux Page Fault Handler -----------
@@ -366,19 +390,5 @@ do_slow_path_pf:
 
        ; Slow path TLB Miss handled as a regular ARC Exception
        ; (stack switching / save the complete reg-file).
-       EXCEPTION_PROLOGUE
-
-       ; ------- setup args for Linux Page fault Hanlder ---------
-       mov_s r1, sp
-       lr    r0, [efa]
-
-       ; We don't want exceptions to be disabled while the fault is handled.
-       ; Now that we have saved the context we return from exception hence
-       ; exceptions get re-enable
-
-       FAKE_RET_FROM_EXCPN  r9
-
-       bl  do_page_fault
-       b   ret_from_exception
-
+       b  call_do_page_fault
 END(EV_TLBMissD)