summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-04-24 21:06:53 +0000
committerjhb <jhb@FreeBSD.org>2001-04-24 21:06:53 +0000
commit7f17e1a5d9fcd3c26f189f4b66bfa38bce98f1a2 (patch)
treeab324811176a4122ecd43e5e854ca8ceccd25184 /sys/powerpc
parent2d5016b9030b8d30fe7da34abe818822947c208f (diff)
downloadFreeBSD-src-7f17e1a5d9fcd3c26f189f4b66bfa38bce98f1a2.zip
FreeBSD-src-7f17e1a5d9fcd3c26f189f4b66bfa38bce98f1a2.tar.gz
Add a new field 'md_kernnest' to the alpha machine dependent process
structure. This field keeps track of how many levels deep we are nested into the kernel. The nesting level is bumped at the start of a trap, interrupt, syscall, or exception and is decremented on return. This is used to detect the case when the kernel is returning back to a kernel context in exception_return(). If we are returning to the kernel we need to update the globaldata pointer register saved in the stack frame in case we have switched CPU's between taking the initial interrupt that saved the frame and returning. If we don't do this fixup it is possible for a CPU to use the wrong per-cpu data. On UP systems this is not a problem, so the code is conditional on SMP. A count was used instead of simply checking the process status register in the frame during exception_return() since there are critical sections at the very start and end of a trap, exception, or interrupt from userland in which we could trash the t7 register being used in userland. The counter is incremented after adn before these critical sections respectively so that we will not overwrite the saved t7 register if we are interrupted during one of these critical sections.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/powerpc/genassym.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/powerpc/powerpc/genassym.c b/sys/powerpc/powerpc/genassym.c
index 5104654..03990ea 100644
--- a/sys/powerpc/powerpc/genassym.c
+++ b/sys/powerpc/powerpc/genassym.c
@@ -84,6 +84,9 @@ ASSYM(P_ADDR, offsetof(struct proc, p_addr));
ASSYM(P_MD_FLAGS, offsetof(struct proc, p_md.md_flags));
ASSYM(P_MD_PCBPADDR, offsetof(struct proc, p_md.md_pcbpaddr));
ASSYM(P_MD_HAE, offsetof(struct proc, p_md.md_hae));
+#ifdef SMP
+ASSYM(P_MD_KERNNEST, offsetof(struct proc, p_md.md_kernnest));
+#endif
ASSYM(MDP_HAEUSED, MDP_HAEUSED);
ASSYM(CHIPSET_WRITE_HAE, offsetof(struct alpha_chipset, write_hae));
OpenPOWER on IntegriCloud