Date: Tue, 24 Apr 2001 14:06:53 -0700 (PDT) From: John Baldwin <jhb@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/alpha/alpha exception.s genassym.c interrupt.c machdep.c trap.c src/sys/alpha/include proc.h Message-ID: <200104242106.f3OL6rZ03237@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
jhb 2001/04/24 14:06:53 PDT Modified files: sys/alpha/alpha exception.s genassym.c interrupt.c machdep.c trap.c sys/alpha/include proc.h Log: 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. Revision Changes Path 1.10 +32 -15 src/sys/alpha/alpha/exception.s 1.29 +4 -1 src/sys/alpha/alpha/genassym.c 1.48 +11 -1 src/sys/alpha/alpha/interrupt.c 1.125 +4 -1 src/sys/alpha/alpha/machdep.c 1.57 +23 -3 src/sys/alpha/alpha/trap.c 1.10 +2 -1 src/sys/alpha/include/proc.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104242106.f3OL6rZ03237>