Date: Mon, 14 Oct 2013 00:56:38 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r256434 - projects/pmac_pmu/sys/powerpc/powermac Message-ID: <201310140056.r9E0ucDW026911@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Mon Oct 14 00:56:38 2013 New Revision: 256434 URL: http://svnweb.freebsd.org/changeset/base/256434 Log: PCPU fputhread and vecthread get reset to NULL when save_fpu()/save_vec() is called. Cache these. Modified: projects/pmac_pmu/sys/powerpc/powermac/pmu.c Modified: projects/pmac_pmu/sys/powerpc/powermac/pmu.c ============================================================================== --- projects/pmac_pmu/sys/powerpc/powermac/pmu.c Sun Oct 13 21:46:08 2013 (r256433) +++ projects/pmac_pmu/sys/powerpc/powermac/pmu.c Mon Oct 14 00:56:38 2013 (r256434) @@ -1129,11 +1129,13 @@ extern void *ap_pcpu; void pmu_sleep_int(void) { + jmp_buf resetjb; u_quad_t timebase; + struct thread *fputd = NULL; + struct thread *vectd = NULL; register_t hid0; register_t msr; register_t saved_msr; - jmp_buf resetjb; ap_pcpu = pcpup; @@ -1143,9 +1145,11 @@ void pmu_sleep_int(void) saved_msr = mfmsr(); timebase = mftb(); flush_disable_caches(); - if (PCPU_GET(fputhread) != NULL) + fputd = PCPU_GET(fputhread); + vectd = PCPU_GET(vecthread); + if (fputd != NULL) save_fpu(PCPU_GET(fputhread)); - if (PCPU_GET(vecthread) != NULL) + if (vectd != NULL) save_vec(PCPU_GET(vecthread)); if (setjmp(resetjb) == 0) { sprgs[0] = mfspr(SPR_SPRG0); @@ -1177,9 +1181,9 @@ void pmu_sleep_int(void) mtspr(SPR_SRR0, srrs[0]); mtspr(SPR_SRR1, srrs[1]); mtmsr(saved_msr); - if (PCPU_GET(fputhread) == curthread) + if (fputd == curthread) enable_fpu(curthread); - if (PCPU_GET(vecthread) == curthread) + if (vectd == curthread) enable_vec(curthread); powerpc_sync(); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310140056.r9E0ucDW026911>