Source-Changes-HG archive

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

[src/nathanw_sa]: src/sys/arch/arm Copy/initialize PMC state in cpu_proc_fork().



details:   https://anonhg.NetBSD.org/src/rev/8ef32d5b1277
branches:  nathanw_sa
changeset: 506645:8ef32d5b1277
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Dec 31 02:37:57 2002 +0000

description:
Copy/initialize PMC state in cpu_proc_fork().

diffstat:

 sys/arch/arm/arm32/vm_machdep.c |  26 ++++++++++++++++----------
 sys/arch/arm/include/cpu.h      |   8 ++++++--
 2 files changed, 22 insertions(+), 12 deletions(-)

diffs (70 lines):

diff -r 0aa44e6a8ad6 -r 8ef32d5b1277 sys/arch/arm/arm32/vm_machdep.c
--- a/sys/arch/arm/arm32/vm_machdep.c   Tue Dec 31 02:29:55 2002 +0000
+++ b/sys/arch/arm/arm32/vm_machdep.c   Tue Dec 31 02:37:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.8.4.12 2002/12/11 05:53:03 thorpej Exp $      */
+/*     $NetBSD: vm_machdep.c,v 1.8.4.13 2002/12/31 02:37:57 thorpej Exp $      */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -86,6 +86,21 @@
  *              the amount of stack used.
  */
 
+void
+cpu_proc_fork(p1, p2)
+       struct proc *p1, *p2;
+{
+
+#if defined(PERFCTRS)
+       if (PMC_ENABLED(p1))
+               pmc_md_fork(p1, p2);
+       else {
+               p2->p_md.pmc_enabled = 0;
+               p2->p_md.pmc_state = NULL;
+       }
+#endif
+}
+
 /*
  * Finish a fork operation, with process p2 nearly set up.
  * Copy and update the pcb and trap frame, making the child ready to run.
@@ -129,15 +144,6 @@
        }
 #endif
 
-#if defined(PERFCTRS)
-       if (PMC_ENABLED(p1))
-               pmc_md_fork(p1, p2);
-       else {
-               p2->p_md.pmc_enabled = 0;
-               p2->p_md.pmc_state = NULL;
-       }
-#endif
-
        /* Copy the pcb */
        *pcb = l1->l_addr->u_pcb;
 
diff -r 0aa44e6a8ad6 -r 8ef32d5b1277 sys/arch/arm/include/cpu.h
--- a/sys/arch/arm/include/cpu.h        Tue Dec 31 02:29:55 2002 +0000
+++ b/sys/arch/arm/include/cpu.h        Tue Dec 31 02:37:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.16.2.12 2002/10/18 02:35:27 nathanw Exp $    */
+/*     $NetBSD: cpu.h,v 1.16.2.13 2002/12/31 02:37:58 thorpej Exp $    */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -218,8 +218,12 @@
 #define        curcpu()        (&cpu_info_store)
 #define cpu_number()   0
 #endif
+
+#ifdef __PROG32
+void   cpu_proc_fork(struct proc *, struct proc *);
+#else
 #define        cpu_proc_fork(p1, p2)
-
+#endif
 
 /*
  * Scheduling glue



Home | Main Index | Thread Index | Old Index