Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/powerpc Some preliminary ALTIVEC support.



details:   https://anonhg.NetBSD.org/src/rev/95816a1682f1
branches:  trunk
changeset: 499630:95816a1682f1
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Nov 25 02:59:34 2000 +0000

description:
Some preliminary ALTIVEC support.

diffstat:

 sys/arch/powerpc/powerpc/vm_machdep.c |  33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diffs (68 lines):

diff -r b091bd8714af -r 95816a1682f1 sys/arch/powerpc/powerpc/vm_machdep.c
--- a/sys/arch/powerpc/powerpc/vm_machdep.c     Sat Nov 25 02:39:34 2000 +0000
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c     Sat Nov 25 02:59:34 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.21 2000/08/21 18:46:04 tsubai Exp $   */
+/*     $NetBSD: vm_machdep.c,v 1.22 2000/11/25 02:59:34 matt Exp $     */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -30,6 +30,7 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+#include "opt_altivec.h"
 
 #include <sys/param.h>
 #include <sys/core.h>
@@ -87,6 +88,14 @@
        if (p1 == fpuproc)
                save_fpu(p1);
        *pcb = p1->p_addr->u_pcb;
+#ifdef ALTIVEC
+       if (p1->p1_addr->u_pcb.pcb_vr != NULL) {
+               if (p1 == vecproc)
+                       save_vec(p1);
+               pcb->pcb_vr = pool_get(vecpl, POOL_WAITOK);
+               *pcb->pcb_vr = *p1->p1_addr->u_ucb.pcb_vr;
+       }
+#endif
 
        pcb->pcb_pm = p2->p_vmspace->vm_map.pmap;
        (void) pmap_extract(pmap_kernel(), (vaddr_t)pcb->pcb_pm,
@@ -177,8 +186,17 @@
 cpu_exit(p)
        struct proc *p;
 {
-       if (p == fpuproc)       /* release the fpu */
-               fpuproc = 0;
+#ifdef ALTIVEC
+       struct pcb *pcb = &p->p_addr->u_pcb;
+#endif
+       if (p == fpuproc)       /* release the FPU */
+               fpuproc = NULL;
+#ifdef ALTIVEC
+       if (p == vecproc)       /* release the AltiVEC */
+               vecproc = NULL;
+       if (pcb->pcb_vr != NULL)
+               pool_put(vecpl, pcb->pcb_vr);
+#endif
 
        splsched();
        switchexit(p);
@@ -214,6 +232,15 @@
        } else
                bzero(&md_core.fpstate, sizeof(md_core.fpstate));
 
+#ifdef ALTIVEC
+       if (pcb->pcb_flags & PCB_ALTIVEC) {
+               if (p == vecproc)
+                       save_vec(p);
+               md_core.vstate = *pcb->pcb_vr;
+       } else
+#endif
+               bzero(&md_core.vstate, sizeof(md_core.vstate));
+
        CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
        cseg.c_addr = 0;
        cseg.c_size = chdr->c_cpusize;



Home | Main Index | Thread Index | Old Index