svn commit: r187964 - head/sys/amd64/linux32

David E. O'Brien obrien at FreeBSD.org
Sat Jan 31 12:46:02 PST 2009


Author: obrien
Date: Sat Jan 31 20:46:01 2009
New Revision: 187964
URL: http://svn.freebsd.org/changeset/base/187964

Log:
  Fix the inconsistent tabbing.
  
  Noticed by:	bde

Modified:
  head/sys/amd64/linux32/linux32_sysvec.c

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Sat Jan 31 18:32:39 2009	(r187963)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Sat Jan 31 20:46:01 2009	(r187964)
@@ -348,12 +348,12 @@ linux_rt_sendsig(sig_t catcher, ksiginfo
 
 	bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask);
 
-	frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__bits[0];
-        frame.sf_sc.uc_mcontext.sc_gs     = rgs();
-        frame.sf_sc.uc_mcontext.sc_fs     = rfs();
-        __asm __volatile("mov %%es,%0" :
+	frame.sf_sc.uc_mcontext.sc_mask	= frame.sf_sc.uc_sigmask.__bits[0];
+	frame.sf_sc.uc_mcontext.sc_gs     = rgs();
+	frame.sf_sc.uc_mcontext.sc_fs     = rfs();
+	__asm __volatile("mov %%es,%0" :
 	    "=rm" (frame.sf_sc.uc_mcontext.sc_es));
-        __asm __volatile("mov %%ds,%0" :
+	__asm __volatile("mov %%ds,%0" :
 	    "=rm" (frame.sf_sc.uc_mcontext.sc_ds));
 	frame.sf_sc.uc_mcontext.sc_edi    = regs->tf_rdi;
 	frame.sf_sc.uc_mcontext.sc_esi    = regs->tf_rsi;
@@ -483,10 +483,10 @@ linux_sendsig(sig_t catcher, ksiginfo_t 
 	 * Build the signal context to be used by sigreturn.
 	 */
 	frame.sf_sc.sc_mask   = lmask.__bits[0];
-        frame.sf_sc.sc_gs     = rgs();
-        frame.sf_sc.sc_fs     = rfs();
-        __asm __volatile("mov %%es,%0" : "=rm" (frame.sf_sc.sc_es));
-        __asm __volatile("mov %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
+	frame.sf_sc.sc_gs     = rgs();
+	frame.sf_sc.sc_fs     = rfs();
+	__asm __volatile("mov %%es,%0" : "=rm" (frame.sf_sc.sc_es));
+	__asm __volatile("mov %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
 	frame.sf_sc.sc_edi    = regs->tf_rdi;
 	frame.sf_sc.sc_esi    = regs->tf_rsi;
 	frame.sf_sc.sc_ebp    = regs->tf_rbp;
@@ -768,35 +768,37 @@ static int	exec_linux_imgact_try(struct 
 static int
 exec_linux_imgact_try(struct image_params *imgp)
 {
-    const char *head = (const char *)imgp->image_header;
-    char *rpath;
-    int error = -1, len;
-
-    /*
-     * The interpreter for shell scripts run from a linux binary needs
-     * to be located in /compat/linux if possible in order to recursively
-     * maintain linux path emulation.
-     */
-    if (((const short *)head)[0] == SHELLMAGIC) {
-	    /*
-	     * Run our normal shell image activator.  If it succeeds attempt
-	     * to use the alternate path for the interpreter.  If an alternate
-	     * path is found, use our stringspace to store it.
-	     */
-	    if ((error = exec_shell_imgact(imgp)) == 0) {
-		    linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
-			imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, AT_FDCWD);
-		    if (rpath != NULL) {
-			    len = strlen(rpath) + 1;
-
-			    if (len <= MAXSHELLCMDLEN) {
-				    memcpy(imgp->interpreter_name, rpath, len);
-			    }
-			    free(rpath, M_TEMP);
-		    }
-	    }
-    }
-    return(error);
+	const char *head = (const char *)imgp->image_header;
+	char *rpath;
+	int error = -1, len;
+
+	/*
+	* The interpreter for shell scripts run from a linux binary needs
+	* to be located in /compat/linux if possible in order to recursively
+	* maintain linux path emulation.
+	*/
+	if (((const short *)head)[0] == SHELLMAGIC) {
+		/*
+		* Run our normal shell image activator.  If it succeeds attempt
+		* to use the alternate path for the interpreter.  If an
+		* alternate * path is found, use our stringspace to store it.
+		*/
+		if ((error = exec_shell_imgact(imgp)) == 0) {
+			linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
+			    imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0,
+			    AT_FDCWD);
+			if (rpath != NULL) {
+				len = strlen(rpath) + 1;
+
+				if (len <= MAXSHELLCMDLEN) {
+					memcpy(imgp->interpreter_name, rpath,
+					    len);
+				}
+				free(rpath, M_TEMP);
+			}
+		}
+	}
+	return(error);
 }
 
 /*
@@ -864,7 +866,7 @@ linux_copyout_strings(struct image_param
 	arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS;
 	sigcodesz = *(imgp->proc->p_sysent->sv_szsigcode);
 	destp =	(caddr_t)arginfo - sigcodesz - SPARE_USRSPACE -
-		roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
+	    roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
 
 	/*
 	 * install sigcode
@@ -882,23 +884,24 @@ linux_copyout_strings(struct image_param
 		 * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
 		 * lower compatibility.
 		 */
-		imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size
-			: (AT_COUNT * 2);
+		imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size :
+		    (AT_COUNT * 2);
 		/*
 		 * The '+ 2' is for the null pointers at the end of each of
 		 * the arg and env vector sets,and imgp->auxarg_size is room
 		 * for argument of Runtime loader.
 		 */
-		vectp = (u_int32_t *) (destp - (imgp->args->argc + imgp->args->envc + 2 +
-				       imgp->auxarg_size) * sizeof(u_int32_t));
+		vectp = (u_int32_t *) (destp - (imgp->args->argc +
+		    imgp->args->envc + 2 + imgp->auxarg_size) *
+		    sizeof(u_int32_t));
 
 	} 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 = (u_int32_t *)(destp - (imgp->args->argc +
+		    imgp->args->envc + 2) * sizeof(u_int32_t));
 
 	/*
 	 * vectp also becomes our initial stack base
@@ -970,7 +973,7 @@ linux32_fixlimit(struct rlimit *rl, int 
 
 	switch (which) {
 	case RLIMIT_DATA:
-		if (linux32_maxdsiz != 0) {			
+		if (linux32_maxdsiz != 0) {
 			if (rl->rlim_cur > linux32_maxdsiz)
 				rl->rlim_cur = linux32_maxdsiz;
 			if (rl->rlim_max > linux32_maxdsiz)
@@ -1080,12 +1083,12 @@ linux_elf_modevent(module_t mod, int typ
 			sx_init(&emul_shared_lock, "emuldata->shared lock");
 			LIST_INIT(&futex_list);
 			sx_init(&futex_sx, "futex protection lock");
-			linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit,
-			      NULL, 1000);
-			linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail, linux_schedtail,
-			      NULL, 1000);
-			linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec,
-			      NULL, 1000);
+			linux_exit_tag = EVENTHANDLER_REGISTER(process_exit,
+			    linux_proc_exit, NULL, 1000);
+			linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail,
+			    linux_schedtail, NULL, 1000);
+			linux_exec_tag = EVENTHANDLER_REGISTER(process_exec,
+			    linux_proc_exec, NULL, 1000);
 			if (bootverbose)
 				printf("Linux ELF exec handler installed\n");
 		} else


More information about the svn-src-head mailing list