]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/kernel/head.S
Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubifs-2.6
[linux-2.6-omap-h63xx.git] / arch / ia64 / kernel / head.S
index ddeab4e36fd5fd3b19421349ea19678b9b33adb8..8bdea8eb62e366abc0350bd53261146d445ab41a 100644 (file)
 #include <asm/mmu_context.h>
 #include <asm/asm-offsets.h>
 #include <asm/pal.h>
+#include <asm/paravirt.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 #include <asm/mca_asm.h>
+#include <linux/init.h>
+#include <linux/linkage.h>
 
 #ifdef CONFIG_HOTPLUG_CPU
 #define SAL_PSR_BITS_TO_SET                            \
@@ -356,7 +359,31 @@ start_ap:
        mov ar.rsc=0            // place RSE in enforced lazy mode
        ;;
        loadrs                  // clear the dirty partition
-       mov IA64_KR(PER_CPU_DATA)=r0    // clear physical per-CPU base
+       movl r19=__phys_per_cpu_start
+       mov r18=PERCPU_PAGE_SIZE
+       ;;
+#ifndef CONFIG_SMP
+       add r19=r19,r18
+       ;;
+#else
+(isAP) br.few 2f
+       mov r20=r19
+       sub r19=r19,r18
+       ;;
+       shr.u r18=r18,3
+1:
+       ld8 r21=[r20],8;;
+       st8[r19]=r21,8
+       adds r18=-1,r18;;
+       cmp4.lt p7,p6=0,r18
+(p7)   br.cond.dptk.few 1b
+2:
+#endif
+       tpa r19=r19
+       ;;
+       .pred.rel.mutex isBP,isAP
+(isBP) mov IA64_KR(PER_CPU_DATA)=r19   // per-CPU base for cpu0
+(isAP) mov IA64_KR(PER_CPU_DATA)=r0    // clear physical per-CPU base
        ;;
        mov ar.bspstore=r2      // establish the new RSE stack
        ;;
@@ -367,6 +394,44 @@ start_ap:
        ;;
 (isBP) st8 [r2]=r28            // save the address of the boot param area passed by the bootloader
 
+#ifdef CONFIG_PARAVIRT
+
+       movl r14=hypervisor_setup_hooks
+       movl r15=hypervisor_type
+       mov r16=num_hypervisor_hooks
+       ;;
+       ld8 r2=[r15]
+       ;;
+       cmp.ltu p7,p0=r2,r16    // array size check
+       shladd r8=r2,3,r14
+       ;;
+(p7)   ld8 r9=[r8]
+       ;;
+(p7)   mov b1=r9
+(p7)   cmp.ne.unc p7,p0=r9,r0  // no actual branch to NULL
+       ;;
+(p7)   br.call.sptk.many rp=b1
+
+       __INITDATA
+
+default_setup_hook = 0         // Currently nothing needs to be done.
+
+       .weak xen_setup_hook
+
+       .global hypervisor_type
+hypervisor_type:
+       data8           PARAVIRT_HYPERVISOR_TYPE_DEFAULT
+
+       // must have the same order with PARAVIRT_HYPERVISOR_TYPE_xxx
+
+hypervisor_setup_hooks:
+       data8           default_setup_hook
+       data8           xen_setup_hook
+num_hypervisor_hooks = (. - hypervisor_setup_hooks) / 8
+       .previous
+
+#endif
+
 #ifdef CONFIG_SMP
 (isAP) br.call.sptk.many rp=start_secondary
 .ret0:
@@ -1082,7 +1147,7 @@ SET_REG(b5);
         *   p15    - used to track flag status.
         *
         * If you patch this code to use more registers, do not forget to update
-        * the clobber lists for spin_lock() in include/asm-ia64/spinlock.h.
+        * the clobber lists for spin_lock() in arch/ia64/include/asm/spinlock.h.
         */
 
 #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3)