BuildRequires: perl
BuildRequires: python
%ifarch %{arm}
- BuildRequires: kernel-devel
- %define build_arch arm
- %define kernel_path /usr/src/linux-kernel-build-3.0.101-trats2_defconfig
- %else
- %define build_arch i386
+ %if "%{?tizen_profile_name}" == "tv"
+ BuildConflicts: vd_kernel-headers
+ BuildRequires: tztv-hawk-kmodules-devel
+ %define build_arch arm
+ %define kernel_path /usr/include/kernel_header/debug
+ %else
+ %if "%{?tizen_profile_name}" == "mobile"
+ ExcludeArch: %{arm}
+ %else
+ %if "%{?tizen_profile_name}" == "wearable"
+ ExcludeArch: %{arm}
+ %endif
+ %endif
+ %endif
+ %else #i386
+ %define build_arch i386
BuildRequires: emulator-kernel-devel
- %define kernel_path /usr/src/linux-kernel-build-3.14.25
+ %define kernel_path /usr/src/linux-kernel-build-3.14.25
%endif
+
Provides: swap-modules
%description
Kernel modules for SWAP
install -m 666 fbiprobe/swap_fbiprobe.ko -t %{buildroot}/opt/swap/sdk
install -m 666 wsp/swap_wsp.ko -t %{buildroot}/opt/swap/sdk
install -m 666 nsp/swap_nsp.ko -t %{buildroot}/opt/swap/sdk
+install -m 666 task_ctx/swap_taskctx.ko -t %{buildroot}/opt/swap/sdk
mkdir -p %{buildroot}/usr/share/license
cp LICENSE.GPL-2.0+ %{buildroot}/usr/share/license/%{name}
/opt/swap/sdk/swap_fbiprobe.ko
/opt/swap/sdk/swap_wsp.ko
/opt/swap/sdk/swap_nsp.ko
+/opt/swap/sdk/swap_taskctx.ko
-#ifdef CONFIG_ARM
-/*
- ******************************************************************************
- * workaround for already running *
- ******************************************************************************
- */
-static unsigned long cb_check_and_install(void *data);
-
-static int ctx_task_pre_handler(struct kprobe *p, struct pt_regs *regs)
-{
- int ret;
- struct sspt_proc *proc;
- struct task_struct *task = current;
-
- if (is_kthread(task) || check_task_on_filters(task) == 0)
- return 0;
-
- proc = sspt_proc_get_by_task(task);
- if (proc && proc->first_install)
- return 0;
-
- ret = set_kjump_cb(regs, cb_check_and_install, NULL, 0);
- if (ret < 0)
- pr_err("ctx_task_pre_handler: ret=%d\n", ret);
-
- return 0;
-}
-
-static struct kprobe ctx_task_kprobe = {
- .pre_handler = ctx_task_pre_handler,
-};
-
-static int register_ctx_task(void)
-{
- int ret = 0;
-
- ret = swap_register_kprobe(&ctx_task_kprobe);
- if (ret)
- printk(KERN_INFO "swap_register_kprobe(workaround) ret=%d!\n",
- ret);
-
- return ret;
-}
-
-static void unregister_ctx_task(void)
-{
- swap_unregister_kprobe(&ctx_task_kprobe);
-}
-#endif /* CONFIG_ARM */
-
-
-
-
-
/*
******************************************************************************
* copy_process() *
struct hlist_head *head = (struct hlist_head *)data;
struct uprobe *up;
- up = probe_info_get_uprobe(ip->info, ip);
+ up = probe_info_get_uprobe(ip->desc->type, ip);
if (up) {
struct uinst_info *uinst;
- unsigned long vaddr = (unsigned long)up->kp.addr;
+ unsigned long vaddr = (unsigned long)up->addr;
- uinst = uinst_info_create(vaddr, up->kp.opcode);
+ uinst = uinst_info_create(vaddr, up->opcode);
if (uinst)
hlist_add_head(&uinst->hlist, head);
}
static void __remove_unmap_probes(struct sspt_proc *proc,
struct unmap_data *umd)
{
- struct task_struct *task = proc->task;
unsigned long start = umd->start;
- size_t len = PAGE_ALIGN(umd->len);
+ size_t len = umd->len;
LIST_HEAD(head);
if (sspt_proc_get_files_by_region(proc, &head, start, len)) {
struct sspt_file *file, *n;
unsigned long end = start + len;
- struct msg_unmap_data msg_data = {
- .start = start,
- .end = end
- };
+ struct task_struct *task = proc->task;
list_for_each_entry_safe(file, n, &head, list) {
if (file->vm_start >= end)
}
sspt_proc_insert_files(proc, &head);
-
- sspt_proc_on_each_filter(proc, msg_unmap, (void *)&msg_data);
}
}
sspt_proc_write_lock();
proc = sspt_proc_get_by_task_no_lock(task);
- if (proc)
+ if (proc) {
+ struct msg_unmap_data msg_data = {
+ .start = umd->start,
+ .end = umd->start + umd->len,
+ };
+
__remove_unmap_probes(proc, umd);
+ /* send unmap region */
+ sspt_proc_on_each_filter(proc, msg_unmap, (void *)&msg_data);
+ }
+
sspt_proc_write_unlock();
}
atomic_inc(&unmap_cnt);
data->start = swap_get_karg(regs, 1);
- data->len = (size_t)swap_get_karg(regs, 2);
+ data->len = (size_t)PAGE_ALIGN(swap_get_karg(regs, 2));
if (!is_kthread(task) && atomic_read(&stop_flag))
remove_unmap_probes(task, data);
if (ret)
goto unreg_mmap;
-#ifdef CONFIG_ARM
- /* install probe to detect already running process */
- ret = register_ctx_task();
- if (ret)
- goto unreg_mf;
-#endif /* CONFIG_ARM */
-
return ret;
-#ifdef CONFIG_ARM
-unreg_mf:
- unregister_mf();
-#endif /* CONFIG_ARM */
-
unreg_mmap:
unregister_mmap();
*/
void unregister_helper_top(void)
{
-#ifdef CONFIG_ARM
- unregister_ctx_task();
-#endif /* CONFIG_ARM */
unregister_mf();
atomic_set(&stop_flag, 1);
}
if (comm_kretprobe.kp.addr == NULL)
goto not_found;
-#ifdef CONFIG_ARM
- sym = "ret_to_user";
- ctx_task_kprobe.addr = (kprobe_opcode_t *)swap_ksyms(sym);
- if (ctx_task_kprobe.addr == NULL)
- goto not_found;
-#endif /* CONFIG_ARM */
-
return 0;
not_found: