Subject: CVS commit: src/sys/compat/linux
To: None <source-changes@NetBSD.org>
From: Frank van der Linden <fvdl@netbsd.org>
List: source-changes
Date: 05/20/2005 12:48:27
Module Name:	src
Committed By:	fvdl
Date:		Fri May 20 12:48:27 UTC 2005

Modified Files:
	src/sys/compat/linux/arch/alpha: linux_machdep.c
	src/sys/compat/linux/arch/amd64: linux_exec_machdep.c linux_machdep.c
	    linux_machdep.h
	src/sys/compat/linux/arch/arm: linux_machdep.c
	src/sys/compat/linux/arch/i386: linux_machdep.c
	src/sys/compat/linux/arch/m68k: linux_machdep.c
	src/sys/compat/linux/arch/mips: linux_machdep.c
	src/sys/compat/linux/arch/powerpc: linux_machdep.c
	src/sys/compat/linux/common: linux_exec.c linux_exec.h

Log Message:
Define linux_usertrap function, and set it in struct emul. For all
but amd64, it just returns 0, doing nothing.

For amd64, it implements vsyscalls through cheating: if the faulting
address is in the vsyscall area (which is statically known on Linux/amd64),
and the intruction pointer is too, it must have been a vsyscall. In that
case, retrieve the return address from the user stack, fix up %rip and
%rsp, and just execute the normal system call. It will return as if
the vsyscall has been executed.


To generate a diff of this commit:
cvs rdiff -r1.30 -r1.31 src/sys/compat/linux/arch/alpha/linux_machdep.c
cvs rdiff -r1.1 -r1.2 src/sys/compat/linux/arch/amd64/linux_exec_machdep.c \
    src/sys/compat/linux/arch/amd64/linux_machdep.h
cvs rdiff -r1.3 -r1.4 src/sys/compat/linux/arch/amd64/linux_machdep.c
cvs rdiff -r1.14 -r1.15 src/sys/compat/linux/arch/arm/linux_machdep.c
cvs rdiff -r1.106 -r1.107 src/sys/compat/linux/arch/i386/linux_machdep.c
cvs rdiff -r1.22 -r1.23 src/sys/compat/linux/arch/m68k/linux_machdep.c
cvs rdiff -r1.22 -r1.23 src/sys/compat/linux/arch/mips/linux_machdep.c
cvs rdiff -r1.29 -r1.30 src/sys/compat/linux/arch/powerpc/linux_machdep.c
cvs rdiff -r1.74 -r1.75 src/sys/compat/linux/common/linux_exec.c
cvs rdiff -r1.34 -r1.35 src/sys/compat/linux/common/linux_exec.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.