Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
0004  */
0005 
0006 #include <linux/stddef.h>
0007 #include <linux/module.h>
0008 #include <linux/fs.h>
0009 #include <linux/ptrace.h>
0010 #include <linux/sched/mm.h>
0011 #include <linux/sched/task.h>
0012 #include <linux/sched/task_stack.h>
0013 #include <linux/slab.h>
0014 #include <asm/current.h>
0015 #include <asm/processor.h>
0016 #include <linux/uaccess.h>
0017 #include <as-layout.h>
0018 #include <mem_user.h>
0019 #include <registers.h>
0020 #include <skas.h>
0021 #include <os.h>
0022 
0023 void flush_thread(void)
0024 {
0025     void *data = NULL;
0026     int ret;
0027 
0028     arch_flush_thread(&current->thread.arch);
0029 
0030     ret = unmap(&current->mm->context.id, 0, TASK_SIZE, 1, &data);
0031     if (ret) {
0032         printk(KERN_ERR "flush_thread - clearing address space failed, "
0033                "err = %d\n", ret);
0034         force_sig(SIGKILL);
0035     }
0036     get_safe_registers(current_pt_regs()->regs.gp,
0037                current_pt_regs()->regs.fp);
0038 
0039     __switch_mm(&current->mm->context.id);
0040 }
0041 
0042 void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
0043 {
0044     PT_REGS_IP(regs) = eip;
0045     PT_REGS_SP(regs) = esp;
0046     clear_thread_flag(TIF_SINGLESTEP);
0047 #ifdef SUBARCH_EXECVE1
0048     SUBARCH_EXECVE1(regs->regs);
0049 #endif
0050 }
0051 EXPORT_SYMBOL(start_thread);