From 50b23c8d3b665286ecce14c774996736b1805197 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Mon, 16 Oct 2017 20:58:18 +0300 Subject: [PATCH] KI: add kernel patch for CONFIG_SWAP_HOOK_SWITCH_TO support Change-Id: Id47af2199f79dcba96f2a65a3d26d5e7490f9e90 Signed-off-by: Vyacheslav Cherkashin --- ...06-SWAP-DA-add-CONFIG_SWAP_HOOK_SWITCH_TO.patch | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 kernel_integration/patches/0006-SWAP-DA-add-CONFIG_SWAP_HOOK_SWITCH_TO.patch diff --git a/kernel_integration/patches/0006-SWAP-DA-add-CONFIG_SWAP_HOOK_SWITCH_TO.patch b/kernel_integration/patches/0006-SWAP-DA-add-CONFIG_SWAP_HOOK_SWITCH_TO.patch new file mode 100644 index 0000000..85a5b09 --- /dev/null +++ b/kernel_integration/patches/0006-SWAP-DA-add-CONFIG_SWAP_HOOK_SWITCH_TO.patch @@ -0,0 +1,51 @@ +From f96db429459c92474c26e49988d5fb5da0e23972 Mon Sep 17 00:00:00 2001 +From: Your Name +Date: Thu, 5 Oct 2017 10:19:51 +0300 +Subject: [PATCH 6/9] SWAP-DA: add CONFIG_SWAP_HOOK_SWITCH_TO + +--- + include/swap/hook_switch_to.h | 11 +++++++++++ + kernel/sched/core.c | 2 ++ + 2 files changed, 13 insertions(+) + create mode 100644 include/swap/hook_switch_to.h + +diff --git a/include/swap/hook_switch_to.h b/include/swap/hook_switch_to.h +new file mode 100644 +index 0000000..44bf883 +--- /dev/null ++++ b/include/swap/hook_switch_to.h +@@ -0,0 +1,11 @@ ++#ifndef _LINUX_SWAP_HOOK_SWITCH_TO_H ++#define _LINUX_SWAP_HOOK_SWITCH_TO_H ++ ++ ++static inline void swap_hook_switch_to(struct task_struct *prev, ++ struct task_struct *next) ++{ ++} ++ ++ ++#endif /* _LINUX_SWAP_HOOK_SWITCH_TO_H */ +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index c8e2fdd..3b9bd84 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -50,6 +50,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -2393,6 +2394,7 @@ context_switch(struct rq *rq, struct task_struct *prev, + spin_release(&rq->lock.dep_map, 1, _THIS_IP_); + + context_tracking_task_switch(prev, next); ++ swap_hook_switch_to(prev, next); + /* Here we just switch the register state and the stack. */ + switch_to(prev, next, prev); + +-- +2.1.4 + -- 2.7.4