misc_64.S (521c180874dae86f675d23c4eade4dba8b1f2cc8) | misc_64.S (e821ea70f3b4873b50056a1e0f74befed1014c09) |
---|---|
1/* 2 * This file contains miscellaneous low-level functions. 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 4 * 5 * Largely rewritten by Cort Dougan (cort@cs.nmt.edu) 6 * and Paul Mackerras. 7 * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com) 8 * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com) --- 443 unchanged lines hidden (view full) --- 452_GLOBAL(disable_kernel_fp) 453 mfmsr r3 454 rldicl r0,r3,(63-MSR_FP_LG),1 455 rldicl r3,r0,(MSR_FP_LG+1),0 456 mtmsrd r3 /* disable use of fpu now */ 457 isync 458 blr 459 | 1/* 2 * This file contains miscellaneous low-level functions. 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 4 * 5 * Largely rewritten by Cort Dougan (cort@cs.nmt.edu) 6 * and Paul Mackerras. 7 * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com) 8 * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com) --- 443 unchanged lines hidden (view full) --- 452_GLOBAL(disable_kernel_fp) 453 mfmsr r3 454 rldicl r0,r3,(63-MSR_FP_LG),1 455 rldicl r3,r0,(MSR_FP_LG+1),0 456 mtmsrd r3 /* disable use of fpu now */ 457 isync 458 blr 459 |
460#ifdef CONFIG_ALTIVEC 461 462#if 0 /* this has no callers for now */ 463/* 464 * disable_kernel_altivec() 465 * Disable the VMX. 466 */ 467_GLOBAL(disable_kernel_altivec) 468 mfmsr r3 469 rldicl r0,r3,(63-MSR_VEC_LG),1 470 rldicl r3,r0,(MSR_VEC_LG+1),0 471 mtmsrd r3 /* disable use of VMX now */ 472 isync 473 blr 474#endif /* 0 */ 475 476/* 477 * giveup_altivec(tsk) 478 * Disable VMX for the task given as the argument, 479 * and save the vector registers in its thread_struct. 480 * Enables the VMX for use in the kernel on return. 481 */ 482_GLOBAL(giveup_altivec) 483 mfmsr r5 484 oris r5,r5,MSR_VEC@h 485 mtmsrd r5 /* enable use of VMX now */ 486 isync 487 cmpdi 0,r3,0 488 beqlr- /* if no previous owner, done */ 489 addi r3,r3,THREAD /* want THREAD of task */ 490 ld r5,PT_REGS(r3) 491 cmpdi 0,r5,0 492 SAVE_32VRS(0,r4,r3) 493 mfvscr vr0 494 li r4,THREAD_VSCR 495 stvx vr0,r4,r3 496 beq 1f 497 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5) 498#ifdef CONFIG_VSX 499BEGIN_FTR_SECTION 500 lis r3,(MSR_VEC|MSR_VSX)@h 501FTR_SECTION_ELSE 502 lis r3,MSR_VEC@h 503ALT_FTR_SECTION_END_IFSET(CPU_FTR_VSX) 504#else 505 lis r3,MSR_VEC@h 506#endif 507 andc r4,r4,r3 /* disable FP for previous task */ 508 std r4,_MSR-STACK_FRAME_OVERHEAD(r5) 5091: 510#ifndef CONFIG_SMP 511 li r5,0 512 ld r4,last_task_used_altivec@got(r2) 513 std r5,0(r4) 514#endif /* CONFIG_SMP */ 515 blr 516 517#endif /* CONFIG_ALTIVEC */ 518 519#ifdef CONFIG_VSX 520/* 521 * __giveup_vsx(tsk) 522 * Disable VSX for the task given as the argument. 523 * Does NOT save vsx registers. 524 * Enables the VSX for use in the kernel on return. 525 */ 526_GLOBAL(__giveup_vsx) 527 mfmsr r5 528 oris r5,r5,MSR_VSX@h 529 mtmsrd r5 /* enable use of VSX now */ 530 isync 531 532 cmpdi 0,r3,0 533 beqlr- /* if no previous owner, done */ 534 addi r3,r3,THREAD /* want THREAD of task */ 535 ld r5,PT_REGS(r3) 536 cmpdi 0,r5,0 537 beq 1f 538 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5) 539 lis r3,MSR_VSX@h 540 andc r4,r4,r3 /* disable VSX for previous task */ 541 std r4,_MSR-STACK_FRAME_OVERHEAD(r5) 5421: 543#ifndef CONFIG_SMP 544 li r5,0 545 ld r4,last_task_used_vsx@got(r2) 546 std r5,0(r4) 547#endif /* CONFIG_SMP */ 548 blr 549 550#endif /* CONFIG_VSX */ 551 | |
552/* kexec_wait(phys_cpu) 553 * 554 * wait for the flag to change, indicating this kernel is going away but 555 * the slave code for the next one is at addresses 0 to 100. 556 * 557 * This is used by all slaves. 558 * 559 * Physical (hardware) cpu id should be in r3. --- 162 unchanged lines hidden --- | 460/* kexec_wait(phys_cpu) 461 * 462 * wait for the flag to change, indicating this kernel is going away but 463 * the slave code for the next one is at addresses 0 to 100. 464 * 465 * This is used by all slaves. 466 * 467 * Physical (hardware) cpu id should be in r3. --- 162 unchanged lines hidden --- |