]> err.no Git - linux-2.6/commitdiff
[SPARC64]: Add sun4v case to __GET_CPUID() patch tables.
authorDavid S. Miller <davem@sunset.davemloft.net>
Sat, 4 Feb 2006 23:40:53 +0000 (15:40 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 20 Mar 2006 09:11:45 +0000 (01:11 -0800)
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/setup.c
include/asm-sparc64/cpudata.h

index f751d11926bc39f57ce8552b8c11b9869a5a58f7..2918ed3eb1ba1638d3f697862461e4b23e660c24 100644 (file)
@@ -520,6 +520,9 @@ static void __init per_cpu_patch(void)
                        else
                                insns = &p->cheetah_safari[0];
                        break;
+               case hypervisor:
+                       insns = &p->sun4v[0];
+                       break;
                default:
                        prom_printf("Unknown cpu type, halting.\n");
                        prom_halt();
index c15514f82c33b1f280458765b927047527343fde..4f28a85c1043de071c28cc9ba8de9334f3030ebf 100644 (file)
@@ -68,6 +68,7 @@ struct cpuid_patch_entry {
        unsigned int    cheetah_safari[4];
        unsigned int    cheetah_jbus[4];
        unsigned int    starfire[4];
+       unsigned int    sun4v[4];
 };
 extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;
 #endif
@@ -79,6 +80,8 @@ extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;
 
 #define TRAP_BLOCK_SZ_SHIFT    6
 
+#include <asm/scratchpad.h>
+
 #ifdef CONFIG_SMP
 
 #define __GET_CPUID(REG)                               \
@@ -105,6 +108,11 @@ extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;
        sllx            REG, 9, REG;                    \
        or              REG, 0xd0, REG;                 \
        lduwa           [REG] ASI_PHYS_BYPASS_EC_E, REG;\
+       /* sun4v implementation. */                     \
+       mov             SCRATCHPAD_CPUID, REG;          \
+       nop;                                            \
+       ldxa            [REG] ASI_SCRATCHPAD, REG;      \
+       nop;                                            \
        .previous;
 
 /* Clobbers TMP, current address space PGD phys address into DEST.  */