From owner-svn-src-all@FreeBSD.ORG Fri Dec 30 20:35:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 741EF106564A; Fri, 30 Dec 2011 20:35:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611108FC08; Fri, 30 Dec 2011 20:35:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBUKZEhn029366; Fri, 30 Dec 2011 20:35:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBUKZErK029359; Fri, 30 Dec 2011 20:35:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201112302035.pBUKZErK029359@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 30 Dec 2011 20:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229023 - in stable/9/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 20:35:14 -0000 Author: kib Date: Fri Dec 30 20:35:13 2011 New Revision: 229023 URL: http://svn.freebsd.org/changeset/base/229023 Log: MFC r227399: Attempt to improve formatting and content of several comments for amd64 and i386 MD code. Modified: stable/9/sys/amd64/amd64/trap.c stable/9/sys/amd64/include/signal.h stable/9/sys/amd64/include/ucontext.h stable/9/sys/i386/i386/trap.c stable/9/sys/i386/include/signal.h stable/9/sys/i386/include/ucontext.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Fri Dec 30 20:24:52 2011 (r229022) +++ stable/9/sys/amd64/amd64/trap.c Fri Dec 30 20:35:13 2011 (r229023) @@ -900,9 +900,9 @@ cpu_fetch_syscall_args(struct thread *td #include "../../kern/subr_syscall.c" /* - * syscall - system call request C handler - * - * A system call is essentially treated as a trap. + * System call handler for native binaries. The trap frame is already + * set up by the assembler trampoline and a pointer to it is saved in + * td_frame. */ void amd64_syscall(struct thread *td, int traced) Modified: stable/9/sys/amd64/include/signal.h ============================================================================== --- stable/9/sys/amd64/include/signal.h Fri Dec 30 20:24:52 2011 (r229022) +++ stable/9/sys/amd64/include/signal.h Fri Dec 30 20:35:13 2011 (r229023) @@ -47,18 +47,14 @@ typedef long sig_atomic_t; #include /* codes for SIGILL, SIGFPE */ /* - * Only the kernel should need these old type definitions. - */ -/* * Information pushed on stack when a signal is delivered. * This is used by the kernel to restore state following * execution of the signal handler. It is also made available * to the handler to allow it to restore state properly if * a non-standard exit is performed. - */ -/* - * The sequence of the fields/registers in struct sigcontext should match - * those in mcontext_t. + * + * The sequence of the fields/registers after sc_mask in struct + * sigcontext must match those in mcontext_t and struct trapframe. */ struct sigcontext { struct __sigset sc_mask; /* signal mask to restore */ @@ -93,8 +89,8 @@ struct sigcontext { long sc_ss; long sc_len; /* sizeof(mcontext_t) */ /* - * XXX - See and for - * the following fields. + * See and for the following + * fields. */ long sc_fpformat; long sc_ownedfp; Modified: stable/9/sys/amd64/include/ucontext.h ============================================================================== --- stable/9/sys/amd64/include/ucontext.h Fri Dec 30 20:24:52 2011 (r229022) +++ stable/9/sys/amd64/include/ucontext.h Fri Dec 30 20:35:13 2011 (r229023) @@ -41,12 +41,13 @@ typedef struct __mcontext { /* - * The first 24 fields must match the definition of - * sigcontext. So that we can support sigcontext - * and ucontext_t at the same time. + * The definition of mcontext_t must match the layout of + * struct sigcontext after the sc_mask member. This is so + * that we can support sigcontext and ucontext_t at the same + * time. */ - __register_t mc_onstack; /* XXX - sigcontext compat. */ - __register_t mc_rdi; /* machine state (struct trapframe) */ + __register_t mc_onstack; /* XXX - sigcontext compat. */ + __register_t mc_rdi; /* machine state (struct trapframe) */ __register_t mc_rsi; __register_t mc_rdx; __register_t mc_rcx; Modified: stable/9/sys/i386/i386/trap.c ============================================================================== --- stable/9/sys/i386/i386/trap.c Fri Dec 30 20:24:52 2011 (r229022) +++ stable/9/sys/i386/i386/trap.c Fri Dec 30 20:35:13 2011 (r229023) @@ -1065,9 +1065,8 @@ cpu_fetch_syscall_args(struct thread *td #include "../../kern/subr_syscall.c" /* - * syscall - system call request C handler - * - * A system call is essentially treated as a trap. + * syscall - system call request C handler. A system call is + * essentially treated as a trap by reusing the frame layout. */ void syscall(struct trapframe *frame) Modified: stable/9/sys/i386/include/signal.h ============================================================================== --- stable/9/sys/i386/include/signal.h Fri Dec 30 20:24:52 2011 (r229022) +++ stable/9/sys/i386/include/signal.h Fri Dec 30 20:35:13 2011 (r229023) @@ -46,16 +46,17 @@ typedef int sig_atomic_t; #include /* codes for SIGILL, SIGFPE */ /* - * Only the kernel should need these old type definitions. - */ -#if defined(_KERNEL) && defined(COMPAT_43) -/* * Information pushed on stack when a signal is delivered. * This is used by the kernel to restore state following * execution of the signal handler. It is also made available * to the handler to allow it to restore state properly if * a non-standard exit is performed. */ + +#if defined(_KERNEL) && defined(COMPAT_43) +/* + * Only the kernel should need these old type definitions. + */ struct osigcontext { int sc_onstack; /* sigstack state to restore */ osigset_t sc_mask; /* signal mask to restore */ @@ -83,7 +84,7 @@ struct osigcontext { /* * The sequence of the fields/registers in struct sigcontext should match - * those in mcontext_t. + * those in mcontext_t and struct trapframe. */ struct sigcontext { struct __sigset sc_mask; /* signal mask to restore */ @@ -109,8 +110,8 @@ struct sigcontext { int sc_ss; int sc_len; /* sizeof(mcontext_t) */ /* - * XXX - See and for - * the following fields. + * See and for + * the following fields. */ int sc_fpformat; int sc_ownedfp; Modified: stable/9/sys/i386/include/ucontext.h ============================================================================== --- stable/9/sys/i386/include/ucontext.h Fri Dec 30 20:24:52 2011 (r229022) +++ stable/9/sys/i386/include/ucontext.h Fri Dec 30 20:35:13 2011 (r229023) @@ -33,9 +33,9 @@ typedef struct __mcontext { /* - * The first 20 fields must match the definition of - * sigcontext. So that we can support sigcontext - * and ucontext_t at the same time. + * The definition of mcontext_t shall match the layout of + * struct sigcontext after the sc_mask member. So that we can + * support sigcontext and ucontext_t at the same time. */ __register_t mc_onstack; /* XXX - sigcontext compat. */ __register_t mc_gs; /* machine state (struct trapframe) */