diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2006-02-28 12:25:22 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2006-02-28 12:25:22 -0500 |
commit | 9585da3729e7e27bf22818625c10ac6c64ebb609 (patch) | |
tree | 8c8d46f7f2cc933fdf75a6a75cf593a63f7b8717 /arch/powerpc/kernel/head_64.S | |
parent | 8080d5497146d5d27d9e8e78229d1adc7fe280cf (diff) | |
parent | 6749c5507388f3fc3719f57a54b540ee83f6661a (diff) |
Merge branch 'master' of git+ssh://galak@master.kernel.org/pub/scm/linux/kernel/git/galak/powerpc
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 120 |
1 files changed, 15 insertions, 105 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 7ebb73665e9d..be3ae7733577 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -137,7 +137,7 @@ _GLOBAL(__secondary_hold) | |||
137 | ori r24,r24,MSR_RI | 137 | ori r24,r24,MSR_RI |
138 | mtmsrd r24 /* RI on */ | 138 | mtmsrd r24 /* RI on */ |
139 | 139 | ||
140 | /* Grab our linux cpu number */ | 140 | /* Grab our physical cpu number */ |
141 | mr r24,r3 | 141 | mr r24,r3 |
142 | 142 | ||
143 | /* Tell the master cpu we're here */ | 143 | /* Tell the master cpu we're here */ |
@@ -151,12 +151,7 @@ _GLOBAL(__secondary_hold) | |||
151 | cmpdi 0,r4,1 | 151 | cmpdi 0,r4,1 |
152 | bne 100b | 152 | bne 100b |
153 | 153 | ||
154 | #ifdef CONFIG_HMT | 154 | #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) |
155 | SET_REG_IMMEDIATE(r4, .hmt_init) | ||
156 | mtctr r4 | ||
157 | bctr | ||
158 | #else | ||
159 | #ifdef CONFIG_SMP | ||
160 | LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) | 155 | LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) |
161 | mtctr r4 | 156 | mtctr r4 |
162 | mr r3,r24 | 157 | mr r3,r24 |
@@ -164,7 +159,6 @@ _GLOBAL(__secondary_hold) | |||
164 | #else | 159 | #else |
165 | BUG_OPCODE | 160 | BUG_OPCODE |
166 | #endif | 161 | #endif |
167 | #endif | ||
168 | 162 | ||
169 | /* This value is used to mark exception frames on the stack. */ | 163 | /* This value is used to mark exception frames on the stack. */ |
170 | .section ".toc","aw" | 164 | .section ".toc","aw" |
@@ -283,6 +277,7 @@ exception_marker: | |||
283 | std r10,0(r1); /* make stack chain pointer */ \ | 277 | std r10,0(r1); /* make stack chain pointer */ \ |
284 | std r0,GPR0(r1); /* save r0 in stackframe */ \ | 278 | std r0,GPR0(r1); /* save r0 in stackframe */ \ |
285 | std r10,GPR1(r1); /* save r1 in stackframe */ \ | 279 | std r10,GPR1(r1); /* save r1 in stackframe */ \ |
280 | ACCOUNT_CPU_USER_ENTRY(r9, r10); \ | ||
286 | std r2,GPR2(r1); /* save r2 in stackframe */ \ | 281 | std r2,GPR2(r1); /* save r2 in stackframe */ \ |
287 | SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \ | 282 | SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \ |
288 | SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \ | 283 | SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \ |
@@ -319,7 +314,6 @@ exception_marker: | |||
319 | label##_pSeries: \ | 314 | label##_pSeries: \ |
320 | HMT_MEDIUM; \ | 315 | HMT_MEDIUM; \ |
321 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ | 316 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ |
322 | RUNLATCH_ON(r13); \ | ||
323 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) | 317 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) |
324 | 318 | ||
325 | #define STD_EXCEPTION_ISERIES(n, label, area) \ | 319 | #define STD_EXCEPTION_ISERIES(n, label, area) \ |
@@ -327,7 +321,6 @@ label##_pSeries: \ | |||
327 | label##_iSeries: \ | 321 | label##_iSeries: \ |
328 | HMT_MEDIUM; \ | 322 | HMT_MEDIUM; \ |
329 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ | 323 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ |
330 | RUNLATCH_ON(r13); \ | ||
331 | EXCEPTION_PROLOG_ISERIES_1(area); \ | 324 | EXCEPTION_PROLOG_ISERIES_1(area); \ |
332 | EXCEPTION_PROLOG_ISERIES_2; \ | 325 | EXCEPTION_PROLOG_ISERIES_2; \ |
333 | b label##_common | 326 | b label##_common |
@@ -337,7 +330,6 @@ label##_iSeries: \ | |||
337 | label##_iSeries: \ | 330 | label##_iSeries: \ |
338 | HMT_MEDIUM; \ | 331 | HMT_MEDIUM; \ |
339 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ | 332 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ |
340 | RUNLATCH_ON(r13); \ | ||
341 | EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ | 333 | EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ |
342 | lbz r10,PACAPROCENABLED(r13); \ | 334 | lbz r10,PACAPROCENABLED(r13); \ |
343 | cmpwi 0,r10,0; \ | 335 | cmpwi 0,r10,0; \ |
@@ -390,6 +382,7 @@ label##_common: \ | |||
390 | label##_common: \ | 382 | label##_common: \ |
391 | EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ | 383 | EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ |
392 | DISABLE_INTS; \ | 384 | DISABLE_INTS; \ |
385 | bl .ppc64_runlatch_on; \ | ||
393 | addi r3,r1,STACK_FRAME_OVERHEAD; \ | 386 | addi r3,r1,STACK_FRAME_OVERHEAD; \ |
394 | bl hdlr; \ | 387 | bl hdlr; \ |
395 | b .ret_from_except_lite | 388 | b .ret_from_except_lite |
@@ -407,7 +400,6 @@ __start_interrupts: | |||
407 | _machine_check_pSeries: | 400 | _machine_check_pSeries: |
408 | HMT_MEDIUM | 401 | HMT_MEDIUM |
409 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 402 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
410 | RUNLATCH_ON(r13) | ||
411 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) | 403 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) |
412 | 404 | ||
413 | . = 0x300 | 405 | . = 0x300 |
@@ -434,7 +426,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB) | |||
434 | data_access_slb_pSeries: | 426 | data_access_slb_pSeries: |
435 | HMT_MEDIUM | 427 | HMT_MEDIUM |
436 | mtspr SPRN_SPRG1,r13 | 428 | mtspr SPRN_SPRG1,r13 |
437 | RUNLATCH_ON(r13) | ||
438 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ | 429 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ |
439 | std r3,PACA_EXSLB+EX_R3(r13) | 430 | std r3,PACA_EXSLB+EX_R3(r13) |
440 | mfspr r3,SPRN_DAR | 431 | mfspr r3,SPRN_DAR |
@@ -460,7 +451,6 @@ data_access_slb_pSeries: | |||
460 | instruction_access_slb_pSeries: | 451 | instruction_access_slb_pSeries: |
461 | HMT_MEDIUM | 452 | HMT_MEDIUM |
462 | mtspr SPRN_SPRG1,r13 | 453 | mtspr SPRN_SPRG1,r13 |
463 | RUNLATCH_ON(r13) | ||
464 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ | 454 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ |
465 | std r3,PACA_EXSLB+EX_R3(r13) | 455 | std r3,PACA_EXSLB+EX_R3(r13) |
466 | mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ | 456 | mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ |
@@ -491,7 +481,6 @@ instruction_access_slb_pSeries: | |||
491 | .globl system_call_pSeries | 481 | .globl system_call_pSeries |
492 | system_call_pSeries: | 482 | system_call_pSeries: |
493 | HMT_MEDIUM | 483 | HMT_MEDIUM |
494 | RUNLATCH_ON(r9) | ||
495 | mr r9,r13 | 484 | mr r9,r13 |
496 | mfmsr r10 | 485 | mfmsr r10 |
497 | mfspr r13,SPRN_SPRG3 | 486 | mfspr r13,SPRN_SPRG3 |
@@ -575,7 +564,6 @@ slb_miss_user_pseries: | |||
575 | system_reset_fwnmi: | 564 | system_reset_fwnmi: |
576 | HMT_MEDIUM | 565 | HMT_MEDIUM |
577 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 566 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
578 | RUNLATCH_ON(r13) | ||
579 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) | 567 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) |
580 | 568 | ||
581 | .globl machine_check_fwnmi | 569 | .globl machine_check_fwnmi |
@@ -583,7 +571,6 @@ system_reset_fwnmi: | |||
583 | machine_check_fwnmi: | 571 | machine_check_fwnmi: |
584 | HMT_MEDIUM | 572 | HMT_MEDIUM |
585 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 573 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
586 | RUNLATCH_ON(r13) | ||
587 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) | 574 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) |
588 | 575 | ||
589 | #ifdef CONFIG_PPC_ISERIES | 576 | #ifdef CONFIG_PPC_ISERIES |
@@ -858,6 +845,14 @@ fast_exception_return: | |||
858 | ld r11,_NIP(r1) | 845 | ld r11,_NIP(r1) |
859 | andi. r3,r12,MSR_RI /* check if RI is set */ | 846 | andi. r3,r12,MSR_RI /* check if RI is set */ |
860 | 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 | |||
861 | ld r3,_CCR(r1) | 856 | ld r3,_CCR(r1) |
862 | ld r4,_LINK(r1) | 857 | ld r4,_LINK(r1) |
863 | ld r5,_CTR(r1) | 858 | ld r5,_CTR(r1) |
@@ -894,7 +889,6 @@ unrecov_fer: | |||
894 | .align 7 | 889 | .align 7 |
895 | .globl data_access_common | 890 | .globl data_access_common |
896 | data_access_common: | 891 | data_access_common: |
897 | RUNLATCH_ON(r10) /* It wont fit in the 0x300 handler */ | ||
898 | mfspr r10,SPRN_DAR | 892 | mfspr r10,SPRN_DAR |
899 | std r10,PACA_EXGEN+EX_DAR(r13) | 893 | std r10,PACA_EXGEN+EX_DAR(r13) |
900 | mfspr r10,SPRN_DSISR | 894 | mfspr r10,SPRN_DSISR |
@@ -1042,6 +1036,7 @@ hardware_interrupt_common: | |||
1042 | EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) | 1036 | EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) |
1043 | hardware_interrupt_entry: | 1037 | hardware_interrupt_entry: |
1044 | DISABLE_INTS | 1038 | DISABLE_INTS |
1039 | bl .ppc64_runlatch_on | ||
1045 | addi r3,r1,STACK_FRAME_OVERHEAD | 1040 | addi r3,r1,STACK_FRAME_OVERHEAD |
1046 | bl .do_IRQ | 1041 | bl .do_IRQ |
1047 | b .ret_from_except_lite | 1042 | b .ret_from_except_lite |
@@ -1816,22 +1811,6 @@ _STATIC(start_here_multiplatform) | |||
1816 | ori r6,r6,MSR_RI | 1811 | ori r6,r6,MSR_RI |
1817 | mtmsrd r6 /* RI on */ | 1812 | mtmsrd r6 /* RI on */ |
1818 | 1813 | ||
1819 | #ifdef CONFIG_HMT | ||
1820 | /* Start up the second thread on cpu 0 */ | ||
1821 | mfspr r3,SPRN_PVR | ||
1822 | srwi r3,r3,16 | ||
1823 | cmpwi r3,0x34 /* Pulsar */ | ||
1824 | beq 90f | ||
1825 | cmpwi r3,0x36 /* Icestar */ | ||
1826 | beq 90f | ||
1827 | cmpwi r3,0x37 /* SStar */ | ||
1828 | beq 90f | ||
1829 | b 91f /* HMT not supported */ | ||
1830 | 90: li r3,0 | ||
1831 | bl .hmt_start_secondary | ||
1832 | 91: | ||
1833 | #endif | ||
1834 | |||
1835 | /* The following gets the stack and TOC set up with the regs */ | 1814 | /* The following gets the stack and TOC set up with the regs */ |
1836 | /* pointing to the real addr of the kernel stack. This is */ | 1815 | /* pointing to the real addr of the kernel stack. This is */ |
1837 | /* all done to support the C function call below which sets */ | 1816 | /* all done to support the C function call below which sets */ |
@@ -1945,77 +1924,8 @@ _STATIC(start_here_common) | |||
1945 | 1924 | ||
1946 | bl .start_kernel | 1925 | bl .start_kernel |
1947 | 1926 | ||
1948 | _GLOBAL(hmt_init) | 1927 | /* Not reached */ |
1949 | #ifdef CONFIG_HMT | 1928 | BUG_OPCODE |
1950 | LOAD_REG_IMMEDIATE(r5, hmt_thread_data) | ||
1951 | mfspr r7,SPRN_PVR | ||
1952 | srwi r7,r7,16 | ||
1953 | cmpwi r7,0x34 /* Pulsar */ | ||
1954 | beq 90f | ||
1955 | cmpwi r7,0x36 /* Icestar */ | ||
1956 | beq 91f | ||
1957 | cmpwi r7,0x37 /* SStar */ | ||
1958 | beq 91f | ||
1959 | b 101f | ||
1960 | 90: mfspr r6,SPRN_PIR | ||
1961 | andi. r6,r6,0x1f | ||
1962 | b 92f | ||
1963 | 91: mfspr r6,SPRN_PIR | ||
1964 | andi. r6,r6,0x3ff | ||
1965 | 92: sldi r4,r24,3 | ||
1966 | stwx r6,r5,r4 | ||
1967 | bl .hmt_start_secondary | ||
1968 | b 101f | ||
1969 | |||
1970 | __hmt_secondary_hold: | ||
1971 | LOAD_REG_IMMEDIATE(r5, hmt_thread_data) | ||
1972 | clrldi r5,r5,4 | ||
1973 | li r7,0 | ||
1974 | mfspr r6,SPRN_PIR | ||
1975 | mfspr r8,SPRN_PVR | ||
1976 | srwi r8,r8,16 | ||
1977 | cmpwi r8,0x34 | ||
1978 | bne 93f | ||
1979 | andi. r6,r6,0x1f | ||
1980 | b 103f | ||
1981 | 93: andi. r6,r6,0x3f | ||
1982 | |||
1983 | 103: lwzx r8,r5,r7 | ||
1984 | cmpw r8,r6 | ||
1985 | beq 104f | ||
1986 | addi r7,r7,8 | ||
1987 | b 103b | ||
1988 | |||
1989 | 104: addi r7,r7,4 | ||
1990 | lwzx r9,r5,r7 | ||
1991 | mr r24,r9 | ||
1992 | 101: | ||
1993 | #endif | ||
1994 | mr r3,r24 | ||
1995 | b .pSeries_secondary_smp_init | ||
1996 | |||
1997 | #ifdef CONFIG_HMT | ||
1998 | _GLOBAL(hmt_start_secondary) | ||
1999 | LOAD_REG_IMMEDIATE(r4,__hmt_secondary_hold) | ||
2000 | clrldi r4,r4,4 | ||
2001 | mtspr SPRN_NIADORM, r4 | ||
2002 | mfspr r4, SPRN_MSRDORM | ||
2003 | li r5, -65 | ||
2004 | and r4, r4, r5 | ||
2005 | mtspr SPRN_MSRDORM, r4 | ||
2006 | lis r4,0xffef | ||
2007 | ori r4,r4,0x7403 | ||
2008 | mtspr SPRN_TSC, r4 | ||
2009 | li r4,0x1f4 | ||
2010 | mtspr SPRN_TST, r4 | ||
2011 | mfspr r4, SPRN_HID0 | ||
2012 | ori r4, r4, 0x1 | ||
2013 | mtspr SPRN_HID0, r4 | ||
2014 | mfspr r4, SPRN_CTRLF | ||
2015 | oris r4, r4, 0x40 | ||
2016 | mtspr SPRN_CTRLT, r4 | ||
2017 | blr | ||
2018 | #endif | ||
2019 | 1929 | ||
2020 | /* | 1930 | /* |
2021 | * We put a few things here that have to be page-aligned. | 1931 | * We put a few things here that have to be page-aligned. |