Module Name: src Committed By: matt Date: Tue Jun 21 06:32:36 UTC 2011
Modified Files: src/sys/arch/powerpc/include: cpu.h src/sys/arch/powerpc/powerpc: powerpc_machdep.c Log Message: Add a common cpu_ast(l, ci) routine. Add a ci_pmap_asid_cur for BOOKE debugging. To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/arch/powerpc/include/cpu.h cvs rdiff -u -r1.56 -r1.57 src/sys/arch/powerpc/powerpc/powerpc_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/powerpc/include/cpu.h diff -u src/sys/arch/powerpc/include/cpu.h:1.85 src/sys/arch/powerpc/include/cpu.h:1.86 --- src/sys/arch/powerpc/include/cpu.h:1.85 Tue Jun 21 04:21:17 2011 +++ src/sys/arch/powerpc/include/cpu.h Tue Jun 21 06:32:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.85 2011/06/21 04:21:17 matt Exp $ */ +/* $NetBSD: cpu.h,v 1.86 2011/06/21 06:32:36 matt Exp $ */ /* * Copyright (C) 1999 Wolfgang Solfrank. @@ -113,6 +113,7 @@ #define CPUSAVE_SRR1 7 /* where SRR1 gets saved */ register_t ci_savearea[CPUSAVE_SIZE]; #if defined(PPC_BOOKE) || defined(MODULAR) || defined(_MODULE) + uint32_t ci_pmap_asid_cur; struct pmap_segtab *ci_pmap_segtabs[2]; #define ci_pmap_kern_segtab ci_pmap_segtabs[0] #define ci_pmap_user_segtab ci_pmap_segtabs[1] @@ -370,6 +371,7 @@ vaddr_t cpu_lwp_pc(struct lwp *); +void cpu_ast(struct lwp *, struct cpu_info *); void * cpu_uarea_alloc(bool); bool cpu_uarea_free(void *); void cpu_need_resched(struct cpu_info *, int); Index: src/sys/arch/powerpc/powerpc/powerpc_machdep.c diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.56 src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.57 --- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.56 Mon Jun 20 08:47:13 2011 +++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c Tue Jun 21 06:32:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: powerpc_machdep.c,v 1.56 2011/06/20 08:47:13 matt Exp $ */ +/* $NetBSD: powerpc_machdep.c,v 1.57 2011/06/21 06:32:36 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.56 2011/06/20 08:47:13 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.57 2011/06/21 06:32:36 matt Exp $"); #include "opt_altivec.h" #include "opt_modular.h" @@ -68,6 +68,10 @@ #include <powerpc/altivec.h> #endif +#ifdef MULTIPROCESOR +#include <powerpc/pic/ipivar.h> +#endif + int cpu_timebase; int cpu_printfataltraps = 1; #if !defined(PPC_IBM4XX) @@ -367,6 +371,22 @@ } void +cpu_ast(struct lwp *l, struct cpu_info *ci) +{ + l->l_md.md_astpending = 0; /* we are about to do it */ + + if (l->l_pflag & LP_OWEUPC) { + l->l_pflag &= ~LP_OWEUPC; + ADDUPROF(l); + } + + /* Check whether we are being preempted. */ + if (ci->ci_want_resched) { + preempt(); + } +} + +void cpu_need_resched(struct cpu_info *ci, int flags) { struct lwp * const l = ci->ci_data.cpu_onproc;