Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc Add a common cpu_ast(l, ci) routine.
details: https://anonhg.NetBSD.org/src/rev/268324723438
branches: trunk
changeset: 766373:268324723438
user: matt <matt%NetBSD.org@localhost>
date: Tue Jun 21 06:32:36 2011 +0000
description:
Add a common cpu_ast(l, ci) routine.
Add a ci_pmap_asid_cur for BOOKE debugging.
diffstat:
sys/arch/powerpc/include/cpu.h | 4 +++-
sys/arch/powerpc/powerpc/powerpc_machdep.c | 24 ++++++++++++++++++++++--
2 files changed, 25 insertions(+), 3 deletions(-)
diffs (77 lines):
diff -r e93f6a9e0bdd -r 268324723438 sys/arch/powerpc/include/cpu.h
--- a/sys/arch/powerpc/include/cpu.h Tue Jun 21 06:25:19 2011 +0000
+++ b/sys/arch/powerpc/include/cpu.h Tue Jun 21 06:32:36 2011 +0000
@@ -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);
diff -r e93f6a9e0bdd -r 268324723438 sys/arch/powerpc/powerpc/powerpc_machdep.c
--- a/sys/arch/powerpc/powerpc/powerpc_machdep.c Tue Jun 21 06:25:19 2011 +0000
+++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c Tue Jun 21 06:32:36 2011 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index