Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160734894
D22972.id66180.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D22972.id66180.diff
View Options
Index: sys/amd64/linux/linux_dummy.c
===================================================================
--- sys/amd64/linux/linux_dummy.c
+++ sys/amd64/linux/linux_dummy.c
@@ -102,8 +102,6 @@
DUMMY(vmsplice);
/* Linux 2.6.18: */
DUMMY(move_pages);
-/* Linux 2.6.19: */
-DUMMY(getcpu);
/* Linux 2.6.22: */
DUMMY(signalfd);
/* Linux 2.6.27: */
Index: sys/amd64/linux32/linux32_dummy.c
===================================================================
--- sys/amd64/linux32/linux32_dummy.c
+++ sys/amd64/linux32/linux32_dummy.c
@@ -108,8 +108,6 @@
DUMMY(vmsplice);
/* Linux 2.6.18: */
DUMMY(move_pages);
-/* Linux 2.6.19: */
-DUMMY(getcpu);
/* Linux 2.6.22: */
DUMMY(signalfd);
/* Linux 2.6.27: */
Index: sys/amd64/linux32/linux32_proto.h
===================================================================
--- sys/amd64/linux32/linux32_proto.h
+++ sys/amd64/linux32/linux32_proto.h
@@ -1035,7 +1035,9 @@
register_t dummy;
};
struct linux_getcpu_args {
- register_t dummy;
+ char cpu_l_[PADL_(l_uint *)]; l_uint * cpu; char cpu_r_[PADR_(l_uint *)];
+ char node_l_[PADL_(l_uint *)]; l_uint * node; char node_r_[PADR_(l_uint *)];
+ char cache_l_[PADL_(void *)]; void * cache; char cache_r_[PADR_(void *)];
};
struct linux_epoll_pwait_args {
char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
Index: sys/amd64/linux32/linux32_sysent.c
===================================================================
--- sys/amd64/linux32/linux32_sysent.c
+++ sys/amd64/linux32/linux32_sysent.c
@@ -335,7 +335,7 @@
{ 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_tee */
{ 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */
{ 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */
- { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */
+ { AS(linux_getcpu_args), (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */
{ AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */
{ AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */
{ 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */
Index: sys/amd64/linux32/linux32_systrace_args.c
===================================================================
--- sys/amd64/linux32/linux32_systrace_args.c
+++ sys/amd64/linux32/linux32_systrace_args.c
@@ -2143,7 +2143,11 @@
}
/* linux_getcpu */
case 318: {
- *n_args = 0;
+ struct linux_getcpu_args *p = params;
+ uarg[0] = (intptr_t) p->cpu; /* l_uint * */
+ uarg[1] = (intptr_t) p->node; /* l_uint * */
+ uarg[2] = (intptr_t) p->cache; /* void * */
+ *n_args = 3;
break;
}
/* linux_epoll_pwait */
@@ -6197,6 +6201,19 @@
break;
/* linux_getcpu */
case 318:
+ switch(ndx) {
+ case 0:
+ p = "userland l_uint *";
+ break;
+ case 1:
+ p = "userland l_uint *";
+ break;
+ case 2:
+ p = "userland void *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_epoll_pwait */
case 319:
@@ -8686,6 +8703,9 @@
case 317:
/* linux_getcpu */
case 318:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_epoll_pwait */
case 319:
if (ndx == 0 || ndx == 1)
Index: sys/amd64/linux32/syscalls.master
===================================================================
--- sys/amd64/linux32/syscalls.master
+++ sys/amd64/linux32/syscalls.master
@@ -530,8 +530,8 @@
316 AUE_NULL STD { int linux_vmsplice(void); }
; Linux 2.6.18:
317 AUE_NULL STD { int linux_move_pages(void); }
-; Linux 2.6.19:
-318 AUE_NULL STD { int linux_getcpu(void); }
+318 AUE_NULL STD { int linux_getcpu(l_uint *cpu, l_uint *node, \
+ void *cache); }
319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \
l_int maxevents, l_int timeout, l_sigset_t *mask, \
l_size_t sigsetsize); }
Index: sys/arm64/linux/linux_dummy.c
===================================================================
--- sys/arm64/linux/linux_dummy.c
+++ sys/arm64/linux/linux_dummy.c
@@ -104,8 +104,6 @@
DUMMY(vmsplice);
/* Linux 2.6.18: */
DUMMY(move_pages);
-/* Linux 2.6.19: */
-DUMMY(getcpu);
/* Linux 2.6.27: */
DUMMY(signalfd4);
DUMMY(inotify_init1);
Index: sys/compat/linux/linux_misc.c
===================================================================
--- sys/compat/linux/linux_misc.c
+++ sys/compat/linux/linux_misc.c
@@ -2353,3 +2353,19 @@
td->td_retval[0] = dst - args->buf;
return (error);
}
+
+int
+linux_getcpu(struct thread *td, struct linux_getcpu_args *args)
+{
+ int cpu, error, node;
+
+ cpu = td->td_oncpu; /* Make sure it doesn't change during copyout(9) */
+ error = 0;
+ node = 0; /* XXX: Fake NUMA node 0 for now */
+
+ if (args->cpu != NULL)
+ error = copyout(&cpu, args->cpu, sizeof(l_int));
+ if (args->node != NULL)
+ error = copyout(&node, args->node, sizeof(l_int));
+ return (error);
+}
Index: sys/i386/linux/linux_dummy.c
===================================================================
--- sys/i386/linux/linux_dummy.c
+++ sys/i386/linux/linux_dummy.c
@@ -104,8 +104,6 @@
DUMMY(vmsplice);
/* Linux 2.6.18: */
DUMMY(move_pages);
-/* Linux 2.6.19: */
-DUMMY(getcpu);
/* Linux 2.6.22: */
DUMMY(signalfd);
/* Linux 2.6.27: */
Index: sys/i386/linux/linux_proto.h
===================================================================
--- sys/i386/linux/linux_proto.h
+++ sys/i386/linux/linux_proto.h
@@ -1053,7 +1053,9 @@
register_t dummy;
};
struct linux_getcpu_args {
- register_t dummy;
+ char cpu_l_[PADL_(l_uint *)]; l_uint * cpu; char cpu_r_[PADR_(l_uint *)];
+ char node_l_[PADL_(l_uint *)]; l_uint * node; char node_r_[PADR_(l_uint *)];
+ char cache_l_[PADL_(void *)]; void * cache; char cache_r_[PADR_(void *)];
};
struct linux_epoll_pwait_args {
char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
Index: sys/i386/linux/linux_sysent.c
===================================================================
--- sys/i386/linux/linux_sysent.c
+++ sys/i386/linux/linux_sysent.c
@@ -335,7 +335,7 @@
{ 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_tee */
{ 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */
{ 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */
- { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */
+ { AS(linux_getcpu_args), (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */
{ AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */
{ AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */
{ 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */
Index: sys/i386/linux/linux_systrace_args.c
===================================================================
--- sys/i386/linux/linux_systrace_args.c
+++ sys/i386/linux/linux_systrace_args.c
@@ -2219,7 +2219,11 @@
}
/* linux_getcpu */
case 318: {
- *n_args = 0;
+ struct linux_getcpu_args *p = params;
+ uarg[0] = (intptr_t) p->cpu; /* l_uint * */
+ uarg[1] = (intptr_t) p->node; /* l_uint * */
+ uarg[2] = (intptr_t) p->cache; /* void * */
+ *n_args = 3;
break;
}
/* linux_epoll_pwait */
@@ -6428,6 +6432,19 @@
break;
/* linux_getcpu */
case 318:
+ switch(ndx) {
+ case 0:
+ p = "userland l_uint *";
+ break;
+ case 1:
+ p = "userland l_uint *";
+ break;
+ case 2:
+ p = "userland void *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_epoll_pwait */
case 319:
@@ -8964,6 +8981,9 @@
case 317:
/* linux_getcpu */
case 318:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_epoll_pwait */
case 319:
if (ndx == 0 || ndx == 1)
Index: sys/i386/linux/syscalls.master
===================================================================
--- sys/i386/linux/syscalls.master
+++ sys/i386/linux/syscalls.master
@@ -540,7 +540,8 @@
; Linux 2.6.18:
317 AUE_NULL STD { int linux_move_pages(void); }
; Linux 2.6.19:
-318 AUE_NULL STD { int linux_getcpu(void); }
+318 AUE_NULL STD { int linux_getcpu(l_uint *cpu, l_uint *node, \
+ void *cache); }
319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \
l_int maxevents, l_int timeout, l_sigset_t *mask, \
l_size_t sigsetsize); }
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jun 28, 8:29 AM (22 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34427485
Default Alt Text
D22972.id66180.diff (8 KB)
Attached To
Mode
D22972: Add basic getcpu(2) support to linuxulator
Attached
Detach File
Event Timeline
Log In to Comment