Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163497979
D1032.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D1032.diff
View Options
Index: head/sys/amd64/linux32/linux32_machdep.c
===================================================================
--- head/sys/amd64/linux32/linux32_machdep.c
+++ head/sys/amd64/linux32/linux32_machdep.c
@@ -925,22 +925,6 @@
}
int
-linux_sched_rr_get_interval(struct thread *td,
- struct linux_sched_rr_get_interval_args *uap)
-{
- struct timespec ts;
- struct l_timespec ts32;
- int error;
-
- error = kern_sched_rr_get_interval(td, uap->pid, &ts);
- if (error != 0)
- return (error);
- ts32.tv_sec = ts.tv_sec;
- ts32.tv_nsec = ts.tv_nsec;
- return (copyout(&ts32, uap->interval, sizeof(ts32)));
-}
-
-int
linux_set_thread_area(struct thread *td,
struct linux_set_thread_area_args *args)
{
Index: head/sys/compat/linux/linux_misc.c
===================================================================
--- head/sys/compat/linux/linux_misc.c
+++ head/sys/compat/linux/linux_misc.c
@@ -1928,3 +1928,33 @@
return (sys_cpuset_setaffinity(td, &csa));
}
+
+int
+linux_sched_rr_get_interval(struct thread *td,
+ struct linux_sched_rr_get_interval_args *uap)
+{
+ struct timespec ts;
+ struct l_timespec lts;
+ struct thread *tdt;
+ struct proc *p;
+ int error;
+
+ if (uap->pid == 0) {
+ tdt = td;
+ p = tdt->td_proc;
+ PROC_LOCK(p);
+ } else {
+ p = pfind(uap->pid);
+ if (p == NULL)
+ return (ESRCH);
+ tdt = FIRST_THREAD_IN_PROC(p);
+ }
+
+ error = kern_sched_rr_get_interval_td(td, tdt, &ts);
+ PROC_UNLOCK(p);
+ if (error != 0)
+ return (error);
+ lts.tv_sec = ts.tv_sec;
+ lts.tv_nsec = ts.tv_nsec;
+ return (copyout(<s, uap->interval, sizeof(lts)));
+}
Index: head/sys/kern/p1003_1b.c
===================================================================
--- head/sys/kern/p1003_1b.c
+++ head/sys/kern/p1003_1b.c
@@ -296,13 +296,26 @@
targettd = FIRST_THREAD_IN_PROC(targetp);
}
- e = p_cansee(td, targetp);
- if (e == 0)
- e = ksched_rr_get_interval(ksched, targettd, ts);
+ e = kern_sched_rr_get_interval_td(td, targettd, ts);
PROC_UNLOCK(targetp);
return (e);
}
+int
+kern_sched_rr_get_interval_td(struct thread *td, struct thread *targettd,
+ struct timespec *ts)
+{
+ struct proc *p;
+ int error;
+
+ p = targettd->td_proc;
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+
+ error = p_cansee(td, p);
+ if (error == 0)
+ error = ksched_rr_get_interval(ksched, targettd, ts);
+ return (error);
+}
#endif
static void
Index: head/sys/sys/syscallsubr.h
===================================================================
--- head/sys/sys/syscallsubr.h
+++ head/sys/sys/syscallsubr.h
@@ -171,6 +171,8 @@
enum uio_seg pathseg);
int kern_sched_rr_get_interval(struct thread *td, pid_t pid,
struct timespec *ts);
+int kern_sched_rr_get_interval_td(struct thread *td, struct thread *targettd,
+ struct timespec *ts);
int kern_semctl(struct thread *td, int semid, int semnum, int cmd,
union semun *arg, register_t *rval);
int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 8:10 PM (4 h, 37 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35451964
Default Alt Text
D1032.diff (2 KB)
Attached To
Mode
D1032: In preparation for switching linuxulator to the use the native 1:1 threads refactor kern_sched_rr_get_interval() and sys_sched_rr_get_interval(). Add a kern_sched_rr_get_interval() counterpart which takes a targettd parameter to allow specify...
Attached
Detach File
Event Timeline
Log In to Comment