diff options
| author | Ingo Molnar <mingo@kernel.org> | 2012-12-08 09:25:06 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2012-12-08 09:25:06 -0500 |
| commit | f0b9abfb044649bc452fb2fb975ff2fd599cc6a3 (patch) | |
| tree | 7800081c5cb16a4dfee1e57a70f3be90f7b50d9a /arch/xtensa/kernel/entry.S | |
| parent | adc1ef1e37358d3c17d1a74a58b2e104fc0bda15 (diff) | |
| parent | 1b3c393cd43f22ead8a6a2f839efc6df8ebd7465 (diff) | |
Merge branch 'linus' into perf/core
Conflicts:
tools/perf/Makefile
tools/perf/builtin-test.c
tools/perf/perf.h
tools/perf/tests/parse-events.c
tools/perf/util/evsel.h
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/xtensa/kernel/entry.S')
| -rw-r--r-- | arch/xtensa/kernel/entry.S | 57 |
1 files changed, 13 insertions, 44 deletions
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 18453067c258..90bfc1dbc13d 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
| @@ -1833,50 +1833,6 @@ ENTRY(system_call) | |||
| 1833 | 1833 | ||
| 1834 | 1834 | ||
| 1835 | /* | 1835 | /* |
| 1836 | * Create a kernel thread | ||
| 1837 | * | ||
| 1838 | * int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | ||
| 1839 | * a2 a2 a3 a4 | ||
| 1840 | */ | ||
| 1841 | |||
| 1842 | ENTRY(kernel_thread) | ||
| 1843 | entry a1, 16 | ||
| 1844 | |||
| 1845 | mov a5, a2 # preserve fn over syscall | ||
| 1846 | mov a7, a3 # preserve args over syscall | ||
| 1847 | |||
| 1848 | movi a3, _CLONE_VM | _CLONE_UNTRACED | ||
| 1849 | movi a2, __NR_clone | ||
| 1850 | or a6, a4, a3 # arg0: flags | ||
| 1851 | mov a3, a1 # arg1: sp | ||
| 1852 | syscall | ||
| 1853 | |||
| 1854 | beq a3, a1, 1f # branch if parent | ||
| 1855 | mov a6, a7 # args | ||
| 1856 | callx4 a5 # fn(args) | ||
| 1857 | |||
| 1858 | movi a2, __NR_exit | ||
| 1859 | syscall # return value of fn(args) still in a6 | ||
| 1860 | |||
| 1861 | 1: retw | ||
| 1862 | |||
| 1863 | /* | ||
| 1864 | * Do a system call from kernel instead of calling sys_execve, so we end up | ||
| 1865 | * with proper pt_regs. | ||
| 1866 | * | ||
| 1867 | * int kernel_execve(const char *fname, char *const argv[], charg *const envp[]) | ||
| 1868 | * a2 a2 a3 a4 | ||
| 1869 | */ | ||
| 1870 | |||
| 1871 | ENTRY(kernel_execve) | ||
| 1872 | entry a1, 16 | ||
| 1873 | mov a6, a2 # arg0 is in a6 | ||
| 1874 | movi a2, __NR_execve | ||
| 1875 | syscall | ||
| 1876 | |||
| 1877 | retw | ||
| 1878 | |||
| 1879 | /* | ||
| 1880 | * Task switch. | 1836 | * Task switch. |
| 1881 | * | 1837 | * |
| 1882 | * struct task* _switch_to (struct task* prev, struct task* next) | 1838 | * struct task* _switch_to (struct task* prev, struct task* next) |
| @@ -1958,3 +1914,16 @@ ENTRY(ret_from_fork) | |||
| 1958 | 1914 | ||
| 1959 | j common_exception_return | 1915 | j common_exception_return |
| 1960 | 1916 | ||
| 1917 | /* | ||
| 1918 | * Kernel thread creation helper | ||
| 1919 | * On entry, set up by copy_thread: a2 = thread_fn, a3 = thread_fn arg | ||
| 1920 | * left from _switch_to: a6 = prev | ||
| 1921 | */ | ||
| 1922 | ENTRY(ret_from_kernel_thread) | ||
| 1923 | |||
| 1924 | call4 schedule_tail | ||
| 1925 | mov a6, a3 | ||
| 1926 | callx4 a2 | ||
| 1927 | j common_exception_return | ||
| 1928 | |||
| 1929 | ENDPROC(ret_from_kernel_thread) | ||
