Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2015 15:43:54 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283415 - head/sys/compat/linux
Message-ID:  <201505241543.t4OFhsOO063002@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sun May 24 15:43:53 2015
New Revision: 283415
URL: https://svnweb.freebsd.org/changeset/base/283415

Log:
  Disable i386 call for x86-64 Linux.
  
  Differential Revision:	https://reviews.freebsd.org/D1067
  Reviewed by:	trasz

Modified:
  head/sys/compat/linux/linux_file.c
  head/sys/compat/linux/linux_misc.c
  head/sys/compat/linux/linux_signal.c
  head/sys/compat/linux/linux_socket.c
  head/sys/compat/linux/linux_stats.c

Modified: head/sys/compat/linux/linux_file.c
==============================================================================
--- head/sys/compat/linux/linux_file.c	Sun May 24 15:42:36 2015	(r283414)
+++ head/sys/compat/linux/linux_file.c	Sun May 24 15:43:53 2015	(r283415)
@@ -235,6 +235,7 @@ linux_lseek(struct thread *td, struct li
     return error;
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_llseek(struct thread *td, struct linux_llseek_args *args)
 {
@@ -273,6 +274,7 @@ linux_readdir(struct thread *td, struct 
 	lda.count = 1;
 	return linux_getdents(td, &lda);
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 /*
  * Note that linux_getdents(2) and linux_getdents64(2) have the same
@@ -924,6 +926,7 @@ linux_truncate(struct thread *td, struct
 	return (error);
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_truncate64(struct thread *td, struct linux_truncate64_args *args)
 {
@@ -941,6 +944,8 @@ linux_truncate64(struct thread *td, stru
 	LFREEPATH(path);
 	return (error);
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+
 int
 linux_ftruncate(struct thread *td, struct linux_ftruncate_args *args)
 {
@@ -1129,6 +1134,7 @@ linux_mount(struct thread *td, struct li
 	return (error);
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_oldumount(struct thread *td, struct linux_oldumount_args *args)
 {
@@ -1138,6 +1144,7 @@ linux_oldumount(struct thread *td, struc
 	args2.flags = 0;
 	return (linux_umount(td, &args2));
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_umount(struct thread *td, struct linux_umount_args *args)
@@ -1268,7 +1275,7 @@ bsd_to_linux_flock64(struct flock *bsd_f
 #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 static int
-fcntl_common(struct thread *td, struct linux_fcntl64_args *args)
+fcntl_common(struct thread *td, struct linux_fcntl_args *args)
 {
 	struct l_flock linux_flock;
 	struct flock bsd_flock;
@@ -1394,17 +1401,13 @@ fcntl_common(struct thread *td, struct l
 int
 linux_fcntl(struct thread *td, struct linux_fcntl_args *args)
 {
-	struct linux_fcntl64_args args64;
 
 #ifdef DEBUG
 	if (ldebug(fcntl))
 		printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd);
 #endif
 
-	args64.fd = args->fd;
-	args64.cmd = args->cmd;
-	args64.arg = args->arg;
-	return (fcntl_common(td, &args64));
+	return (fcntl_common(td, args));
 }
 
 #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
@@ -1413,6 +1416,7 @@ linux_fcntl64(struct thread *td, struct 
 {
 	struct l_flock64 linux_flock;
 	struct flock bsd_flock;
+	struct linux_fcntl_args fcntl_args;
 	int error;
 
 #ifdef DEBUG
@@ -1453,7 +1457,10 @@ linux_fcntl64(struct thread *td, struct 
 		    (intptr_t)&bsd_flock));
 	}
 
-	return (fcntl_common(td, args));
+	fcntl_args.fd = args->fd;
+	fcntl_args.cmd = args->cmd;
+	fcntl_args.arg = args->arg;
+	return (fcntl_common(td, &fcntl_args));
 }
 #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
@@ -1551,6 +1558,7 @@ linux_fadvise64(struct thread *td, struc
 	    advice));
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_fadvise64_64(struct thread *td, struct linux_fadvise64_64_args *args)
 {
@@ -1562,6 +1570,7 @@ linux_fadvise64_64(struct thread *td, st
 	return (kern_posix_fadvise(td, args->fd, args->offset, args->len,
 	    advice));
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_pipe(struct thread *td, struct linux_pipe_args *args)

Modified: head/sys/compat/linux/linux_misc.c
==============================================================================
--- head/sys/compat/linux/linux_misc.c	Sun May 24 15:42:36 2015	(r283414)
+++ head/sys/compat/linux/linux_misc.c	Sun May 24 15:43:53 2015	(r283415)
@@ -736,7 +736,6 @@ linux_newuname(struct thread *td, struct
 	return (copyout(&utsname, args->buf, sizeof(utsname)));
 }
 
-#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 struct l_utimbuf {
 	l_time_t l_actime;
 	l_time_t l_modtime;
@@ -841,7 +840,6 @@ linux_futimesat(struct thread *td, struc
 	LFREEPATH(fname);
 	return (error);
 }
-#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_common_wait(struct thread *td, int pid, int *status,
@@ -867,6 +865,7 @@ linux_common_wait(struct thread *td, int
 	return (error);
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_waitpid(struct thread *td, struct linux_waitpid_args *args)
 {
@@ -891,6 +890,7 @@ linux_waitpid(struct thread *td, struct 
 
 	return (linux_common_wait(td, args->pid, args->status, options, NULL));
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_wait4(struct thread *td, struct linux_wait4_args *args)
@@ -1165,6 +1165,7 @@ linux_getitimer(struct thread *td, struc
 	return (copyout(&ls, uap->itv, sizeof(ls)));
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_nice(struct thread *td, struct linux_nice_args *args)
 {
@@ -1175,6 +1176,7 @@ linux_nice(struct thread *td, struct lin
 	bsd_args.prio = args->inc;
 	return (sys_setpriority(td, &bsd_args));
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_setgroups(struct thread *td, struct linux_setgroups_args *args)
@@ -1304,6 +1306,7 @@ linux_setrlimit(struct thread *td, struc
 	return (kern_setrlimit(td, which, &bsd_rlim));
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_old_getrlimit(struct thread *td, struct linux_old_getrlimit_args *args)
 {
@@ -1346,6 +1349,7 @@ linux_old_getrlimit(struct thread *td, s
 #endif
 	return (copyout(&rlim, args->rlim, sizeof(rlim)));
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_getrlimit(struct thread *td, struct linux_getrlimit_args *args)

Modified: head/sys/compat/linux/linux_signal.c
==============================================================================
--- head/sys/compat/linux/linux_signal.c	Sun May 24 15:42:36 2015	(r283414)
+++ head/sys/compat/linux/linux_signal.c	Sun May 24 15:43:53 2015	(r283415)
@@ -60,6 +60,7 @@ static int	linux_do_tkill(struct thread 
 static void	sicode_to_lsicode(int si_code, int *lsi_code);
 
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 void
 linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss)
 {
@@ -93,6 +94,7 @@ bsd_to_linux_sigset(sigset_t *bss, l_sig
 		}
 	}
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 static void
 linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa)
@@ -177,7 +179,7 @@ linux_do_sigaction(struct thread *td, in
 	return (0);
 }
 
-
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_signal(struct thread *td, struct linux_signal_args *args)
 {
@@ -199,6 +201,7 @@ linux_signal(struct thread *td, struct l
 
 	return (error);
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_rt_sigaction(struct thread *td, struct linux_rt_sigaction_args *args)
@@ -268,6 +271,7 @@ linux_do_sigprocmask(struct thread *td, 
 	return (error);
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_sigprocmask(struct thread *td, struct linux_sigprocmask_args *args)
 {
@@ -299,6 +303,7 @@ linux_sigprocmask(struct thread *td, str
 
 	return (error);
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_rt_sigprocmask(struct thread *td, struct linux_rt_sigprocmask_args *args)
@@ -333,6 +338,7 @@ linux_rt_sigprocmask(struct thread *td, 
 	return (error);
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_sgetmask(struct thread *td, struct linux_sgetmask_args *args)
 {
@@ -376,9 +382,6 @@ linux_ssetmask(struct thread *td, struct
 	return (0);
 }
 
-/*
- * MPSAFE
- */
 int
 linux_sigpending(struct thread *td, struct linux_sigpending_args *args)
 {
@@ -401,6 +404,7 @@ linux_sigpending(struct thread *td, stru
 	mask = lset.__bits[0];
 	return (copyout(&mask, args->mask, sizeof(mask)));
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 /*
  * MPSAFE

Modified: head/sys/compat/linux/linux_socket.c
==============================================================================
--- head/sys/compat/linux/linux_socket.c	Sun May 24 15:42:36 2015	(r283414)
+++ head/sys/compat/linux/linux_socket.c	Sun May 24 15:43:53 2015	(r283415)
@@ -1530,6 +1530,8 @@ linux_getsockopt(struct thread *td, stru
 	return (error);
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
+
 /* Argument list sizes for linux_socketcall */
 
 #define LINUX_AL(x) ((x) * sizeof(l_ulong))
@@ -1549,7 +1551,6 @@ static const unsigned char lxs_args[] = 
 
 #define	LINUX_AL_SIZE	sizeof(lxs_args) / sizeof(lxs_args[0]) - 1
 
-#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 int
 linux_socketcall(struct thread *td, struct linux_socketcall_args *args)
 {

Modified: head/sys/compat/linux/linux_stats.c
==============================================================================
--- head/sys/compat/linux/linux_stats.c	Sun May 24 15:42:36 2015	(r283414)
+++ head/sys/compat/linux/linux_stats.c	Sun May 24 15:43:53 2015	(r283415)
@@ -251,6 +251,7 @@ linux_newfstat(struct thread *td, struct
 	return (error);
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 static int
 stat_copyout(struct stat *buf, void *ubuf)
 {
@@ -325,6 +326,7 @@ linux_lstat(struct thread *td, struct li
 	LFREEPATH(path);
 	return(stat_copyout(&buf, args->up));
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 struct l_statfs {
 	l_long		f_type;
@@ -420,6 +422,7 @@ linux_statfs(struct thread *td, struct l
 	return copyout(&linux_statfs, args->buf, sizeof(linux_statfs));
 }
 
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
 static void
 bsd_to_linux_statfs64(struct statfs *bsd_statfs, struct l_statfs64 *linux_statfs)
 {
@@ -460,6 +463,7 @@ linux_statfs64(struct thread *td, struct
 	bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs);
 	return copyout(&linux_statfs, args->buf, sizeof(linux_statfs));
 }
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
 int
 linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args)



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