Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178182957
D62275.1796212169.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
6 KB
Referenced Files
None
Subscribers
None
D62275.1796212169.diff
View Options
diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h
--- a/sys/compat/linux/linux_socket.h
+++ b/sys/compat/linux/linux_socket.h
@@ -134,6 +134,11 @@
int linux_accept(struct thread *td, struct linux_accept_args *args);
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) || \
+ defined(__powerpc64__)
+
/* Operations for socketcall */
#define LINUX_SOCKET 1
#define LINUX_BIND 2
@@ -157,7 +162,7 @@
#define LINUX_SENDMMSG 20
#define LINUX_SENDFILE 21
-#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) || __powerpc64__ */
/* Socket defines */
#define LINUX_SOL_SOCKET 1
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -2941,7 +2941,10 @@
return (error);
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) || \
+ defined(__powerpc64__)
/* Argument list sizes for linux_socketcall */
static const unsigned char lxs_args_cnt[] = {
0 /* unused*/, 3 /* socket */,
@@ -3030,4 +3033,4 @@
linux_msg(td, "socket type %d not implemented", args->what);
return (ENOSYS);
}
-#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) || __powerpc64__ */
diff --git a/sys/powerpc/linux/linux_proto.h b/sys/powerpc/linux/linux_proto.h
--- a/sys/powerpc/linux/linux_proto.h
+++ b/sys/powerpc/linux/linux_proto.h
@@ -233,6 +233,10 @@
struct linux_ioperm_args {
syscallarg_t dummy;
};
+struct linux_socketcall_args {
+ char what_l_[PADL_(l_int)]; l_int what; char what_r_[PADR_(l_int)];
+ char args_l_[PADL_(l_ulong)]; l_ulong args; char args_r_[PADR_(l_ulong)];
+};
struct linux_syslog_args {
char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
@@ -1492,6 +1496,7 @@
int linux_statfs(struct thread *, struct linux_statfs_args *);
int linux_fstatfs(struct thread *, struct linux_fstatfs_args *);
int linux_ioperm(struct thread *, struct linux_ioperm_args *);
+int linux_socketcall(struct thread *, struct linux_socketcall_args *);
int linux_syslog(struct thread *, struct linux_syslog_args *);
int linux_setitimer(struct thread *, struct linux_setitimer_args *);
int linux_getitimer(struct thread *, struct linux_getitimer_args *);
@@ -1857,6 +1862,7 @@
#define LINUX_SYS_AUE_linux_statfs AUE_STATFS
#define LINUX_SYS_AUE_linux_fstatfs AUE_FSTATFS
#define LINUX_SYS_AUE_linux_ioperm AUE_NULL
+#define LINUX_SYS_AUE_linux_socketcall AUE_NULL
#define LINUX_SYS_AUE_linux_syslog AUE_NULL
#define LINUX_SYS_AUE_linux_setitimer AUE_SETITIMER
#define LINUX_SYS_AUE_linux_getitimer AUE_GETITIMER
diff --git a/sys/powerpc/linux/linux_syscall.h b/sys/powerpc/linux/linux_syscall.h
--- a/sys/powerpc/linux/linux_syscall.h
+++ b/sys/powerpc/linux/linux_syscall.h
@@ -78,6 +78,7 @@
#define LINUX_SYS_linux_statfs 99
#define LINUX_SYS_linux_fstatfs 100
#define LINUX_SYS_linux_ioperm 101
+#define LINUX_SYS_linux_socketcall 102
#define LINUX_SYS_linux_syslog 103
#define LINUX_SYS_linux_setitimer 104
#define LINUX_SYS_linux_getitimer 105
diff --git a/sys/powerpc/linux/linux_syscalls.c b/sys/powerpc/linux/linux_syscalls.c
--- a/sys/powerpc/linux/linux_syscalls.c
+++ b/sys/powerpc/linux/linux_syscalls.c
@@ -107,7 +107,7 @@
"linux_statfs", /* 99 = linux_statfs */
"linux_fstatfs", /* 100 = linux_fstatfs */
"linux_ioperm", /* 101 = linux_ioperm */
- "#102", /* 102 = linux_socketcall */
+ "linux_socketcall", /* 102 = linux_socketcall */
"linux_syslog", /* 103 = linux_syslog */
"linux_setitimer", /* 104 = linux_setitimer */
"linux_getitimer", /* 105 = linux_getitimer */
diff --git a/sys/powerpc/linux/linux_sysent.c b/sys/powerpc/linux/linux_sysent.c
--- a/sys/powerpc/linux/linux_sysent.c
+++ b/sys/powerpc/linux/linux_sysent.c
@@ -176,7 +176,7 @@
{ .sy_narg = AS(linux_statfs_args), .sy_call = (sy_call_t *)linux_statfs, .sy_auevent = AUE_STATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 99 = linux_statfs */
{ .sy_narg = AS(linux_fstatfs_args), .sy_call = (sy_call_t *)linux_fstatfs, .sy_auevent = AUE_FSTATFS, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 100 = linux_fstatfs */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_ioperm, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 101 = linux_ioperm */
- { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 102 = linux_socketcall */
+ { .sy_narg = AS(linux_socketcall_args), .sy_call = (sy_call_t *)linux_socketcall, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 102 = linux_socketcall */
{ .sy_narg = AS(linux_syslog_args), .sy_call = (sy_call_t *)linux_syslog, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 103 = linux_syslog */
{ .sy_narg = AS(linux_setitimer_args), .sy_call = (sy_call_t *)linux_setitimer, .sy_auevent = AUE_SETITIMER, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 104 = linux_setitimer */
{ .sy_narg = AS(linux_getitimer_args), .sy_call = (sy_call_t *)linux_getitimer, .sy_auevent = AUE_GETITIMER, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 105 = linux_getitimer */
diff --git a/sys/powerpc/linux/linux_systrace_args.c b/sys/powerpc/linux/linux_systrace_args.c
--- a/sys/powerpc/linux/linux_systrace_args.c
+++ b/sys/powerpc/linux/linux_systrace_args.c
@@ -574,6 +574,14 @@
*n_args = 0;
break;
}
+ /* linux_socketcall */
+ case 102: {
+ struct linux_socketcall_args *p = params;
+ iarg[a++] = p->what; /* l_int */
+ iarg[a++] = p->args; /* l_ulong */
+ *n_args = 2;
+ break;
+ }
/* linux_syslog */
case 103: {
struct linux_syslog_args *p = params;
@@ -3673,6 +3681,19 @@
/* linux_ioperm */
case 101:
break;
+ /* linux_socketcall */
+ case 102:
+ switch (ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
/* linux_syslog */
case 103:
switch (ndx) {
@@ -7677,6 +7698,11 @@
break;
/* linux_ioperm */
case 101:
+ /* linux_socketcall */
+ case 102:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_syslog */
case 103:
if (ndx == 0 || ndx == 1)
diff --git a/sys/powerpc/linux/syscalls.master b/sys/powerpc/linux/syscalls.master
--- a/sys/powerpc/linux/syscalls.master
+++ b/sys/powerpc/linux/syscalls.master
@@ -453,7 +453,12 @@
101 AUE_NULL STD {
int linux_ioperm(void);
}
-102 AUE_NULL UNIMPL linux_socketcall
+102 AUE_NULL STD {
+ int linux_socketcall(
+ l_int what,
+ l_ulong args
+ );
+ }
103 AUE_NULL STD {
int linux_syslog(
l_int type,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 2, 11:49 AM (19 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42141480
Default Alt Text
D62275.1796212169.diff (6 KB)
Attached To
Mode
D62275: linuxulator/powerpc: enable socketcall
Attached
Detach File
Event Timeline