Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/booke/spe.c
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | enable_vec(struct thread *td) | ||||
* Temporarily enable the vector unit so the registers | * Temporarily enable the vector unit so the registers | ||||
* can be restored. | * can be restored. | ||||
*/ | */ | ||||
msr = mfmsr(); | msr = mfmsr(); | ||||
mtmsr(msr | PSL_VEC); | mtmsr(msr | PSL_VEC); | ||||
/* Restore SPEFSCR and ACC. Use %r0 as the scratch for ACC. */ | /* Restore SPEFSCR and ACC. Use %r0 as the scratch for ACC. */ | ||||
mtspr(SPR_SPEFSCR, pcb->pcb_vec.vscr); | mtspr(SPR_SPEFSCR, pcb->pcb_vec.vscr); | ||||
__asm __volatile("evldd 0, 0(%0); evmra 0,0\n" | __asm __volatile("isync;evldd 0, 0(%0); evmra 0,0\n" | ||||
:: "b"(&pcb->pcb_vec.spare[0])); | :: "b"(&pcb->pcb_vec.spare[0])); | ||||
/* | /* | ||||
* The lower half of each register will be restored on trap return. Use | * The lower half of each register will be restored on trap return. Use | ||||
* %r0 as a scratch register, and restore it last. | * %r0 as a scratch register, and restore it last. | ||||
*/ | */ | ||||
#define EVLDW(n) __asm __volatile("evldw 0, 0(%0); evmergehilo "#n",0,"#n \ | #define EVLDW(n) __asm __volatile("evldw 0, 0(%0); evmergehilo "#n",0,"#n \ | ||||
:: "b"(&pcb->pcb_vec.vr[n])); | :: "b"(&pcb->pcb_vec.vr[n])); | ||||
▲ Show 20 Lines • Show All 547 Lines • Show Last 20 Lines |