Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2007 11:30:17 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 124529 for review
Message-ID:  <200708021130.l72BUHrY077198@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124529

Change 124529 by rdivacky@rdivacky_witten on 2007/08/02 11:30:05

	Implement fake linux_sched_getaffinity() thus fixing java with 2.6.16 and god knows what else.

Affected files ...

.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/amd64/linux32/linux32_proto.h#2 edit
.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/amd64/linux32/linux32_syscall.h#2 edit
.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/amd64/linux32/linux32_sysent.c#2 edit
.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/amd64/linux32/syscalls.master#2 edit
.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/compat/linux/linux_misc.c#3 edit
.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/linux_proto.h#2 edit
.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/linux_syscall.h#2 edit
.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/linux_sysent.c#2 edit
.. //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/syscalls.master#2 edit

Differences ...

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/amd64/linux32/linux32_proto.h#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.31 2007/03/30 00:08:21 jkim Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.28 2007/03/30 00:06:21 jkim Exp 
  */
 
@@ -734,6 +734,11 @@
 	char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
 	char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
 };
+struct linux_sched_getaffinity_args {
+	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+	char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)];
+	char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)];
+};
 struct linux_set_thread_area_args {
 	char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)];
 };
@@ -1099,6 +1104,7 @@
 int	linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *);
 int	linux_tkill(struct thread *, struct linux_tkill_args *);
 int	linux_sys_futex(struct thread *, struct linux_sys_futex_args *);
+int	linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *);
 int	linux_set_thread_area(struct thread *, struct linux_set_thread_area_args *);
 int	linux_fadvise64(struct thread *, struct linux_fadvise64_args *);
 int	linux_exit_group(struct thread *, struct linux_exit_group_args *);
@@ -1172,6 +1178,13 @@
 
 #endif /* COMPAT_FREEBSD4 */
 
+
+#ifdef COMPAT_FREEBSD6
+
+#define	nosys	linux_nosys
+
+#endif /* COMPAT_FREEBSD6 */
+
 #define	LINUX_SYS_AUE_linux_fork	AUE_FORK
 #define	LINUX_SYS_AUE_linux_open	AUE_OPEN_RWTC
 #define	LINUX_SYS_AUE_linux_waitpid	AUE_WAIT4
@@ -1346,6 +1359,7 @@
 #define	LINUX_SYS_AUE_linux_fremovexattr	AUE_NULL
 #define	LINUX_SYS_AUE_linux_tkill	AUE_NULL
 #define	LINUX_SYS_AUE_linux_sys_futex	AUE_NULL
+#define	LINUX_SYS_AUE_linux_sched_getaffinity	AUE_NULL
 #define	LINUX_SYS_AUE_linux_set_thread_area	AUE_NULL
 #define	LINUX_SYS_AUE_linux_fadvise64	AUE_NULL
 #define	LINUX_SYS_AUE_linux_exit_group	AUE_EXIT

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/amd64/linux32/linux32_syscall.h#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.31 2007/03/30 00:08:21 jkim Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.28 2007/03/30 00:06:21 jkim Exp 
  */
 
@@ -222,6 +222,7 @@
 #define	LINUX_SYS_linux_fremovexattr	237
 #define	LINUX_SYS_linux_tkill	238
 #define	LINUX_SYS_linux_sys_futex	240
+#define	LINUX_SYS_linux_sched_getaffinity	242
 #define	LINUX_SYS_linux_set_thread_area	243
 #define	LINUX_SYS_linux_fadvise64	250
 #define	LINUX_SYS_linux_exit_group	252

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/amd64/linux32/linux32_sysent.c#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.31 2007/03/30 00:08:21 jkim Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.28 2007/03/30 00:06:21 jkim Exp 
  */
 
@@ -262,7 +262,7 @@
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 239 = linux_sendfile64 */
 	{ AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0 },	/* 240 = linux_sys_futex */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 241 = linux_sched_setaffinity */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 242 = linux_sched_getaffinity */
+	{ AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0 },	/* 242 = linux_sched_getaffinity */
 	{ AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0 },	/* 243 = linux_set_thread_area */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 244 = linux_get_thread_area */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 245 = linux_io_setup */

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/amd64/linux32/syscalls.master#2 (text+ko) ====

@@ -408,7 +408,8 @@
 240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, int val, \
 					struct l_timespec *timeout, void *uaddr2, int val3); }
 241	AUE_NULL	UNIMPL	linux_sched_setaffinity
-242	AUE_NULL	UNIMPL	linux_sched_getaffinity
+242     AUE_NULL        STD     { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \
+					l_ulong *user_mask_ptr); }
 243	AUE_NULL	STD	{ int linux_set_thread_area(struct l_user_desc *desc); }
 244	AUE_NULL	UNIMPL	linux_get_thread_area
 245	AUE_NULL	UNIMPL	linux_io_setup

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/compat/linux/linux_misc.c#3 (text+ko) ====

@@ -1714,3 +1714,17 @@
 
 	return (error);
 }
+
+/* XXX: fake one.. waiting for ssouhlal to commit his patch */
+int
+linux_sched_getaffinity(struct thread *td, struct linux_sched_getaffinity_args *args)
+{
+	int error;
+	cpumask_t i = ~0;
+
+	if (args->len < sizeof(cpumask_t))
+		return (EINVAL);
+
+	error = copyout(&i, args->user_mask_ptr, sizeof(cpumask_t));
+	return (error);
+}

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/linux_proto.h#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_proto.h,v 1.92 2007/03/29 02:11:46 julian Exp $
- * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.86 2007/02/15 00:54:40 jkim Exp 
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.87 2007/03/29 02:11:46 julian Exp 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -731,6 +731,11 @@
 	char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
 	char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
 };
+struct linux_sched_getaffinity_args {
+	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+	char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)];
+	char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)];
+};
 struct linux_set_thread_area_args {
 	char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)];
 };
@@ -1118,6 +1123,7 @@
 int	linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *);
 int	linux_tkill(struct thread *, struct linux_tkill_args *);
 int	linux_sys_futex(struct thread *, struct linux_sys_futex_args *);
+int	linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *);
 int	linux_set_thread_area(struct thread *, struct linux_set_thread_area_args *);
 int	linux_get_thread_area(struct thread *, struct linux_get_thread_area_args *);
 int	linux_fadvise64(struct thread *, struct linux_fadvise64_args *);
@@ -1192,6 +1198,13 @@
 
 #endif /* COMPAT_FREEBSD4 */
 
+
+#ifdef COMPAT_FREEBSD6
+
+#define	nosys	linux_nosys
+
+#endif /* COMPAT_FREEBSD6 */
+
 #define	LINUX_SYS_AUE_linux_fork	AUE_FORK
 #define	LINUX_SYS_AUE_linux_open	AUE_OPEN_RWTC
 #define	LINUX_SYS_AUE_linux_waitpid	AUE_WAIT4
@@ -1366,6 +1379,7 @@
 #define	LINUX_SYS_AUE_linux_fremovexattr	AUE_NULL
 #define	LINUX_SYS_AUE_linux_tkill	AUE_NULL
 #define	LINUX_SYS_AUE_linux_sys_futex	AUE_NULL
+#define	LINUX_SYS_AUE_linux_sched_getaffinity	AUE_NULL
 #define	LINUX_SYS_AUE_linux_set_thread_area	AUE_NULL
 #define	LINUX_SYS_AUE_linux_get_thread_area	AUE_NULL
 #define	LINUX_SYS_AUE_linux_fadvise64	AUE_NULL

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/linux_syscall.h#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_syscall.h,v 1.85 2007/03/29 02:11:46 julian Exp $
- * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.86 2007/02/15 00:54:40 jkim Exp 
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.87 2007/03/29 02:11:46 julian Exp 
  */
 
 #define	LINUX_SYS_exit	1
@@ -228,6 +228,7 @@
 #define	LINUX_SYS_linux_fremovexattr	237
 #define	LINUX_SYS_linux_tkill	238
 #define	LINUX_SYS_linux_sys_futex	240
+#define	LINUX_SYS_linux_sched_getaffinity	242
 #define	LINUX_SYS_linux_set_thread_area	243
 #define	LINUX_SYS_linux_get_thread_area	244
 #define	LINUX_SYS_linux_fadvise64	250

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/linux_sysent.c#2 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_sysent.c,v 1.92 2007/03/29 02:11:46 julian Exp $
- * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.86 2007/02/15 00:54:40 jkim Exp 
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.87 2007/03/29 02:11:46 julian Exp 
  */
 
 #include <bsm/audit_kevents.h>
@@ -261,7 +261,7 @@
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 239 = linux_sendfile64 */
 	{ AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0 },	/* 240 = linux_sys_futex */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 241 = linux_sched_setaffinity */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 242 = linux_sched_getaffinity */
+	{ AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0 },	/* 242 = linux_sched_getaffinity */
 	{ AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0 },	/* 243 = linux_set_thread_area */
 	{ AS(linux_get_thread_area_args), (sy_call_t *)linux_get_thread_area, AUE_NULL, NULL, 0, 0 },	/* 244 = linux_get_thread_area */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 245 = linux_io_setup */

==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/i386/linux/syscalls.master#2 (text+ko) ====

@@ -410,7 +410,8 @@
 240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, int val, \
 					struct l_timespec *timeout, void *uaddr2, int val3); }
 241	AUE_NULL	UNIMPL	linux_sched_setaffinity
-242	AUE_NULL	UNIMPL	linux_sched_getaffinity
+242	AUE_NULL	STD	{ int linux_sched_getaffinity(l_pid_t pid, l_uint len, \
+					l_ulong *user_mask_ptr); }
 243	AUE_NULL	STD	{ int linux_set_thread_area(struct l_user_desc *desc); }
 244	AUE_NULL	STD	{ int linux_get_thread_area(struct l_user_desc *desc); }
 245	AUE_NULL	UNIMPL	linux_io_setup



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