LinuxKPI: Implement sched_set_fifo(_low) functions
Required by: drm-kmod MFC after: 1 week Reviewed by: hselasky, manu Differential Revision: https://reviews.freebsd.org/D35050
This commit is contained in:
parent
1ebd7aeeca
commit
0093bc3cd1
@ -34,6 +34,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/rtprio.h>
|
||||
#include <sys/sched.h>
|
||||
#include <sys/sleepqueue.h>
|
||||
#include <sys/time.h>
|
||||
@ -217,4 +218,24 @@ get_task_comm(char *buf, struct task_struct *task)
|
||||
return (task->comm);
|
||||
}
|
||||
|
||||
static inline void
|
||||
sched_set_fifo(struct task_struct *t)
|
||||
{
|
||||
struct rtprio rtp;
|
||||
|
||||
rtp.prio = (RTP_PRIO_MIN + RTP_PRIO_MAX) / 2;
|
||||
rtp.type = RTP_PRIO_FIFO;
|
||||
rtp_to_pri(&rtp, t->task_thread);
|
||||
}
|
||||
|
||||
static inline void
|
||||
sched_set_fifo_low(struct task_struct *t)
|
||||
{
|
||||
struct rtprio rtp;
|
||||
|
||||
rtp.prio = RTP_PRIO_MAX; /* lowest priority */
|
||||
rtp.type = RTP_PRIO_FIFO;
|
||||
rtp_to_pri(&rtp, t->task_thread);
|
||||
}
|
||||
|
||||
#endif /* _LINUXKPI_LINUX_SCHED_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user