dde_linux: adjustments for Linux 5.14.1

Issue #4259
This commit is contained in:
Norman Feske 2021-09-07 15:03:19 +02:00
parent e6c915ae06
commit 914a41a8bd
2 changed files with 19 additions and 2 deletions

View File

@ -30,4 +30,6 @@ pte_t pte_swp_clear_soft_dirty(pte_t pte);
pte_t ptep_get(pte_t *ptep);
static inline int is_zero_pfn(unsigned long pfn) { return 0; }
#endif /* __LINUX_PGTABLE_H */

View File

@ -21,12 +21,26 @@
#include <linux/sched/debug.h>
#include <linux/sched/stat.h>
#include <linux/sched/nohz.h>
#include <linux/version.h>
#include <lx_emul/debug.h>
#include <lx_emul/task.h>
#include <../kernel/sched/sched.h>
/*
* Type changes between kernel versions
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,1)
typedef unsigned long nr_iowait_cpu_return_t;
typedef long wait_task_inactive_match_state_t;
#else
typedef unsigned int nr_iowait_cpu_return_t;
typedef unsigned int wait_task_inactive_match_state_t;
#endif
void set_user_nice(struct task_struct * p, long nice)
{
p->static_prio = NICE_TO_PRIO(nice);
@ -118,7 +132,7 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void)
}
unsigned long nr_iowait_cpu(int cpu)
nr_iowait_cpu_return_t nr_iowait_cpu(int cpu)
{
return 0;
}
@ -143,7 +157,8 @@ int sched_setscheduler_nocheck(struct task_struct * p, int policy,
}
unsigned long wait_task_inactive(struct task_struct * p,long match_state)
unsigned long wait_task_inactive(struct task_struct * p,
wait_task_inactive_match_state_t match_state)
{
struct rq *rq = task_rq(p);