diff options
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 9b65029dd2a3..a5ae04a57c78 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/ppc64/kernel/head.S | ||
3 | * | ||
4 | * PowerPC version | 2 | * PowerPC version |
5 | * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) | 3 | * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) |
6 | * | 4 | * |
@@ -279,6 +277,7 @@ exception_marker: | |||
279 | std r10,0(r1); /* make stack chain pointer */ \ | 277 | std r10,0(r1); /* make stack chain pointer */ \ |
280 | std r0,GPR0(r1); /* save r0 in stackframe */ \ | 278 | std r0,GPR0(r1); /* save r0 in stackframe */ \ |
281 | std r10,GPR1(r1); /* save r1 in stackframe */ \ | 279 | std r10,GPR1(r1); /* save r1 in stackframe */ \ |
280 | ACCOUNT_CPU_USER_ENTRY(r9, r10); \ | ||
282 | std r2,GPR2(r1); /* save r2 in stackframe */ \ | 281 | std r2,GPR2(r1); /* save r2 in stackframe */ \ |
283 | SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \ | 282 | SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \ |
284 | SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \ | 283 | SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \ |
@@ -846,6 +845,14 @@ fast_exception_return: | |||
846 | ld r11,_NIP(r1) | 845 | ld r11,_NIP(r1) |
847 | andi. r3,r12,MSR_RI /* check if RI is set */ | 846 | andi. r3,r12,MSR_RI /* check if RI is set */ |
848 | beq- unrecov_fer | 847 | beq- unrecov_fer |
848 | |||
849 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
850 | andi. r3,r12,MSR_PR | ||
851 | beq 2f | ||
852 | ACCOUNT_CPU_USER_EXIT(r3, r4) | ||
853 | 2: | ||
854 | #endif | ||
855 | |||
849 | ld r3,_CCR(r1) | 856 | ld r3,_CCR(r1) |
850 | ld r4,_LINK(r1) | 857 | ld r4,_LINK(r1) |
851 | ld r5,_CTR(r1) | 858 | ld r5,_CTR(r1) |
@@ -1537,7 +1544,11 @@ _STATIC(__boot_from_prom) | |||
1537 | mr r28,r6 | 1544 | mr r28,r6 |
1538 | mr r27,r7 | 1545 | mr r27,r7 |
1539 | 1546 | ||
1540 | /* Align the stack to 16-byte boundary for broken yaboot */ | 1547 | /* |
1548 | * Align the stack to 16-byte boundary | ||
1549 | * Depending on the size and layout of the ELF sections in the initial | ||
1550 | * boot binary, the stack pointer will be unalignet on PowerMac | ||
1551 | */ | ||
1541 | rldicr r1,r1,0,59 | 1552 | rldicr r1,r1,0,59 |
1542 | 1553 | ||
1543 | /* Make sure we are running in 64 bits mode */ | 1554 | /* Make sure we are running in 64 bits mode */ |
@@ -1840,21 +1851,6 @@ _STATIC(start_here_multiplatform) | |||
1840 | bl .__save_cpu_setup | 1851 | bl .__save_cpu_setup |
1841 | sync | 1852 | sync |
1842 | 1853 | ||
1843 | /* Setup a valid physical PACA pointer in SPRG3 for early_setup | ||
1844 | * note that boot_cpuid can always be 0 nowadays since there is | ||
1845 | * nowhere it can be initialized differently before we reach this | ||
1846 | * code | ||
1847 | */ | ||
1848 | LOAD_REG_IMMEDIATE(r27, boot_cpuid) | ||
1849 | add r27,r27,r26 | ||
1850 | lwz r27,0(r27) | ||
1851 | |||
1852 | LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */ | ||
1853 | mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ | ||
1854 | add r13,r13,r24 /* for this processor. */ | ||
1855 | add r13,r13,r26 /* convert to physical addr */ | ||
1856 | mtspr SPRN_SPRG3,r13 | ||
1857 | |||
1858 | /* Do very early kernel initializations, including initial hash table, | 1854 | /* Do very early kernel initializations, including initial hash table, |
1859 | * stab and slb setup before we turn on relocation. */ | 1855 | * stab and slb setup before we turn on relocation. */ |
1860 | 1856 | ||
@@ -1923,6 +1919,17 @@ _STATIC(start_here_common) | |||
1923 | /* Not reached */ | 1919 | /* Not reached */ |
1924 | BUG_OPCODE | 1920 | BUG_OPCODE |
1925 | 1921 | ||
1922 | /* Put the paca pointer into r13 and SPRG3 */ | ||
1923 | _GLOBAL(setup_boot_paca) | ||
1924 | LOAD_REG_IMMEDIATE(r3, boot_cpuid) | ||
1925 | lwz r3,0(r3) | ||
1926 | LOAD_REG_IMMEDIATE(r4, paca) /* Get base vaddr of paca array */ | ||
1927 | mulli r3,r3,PACA_SIZE /* Calculate vaddr of right paca */ | ||
1928 | add r13,r3,r4 /* for this processor. */ | ||
1929 | mtspr SPRN_SPRG3,r13 | ||
1930 | |||
1931 | blr | ||
1932 | |||
1926 | /* | 1933 | /* |
1927 | * We put a few things here that have to be page-aligned. | 1934 | * We put a few things here that have to be page-aligned. |
1928 | * This stuff goes at the beginning of the bss, which is page-aligned. | 1935 | * This stuff goes at the beginning of the bss, which is page-aligned. |