Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Aug 2018 00:41:03 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337024 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux
Message-ID:  <201808010041.w710f3Cg060489@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Aug  1 00:41:02 2018
New Revision: 337024
URL: https://svnweb.freebsd.org/changeset/base/337024

Log:
  MFC 330823,332335: Cosmetic cleanups to some Linuxulator files.
  
  330823:
  Apply some style(9) to Linuxulator linux_sysvec.c comments
  
  332335:
  linuxulator: add else case braces to reduce diffs between archs

Modified:
  stable/11/sys/amd64/linux/linux_sysvec.c
  stable/11/sys/amd64/linux32/linux32_sysvec.c
  stable/11/sys/i386/linux/linux_sysvec.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/linux/linux_sysvec.c
==============================================================================
--- stable/11/sys/amd64/linux/linux_sysvec.c	Wed Aug  1 00:39:21 2018	(r337023)
+++ stable/11/sys/amd64/linux/linux_sysvec.c	Wed Aug  1 00:41:02 2018	(r337024)
@@ -101,10 +101,9 @@ SYSCTL_PROC(_compat_linux, OID_AUTO, debug,
 #endif
 
 /*
- * Allow the this functions to use the ldebug() facility
- * even though they are not syscalls themselves. Map them
- * to syscall 0. This is slightly less bogus than using
- * ldebug(sigreturn).
+ * Allow the sendsig functions to use the ldebug() facility even though they
+ * are not syscalls themselves.  Map them to syscall 0.  This is slightly less
+ * bogus than using ldebug(sigreturn).
  */
 #define	LINUX_SYS_linux_rt_sendsig	0
 
@@ -253,8 +252,7 @@ linux_set_syscall_retval(struct thread *td, int error)
 
 	/*
 	 * On Linux only %rcx and %r11 values are not preserved across
-	 * the syscall.
-	 * So, do not clobber %rdx and %r10
+	 * the syscall.  So, do not clobber %rdx and %r10.
 	 */
 	td->td_retval[1] = frame->tf_rdx;
 	if (error != EJUSTRETURN)
@@ -336,9 +334,7 @@ linux_copyout_strings(struct image_params *imgp)
 	size_t execpath_len;
 	struct proc *p;
 
-	/*
-	 * Calculate string base and vector table pointers.
-	 */
+	/* Calculate string base and vector table pointers. */
 	if (imgp->execpath != NULL && imgp->auxargs != NULL)
 		execpath_len = strlen(imgp->execpath) + 1;
 	else
@@ -346,7 +342,7 @@ linux_copyout_strings(struct image_params *imgp)
 
 	p = imgp->proc;
 	arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
-	destp =	(caddr_t)arginfo - SPARE_USRSPACE -
+	destp = (caddr_t)arginfo - SPARE_USRSPACE -
 	    roundup(sizeof(canary), sizeof(char *)) -
 	    roundup(execpath_len, sizeof(char *)) -
 	    roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *));
@@ -356,19 +352,14 @@ linux_copyout_strings(struct image_params *imgp)
 		copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len);
 	}
 
-	/*
-	 * Prepare the canary for SSP.
-	 */
+	/* Prepare the canary for SSP. */
 	arc4rand(canary, sizeof(canary), 0);
 	imgp->canary = (uintptr_t)arginfo -
 	    roundup(execpath_len, sizeof(char *)) -
 	    roundup(sizeof(canary), sizeof(char *));
 	copyout(canary, (void *)imgp->canary, sizeof(canary));
 
-	/*
-	 * If we have a valid auxargs ptr, prepare some room
-	 * on the stack.
-	 */
+	/* If we have a valid auxargs ptr, prepare some room on the stack. */
 	if (imgp->auxargs) {
 		/*
 		 * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
@@ -394,29 +385,21 @@ linux_copyout_strings(struct image_params *imgp)
 		    imgp->args->envc + 2) * sizeof(char *));
 	}
 
-	/*
-	 * vectp also becomes our initial stack base
-	 */
+	/* vectp also becomes our initial stack base. */
 	stack_base = (register_t *)vectp;
 
 	stringp = imgp->args->begin_argv;
 	argc = imgp->args->argc;
 	envc = imgp->args->envc;
 
-	/*
-	 * Copy out strings - arguments and environment.
-	 */
+	/* Copy out strings - arguments and environment. */
 	copyout(stringp, destp, ARG_MAX - imgp->args->stringspace);
 
-	/*
-	 * Fill in "ps_strings" struct for ps, w, etc.
-	 */
+	/* Fill in "ps_strings" struct for ps, w, etc. */
 	suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp);
 	suword(&arginfo->ps_nargvstr, argc);
 
-	/*
-	 * Fill in argument portion of vector table.
-	 */
+	/* Fill in argument portion of vector table. */
 	for (; argc > 0; --argc) {
 		suword(vectp++, (long)(intptr_t)destp);
 		while (*stringp++ != 0)
@@ -424,15 +407,13 @@ linux_copyout_strings(struct image_params *imgp)
 		destp++;
 	}
 
-	/* a null vector table pointer separates the argp's from the envp's */
+	/* A null vector table pointer separates the argp's from the envp's. */
 	suword(vectp++, 0);
 
 	suword(&arginfo->ps_envstr, (long)(intptr_t)vectp);
 	suword(&arginfo->ps_nenvstr, envc);
 
-	/*
-	 * Fill in environment portion of vector table.
-	 */
+	/* Fill in environment portion of vector table. */
 	for (; envc > 0; --envc) {
 		suword(vectp++, (long)(intptr_t)destp);
 		while (*stringp++ != 0)
@@ -440,7 +421,7 @@ linux_copyout_strings(struct image_params *imgp)
 		destp++;
 	}
 
-	/* end of vector table is a null pointer */
+	/* The end of the vector table is a null pointer. */
 	suword(vectp, 0);
 	return (stack_base);
 }
@@ -685,12 +666,10 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 	regs->tf_rdx = (register_t)&sfp->sf_sc;	/* arg 3 in %rdx */
 
 	sf.sf_handler = catcher;
-	/* Fill in POSIX parts */
+	/* Fill in POSIX parts. */
 	ksiginfo_to_lsiginfo(ksi, &sf.sf_si, sig);
 
-	/*
-	 * Copy the sigframe out to the user's stack.
-	 */
+	/* Copy the sigframe out to the user's stack. */
 	if (copyout(&sf, sfp, sizeof(*sfp)) != 0) {
 #ifdef DEBUG
 		printf("process %ld has trashed its stack\n", (long)p->p_pid);
@@ -766,7 +745,7 @@ linux_vsyscall(struct thread *td)
 
 	frame = td->td_frame;
 
-	/* Check %rip for vsyscall area */
+	/* Check %rip for vsyscall area. */
 	if (__predict_true(frame->tf_rip < LINUX_VSYSCALL_START))
 		return (EINVAL);
 	if ((frame->tf_rip & (LINUX_VSYSCALL_SZ - 1)) != 0)
@@ -777,7 +756,7 @@ linux_vsyscall(struct thread *td)
 
 	/*
 	 * vsyscall called as callq *(%rax), so we must
-	 * use return address from %rsp and also fixup %rsp
+	 * use return address from %rsp and also fixup %rsp.
 	 */
 	error = copyin((void *)frame->tf_rsp, &retqaddr, sizeof(retqaddr));
 	if (error)

Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/11/sys/amd64/linux32/linux32_sysvec.c	Wed Aug  1 00:39:21 2018	(r337023)
+++ stable/11/sys/amd64/linux32/linux32_sysvec.c	Wed Aug  1 00:41:02 2018	(r337024)
@@ -100,10 +100,9 @@ MODULE_VERSION(linux, 1);
 #endif
 
 /*
- * Allow the sendsig functions to use the ldebug() facility
- * even though they are not syscalls themselves. Map them
- * to syscall 0. This is slightly less bogus than using
- * ldebug(sigreturn).
+ * Allow the sendsig functions to use the ldebug() facility even though they
+ * are not syscalls themselves.  Map them to syscall 0.  This is slightly less
+ * bogus than using ldebug(sigreturn).
  */
 #define	LINUX32_SYS_linux_rt_sendsig	0
 #define	LINUX32_SYS_linux_sendsig	0
@@ -310,9 +309,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 		printf(ARGS(rt_sendsig, "%p, %d, %p, %u"),
 		    catcher, sig, (void*)mask, code);
 #endif
-	/*
-	 * Allocate space for the signal handler context.
-	 */
+	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
 	    SIGISMEMBER(psp->ps_sigonstack, sig)) {
 		fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
@@ -321,9 +318,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 		fp = (struct l_rt_sigframe *)regs->tf_rsp - 1;
 	mtx_unlock(&psp->ps_mtx);
 
-	/*
-	 * Build the argument list for the signal handler.
-	 */
+	/* Build the argument list for the signal handler. */
 	sig = bsd_to_linux_signal(sig);
 
 	bzero(&frame, sizeof(frame));
@@ -333,12 +328,11 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 	frame.sf_siginfo = PTROUT(&fp->sf_si);
 	frame.sf_ucontext = PTROUT(&fp->sf_sc);
 
-	/* Fill in POSIX parts */
+	/* Fill in POSIX parts. */
 	ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig);
 
 	/*
-	 * Build the signal context to be used by sigreturn
-	 * and libgcc unwind.
+	 * Build the signal context to be used by sigreturn and libgcc unwind.
 	 */
 	frame.sf_sc.uc_flags = 0;		/* XXX ??? */
 	frame.sf_sc.uc_link = 0;		/* XXX ??? */
@@ -394,9 +388,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 		sigexit(td, SIGILL);
 	}
 
-	/*
-	 * Build context to run handler in.
-	 */
+	/* Build context to run handler in. */
 	regs->tf_rsp = PTROUT(fp);
 	regs->tf_rip = linux32_rt_sigcode;
 	regs->tf_rflags &= ~(PSL_T | PSL_D);
@@ -455,9 +447,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t
 		    catcher, sig, (void*)mask, code);
 #endif
 
-	/*
-	 * Allocate space for the signal handler context.
-	 */
+	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
 	    SIGISMEMBER(psp->ps_sigonstack, sig)) {
 		fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
@@ -467,9 +457,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t
 	mtx_unlock(&psp->ps_mtx);
 	PROC_UNLOCK(p);
 
-	/*
-	 * Build the argument list for the signal handler.
-	 */
+	/* Build the argument list for the signal handler. */
 	sig = bsd_to_linux_signal(sig);
 
 	bzero(&frame, sizeof(frame));
@@ -479,9 +467,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t
 
 	bsd_to_linux_sigset(mask, &lmask);
 
-	/*
-	 * Build the signal context to be used by sigreturn.
-	 */
+	/* Build the signal context to be used by sigreturn. */
 	frame.sf_sc.sc_mask   = lmask.__mask;
 	frame.sf_sc.sc_gs     = regs->tf_gs;
 	frame.sf_sc.sc_fs     = regs->tf_fs;
@@ -515,9 +501,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t
 		sigexit(td, SIGILL);
 	}
 
-	/*
-	 * Build context to run handler in.
-	 */
+	/* Build context to run handler in. */
 	regs->tf_rsp = PTROUT(fp);
 	regs->tf_rip = linux32_sigcode;
 	regs->tf_rflags &= ~(PSL_T | PSL_D);
@@ -567,9 +551,7 @@ linux_sigreturn(struct thread *td, struct linux_sigret
 	if (copyin(args->sfp, &frame, sizeof(frame)) != 0)
 		return (EFAULT);
 
-	/*
-	 * Check for security violations.
-	 */
+	/* Check for security violations. */
 #define	EFLAGS_SECURE(ef, oef)	((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
 	eflags = frame.sf_sc.sc_eflags;
 	if (!EFLAGS_SECURE(eflags, regs->tf_rflags))
@@ -596,9 +578,7 @@ linux_sigreturn(struct thread *td, struct linux_sigret
 	linux_to_bsd_sigset(&lmask, &bmask);
 	kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0);
 
-	/*
-	 * Restore signal context.
-	 */
+	/* Restore signal context. */
 	regs->tf_rdi    = frame.sf_sc.sc_edi;
 	regs->tf_rsi    = frame.sf_sc.sc_esi;
 	regs->tf_rbp    = frame.sf_sc.sc_ebp;
@@ -658,9 +638,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_
 
 	context = &uc.uc_mcontext;
 
-	/*
-	 * Check for security violations.
-	 */
+	/* Check for security violations. */
 #define	EFLAGS_SECURE(ef, oef)	((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
 	eflags = context->sc_eflags;
 	if (!EFLAGS_SECURE(eflags, regs->tf_rflags))
@@ -852,9 +830,7 @@ linux_copyout_strings(struct image_params *imgp)
 	char canary[LINUX_AT_RANDOM_LEN];
 	size_t execpath_len;
 
-	/*
-	 * Calculate string base and vector table pointers.
-	 */
+	/* Calculate string base and vector table pointers. */
 	if (imgp->execpath != NULL && imgp->auxargs != NULL)
 		execpath_len = strlen(imgp->execpath) + 1;
 	else
@@ -871,19 +847,14 @@ linux_copyout_strings(struct image_params *imgp)
 		copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len);
 	}
 
-	/*
-	 * Prepare the canary for SSP.
-	 */
+	/* Prepare the canary for SSP. */
 	arc4rand(canary, sizeof(canary), 0);
 	imgp->canary = (uintptr_t)arginfo -
 	    roundup(execpath_len, sizeof(char *)) -
 	    roundup(sizeof(canary), sizeof(char *));
 	copyout(canary, (void *)imgp->canary, sizeof(canary));
 
-	/*
-	 * If we have a valid auxargs ptr, prepare some room
-	 * on the stack.
-	 */
+	/* If we have a valid auxargs ptr, prepare some room on the stack. */
 	if (imgp->auxargs) {
 		/*
 		 * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
@@ -900,36 +871,29 @@ linux_copyout_strings(struct image_params *imgp)
 		    imgp->args->envc + 2 + imgp->auxarg_size) *
 		    sizeof(u_int32_t));
 
-	} else
+	} else {
 		/*
 		 * The '+ 2' is for the null pointers at the end of each of
 		 * the arg and env vector sets
 		 */
 		vectp = (u_int32_t *)(destp - (imgp->args->argc +
 		    imgp->args->envc + 2) * sizeof(u_int32_t));
+	}
 
-	/*
-	 * vectp also becomes our initial stack base
-	 */
+	/* vectp also becomes our initial stack base. */
 	stack_base = vectp;
 
 	stringp = imgp->args->begin_argv;
 	argc = imgp->args->argc;
 	envc = imgp->args->envc;
-	/*
-	 * Copy out strings - arguments and environment.
-	 */
+	/* Copy out strings - arguments and environment. */
 	copyout(stringp, destp, ARG_MAX - imgp->args->stringspace);
 
-	/*
-	 * Fill in "ps_strings" struct for ps, w, etc.
-	 */
+	/* Fill in "ps_strings" struct for ps, w, etc. */
 	suword32(&arginfo->ps_argvstr, (uint32_t)(intptr_t)vectp);
 	suword32(&arginfo->ps_nargvstr, argc);
 
-	/*
-	 * Fill in argument portion of vector table.
-	 */
+	/* Fill in argument portion of vector table. */
 	for (; argc > 0; --argc) {
 		suword32(vectp++, (uint32_t)(intptr_t)destp);
 		while (*stringp++ != 0)
@@ -937,15 +901,13 @@ linux_copyout_strings(struct image_params *imgp)
 		destp++;
 	}
 
-	/* a null vector table pointer separates the argp's from the envp's */
+	/* A null vector table pointer separates the argp's from the envp's. */
 	suword32(vectp++, 0);
 
 	suword32(&arginfo->ps_envstr, (uint32_t)(intptr_t)vectp);
 	suword32(&arginfo->ps_nenvstr, envc);
 
-	/*
-	 * Fill in environment portion of vector table.
-	 */
+	/* Fill in environment portion of vector table. */
 	for (; envc > 0; --envc) {
 		suword32(vectp++, (uint32_t)(intptr_t)destp);
 		while (*stringp++ != 0)
@@ -953,7 +915,7 @@ linux_copyout_strings(struct image_params *imgp)
 		destp++;
 	}
 
-	/* end of vector table is a null pointer */
+	/* The end of the vector table is a null pointer. */
 	suword32(vectp, 0);
 
 	return ((register_t *)stack_base);

Modified: stable/11/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/11/sys/i386/linux/linux_sysvec.c	Wed Aug  1 00:39:21 2018	(r337023)
+++ stable/11/sys/i386/linux/linux_sysvec.c	Wed Aug  1 00:41:02 2018	(r337024)
@@ -90,10 +90,9 @@ SYSCTL_PROC(_compat_linux, OID_AUTO, debug,
 #endif
 
 /*
- * Allow the sendsig functions to use the ldebug() facility
- * even though they are not syscalls themselves. Map them
- * to syscall 0. This is slightly less bogus than using
- * ldebug(sigreturn).
+ * Allow the sendsig functions to use the ldebug() facility even though they
+ * are not syscalls themselves.  Map them to syscall 0.  This is slightly less
+ * bogus than using ldebug(sigreturn).
  */
 #define	LINUX_SYS_linux_rt_sendsig	0
 #define	LINUX_SYS_linux_sendsig		0
@@ -308,9 +307,7 @@ linux_copyout_strings(struct image_params *imgp)
 	size_t execpath_len;
 	struct proc *p;
 
-	/*
-	 * Calculate string base and vector table pointers.
-	 */
+	/* Calculate string base and vector table pointers. */
 	p = imgp->proc;
 	if (imgp->execpath != NULL && imgp->auxargs != NULL)
 		execpath_len = strlen(imgp->execpath) + 1;
@@ -322,9 +319,7 @@ linux_copyout_strings(struct image_params *imgp)
 	    roundup(execpath_len, sizeof(char *)) -
 	    roundup(ARG_MAX - imgp->args->stringspace, sizeof(char *));
 
-	/*
-	 * install LINUX_PLATFORM
-	 */
+	/* Install LINUX_PLATFORM. */
 	copyout(linux_kplatform, ((caddr_t)arginfo - linux_szplatform),
 	    linux_szplatform);
 
@@ -334,19 +329,14 @@ linux_copyout_strings(struct image_params *imgp)
 		copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len);
 	}
 
-	/*
-	 * Prepare the canary for SSP.
-	 */
+	/* Prepare the canary for SSP. */
 	arc4rand(canary, sizeof(canary), 0);
 	imgp->canary = (uintptr_t)arginfo - linux_szplatform -
 	    roundup(execpath_len, sizeof(char *)) -
 	    roundup(sizeof(canary), sizeof(char *));
 	copyout(canary, (void *)imgp->canary, sizeof(canary));
 
-	/*
-	 * If we have a valid auxargs ptr, prepare some room
-	 * on the stack.
-	 */
+	/* If we have a valid auxargs ptr, prepare some room on the stack. */
 	if (imgp->auxargs) {
 		/*
 		 * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
@@ -370,29 +360,21 @@ linux_copyout_strings(struct image_params *imgp)
 		    sizeof(char *));
 	}
 
-	/*
-	 * vectp also becomes our initial stack base
-	 */
+	/* vectp also becomes our initial stack base. */
 	stack_base = (register_t *)vectp;
 
 	stringp = imgp->args->begin_argv;
 	argc = imgp->args->argc;
 	envc = imgp->args->envc;
 
-	/*
-	 * Copy out strings - arguments and environment.
-	 */
+	/* Copy out strings - arguments and environment. */
 	copyout(stringp, destp, ARG_MAX - imgp->args->stringspace);
 
-	/*
-	 * Fill in "ps_strings" struct for ps, w, etc.
-	 */
+	/* Fill in "ps_strings" struct for ps, w, etc. */
 	suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp);
 	suword(&arginfo->ps_nargvstr, argc);
 
-	/*
-	 * Fill in argument portion of vector table.
-	 */
+	/* Fill in argument portion of vector table. */
 	for (; argc > 0; --argc) {
 		suword(vectp++, (long)(intptr_t)destp);
 		while (*stringp++ != 0)
@@ -400,15 +382,13 @@ linux_copyout_strings(struct image_params *imgp)
 		destp++;
 	}
 
-	/* a null vector table pointer separates the argp's from the envp's */
+	/* A null vector table pointer separates the argp's from the envp's. */
 	suword(vectp++, 0);
 
 	suword(&arginfo->ps_envstr, (long)(intptr_t)vectp);
 	suword(&arginfo->ps_nenvstr, envc);
 
-	/*
-	 * Fill in environment portion of vector table.
-	 */
+	/* Fill in environment portion of vector table. */
 	for (; envc > 0; --envc) {
 		suword(vectp++, (long)(intptr_t)destp);
 		while (*stringp++ != 0)
@@ -416,7 +396,7 @@ linux_copyout_strings(struct image_params *imgp)
 		destp++;
 	}
 
-	/* end of vector table is a null pointer */
+	/* The end of the vector table is a null pointer. */
 	suword(vectp, 0);
 
 	return (stack_base);
@@ -446,9 +426,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 		printf(ARGS(rt_sendsig, "%p, %d, %p, %u"),
 		    catcher, sig, (void*)mask, code);
 #endif
-	/*
-	 * Allocate space for the signal handler context.
-	 */
+	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
 	    SIGISMEMBER(psp->ps_sigonstack, sig)) {
 		fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
@@ -457,9 +435,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 		fp = (struct l_rt_sigframe *)regs->tf_esp - 1;
 	mtx_unlock(&psp->ps_mtx);
 
-	/*
-	 * Build the argument list for the signal handler.
-	 */
+	/* Build the argument list for the signal handler. */
 	sig = bsd_to_linux_signal(sig);
 
 	bzero(&frame, sizeof(frame));
@@ -469,12 +445,10 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 	frame.sf_siginfo = &fp->sf_si;
 	frame.sf_ucontext = &fp->sf_sc;
 
-	/* Fill in POSIX parts */
+	/* Fill in POSIX parts. */
 	ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig);
 
-	/*
-	 * Build the signal context to be used by sigreturn.
-	 */
+	/* Build the signal context to be used by sigreturn. */
 	frame.sf_sc.uc_flags = 0;		/* XXX ??? */
 	frame.sf_sc.uc_link = NULL;		/* XXX ??? */
 
@@ -529,9 +503,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse
 		sigexit(td, SIGILL);
 	}
 
-	/*
-	 * Build context to run handler in.
-	 */
+	/* Build context to run handler in. */
 	regs->tf_esp = (int)fp;
 	regs->tf_eip = linux_rt_sigcode;
 	regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D);
@@ -586,9 +558,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t
 		    catcher, sig, (void*)mask, code);
 #endif
 
-	/*
-	 * Allocate space for the signal handler context.
-	 */
+	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
 	    SIGISMEMBER(psp->ps_sigonstack, sig)) {
 		fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
@@ -598,9 +568,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t
 	mtx_unlock(&psp->ps_mtx);
 	PROC_UNLOCK(p);
 
-	/*
-	 * Build the argument list for the signal handler.
-	 */
+	/* Build the argument list for the signal handler. */
 	sig = bsd_to_linux_signal(sig);
 
 	bzero(&frame, sizeof(frame));
@@ -610,9 +578,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t
 
 	bsd_to_linux_sigset(mask, &lmask);
 
-	/*
-	 * Build the signal context to be used by sigreturn.
-	 */
+	/* Build the signal context to be used by sigreturn. */
 	frame.sf_sc.sc_mask   = lmask.__mask;
 	frame.sf_sc.sc_gs     = rgs();
 	frame.sf_sc.sc_fs     = regs->tf_fs;
@@ -646,9 +612,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t
 		sigexit(td, SIGILL);
 	}
 
-	/*
-	 * Build context to run handler in.
-	 */
+	/* Build context to run handler in. */
 	regs->tf_esp = (int)fp;
 	regs->tf_eip = linux_sigcode;
 	regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D);
@@ -695,9 +659,7 @@ linux_sigreturn(struct thread *td, struct linux_sigret
 	if (copyin(args->sfp, &frame, sizeof(frame)) != 0)
 		return (EFAULT);
 
-	/*
-	 * Check for security violations.
-	 */
+	/* Check for security violations. */
 #define	EFLAGS_SECURE(ef, oef)	((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
 	eflags = frame.sf_sc.sc_eflags;
 	if (!EFLAGS_SECURE(eflags, regs->tf_eflags))
@@ -723,9 +685,7 @@ linux_sigreturn(struct thread *td, struct linux_sigret
 	linux_to_bsd_sigset(&lmask, &bmask);
 	kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0);
 
-	/*
-	 * Restore signal context.
-	 */
+	/* Restore signal context. */
 	/* %gs was restored by the trampoline. */
 	regs->tf_fs     = frame.sf_sc.sc_fs;
 	regs->tf_es     = frame.sf_sc.sc_es;
@@ -784,9 +744,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_
 
 	context = &uc.uc_mcontext;
 
-	/*
-	 * Check for security violations.
-	 */
+	/* Check for security violations. */
 #define	EFLAGS_SECURE(ef, oef)	((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
 	eflags = context->sc_eflags;
 	if (!EFLAGS_SECURE(eflags, regs->tf_eflags))
@@ -811,9 +769,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_
 	linux_to_bsd_sigset(&uc.uc_sigmask, &bmask);
 	kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0);
 
-	/*
-	 * Restore signal context
-	 */
+	/* Restore signal context. */
 	/* %gs was restored by the trampoline. */
 	regs->tf_fs     = context->sc_fs;
 	regs->tf_es     = context->sc_es;
@@ -831,9 +787,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_
 	regs->tf_esp    = context->sc_esp_at_signal;
 	regs->tf_ss     = context->sc_ss;
 
-	/*
-	 * call sigaltstack & ignore results..
-	 */
+	/* Call sigaltstack & ignore results. */
 	lss = &uc.uc_stack;
 	ss.ss_sp = lss->ss_sp;
 	ss.ss_size = lss->ss_size;
@@ -930,7 +884,7 @@ exec_linux_setregs(struct thread *td, struct image_par
 
 	exec_setregs(td, imgp, stack);
 
-	/* Linux sets %gs to 0, we default to _udatasel */
+	/* Linux sets %gs to 0, we default to _udatasel. */
 	pcb->pcb_gs = 0;
 	load_gs(0);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808010041.w710f3Cg060489>