* extern void loadcam_entry(unsigned int index)
  *
  * Load TLBCAM[index] entry in to the L2 CAM MMU
- * Must preserve r7, r8, r9, r10 and r11
+ * Must preserve r7, r8, r9, r10, r11, r12
  */
 _GLOBAL(loadcam_entry)
        mflr    r5
  *
  * r3 = first entry to write
  * r4 = number of entries to write
- * r5 = temporary tlb entry
+ * r5 = temporary tlb entry (0 means no switch to AS1)
  */
 _GLOBAL(loadcam_multi)
        mflr    r8
        mfmsr   r11
        andi.   r11,r11,MSR_IS
        bne     10f
+       mr.     r12, r5
+       beq     10f
 
        /*
         * Set up temporary TLB entry that is the same as what we're
        /* Don't return to AS=0 if we were in AS=1 at function start */
        andi.   r11,r11,MSR_IS
        bne     3f
+       cmpwi   r12, 0
+       beq     3f
 
        /* Return to AS=0 and clear the temporary entry */
        mfmsr   r6