diff options
Diffstat (limited to 'arch/c6x')
-rw-r--r-- | arch/c6x/Kconfig | 1 | ||||
-rw-r--r-- | arch/c6x/Makefile | 2 | ||||
-rw-r--r-- | arch/c6x/boot/Makefile | 20 | ||||
-rw-r--r-- | arch/c6x/boot/dts/Makefile | 20 | ||||
-rw-r--r-- | arch/c6x/boot/dts/linked_dtb.S | 2 | ||||
-rw-r--r-- | arch/c6x/boot/linked_dtb.S | 2 | ||||
-rw-r--r-- | arch/c6x/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/c6x/include/asm/syscalls.h | 4 | ||||
-rw-r--r-- | arch/c6x/include/uapi/asm/unistd.h | 2 | ||||
-rw-r--r-- | arch/c6x/kernel/entry.S | 24 | ||||
-rw-r--r-- | arch/c6x/kernel/process.c | 25 |
11 files changed, 32 insertions, 71 deletions
diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig index aee1b569ee6e..66eab3703c75 100644 --- a/arch/c6x/Kconfig +++ b/arch/c6x/Kconfig | |||
@@ -18,6 +18,7 @@ config C6X | |||
18 | select OF_EARLY_FLATTREE | 18 | select OF_EARLY_FLATTREE |
19 | select GENERIC_CLOCKEVENTS | 19 | select GENERIC_CLOCKEVENTS |
20 | select GENERIC_KERNEL_THREAD | 20 | select GENERIC_KERNEL_THREAD |
21 | select GENERIC_KERNEL_EXECVE | ||
21 | select MODULES_USE_ELF_RELA | 22 | select MODULES_USE_ELF_RELA |
22 | 23 | ||
23 | config MMU | 24 | config MMU |
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile index a9eb9597e03c..e72eb3417239 100644 --- a/arch/c6x/Makefile +++ b/arch/c6x/Makefile | |||
@@ -41,7 +41,7 @@ DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS))) | |||
41 | export DTB | 41 | export DTB |
42 | 42 | ||
43 | ifneq ($(DTB),) | 43 | ifneq ($(DTB),) |
44 | core-y += $(boot)/ | 44 | core-y += $(boot)/dts/ |
45 | endif | 45 | endif |
46 | 46 | ||
47 | # With make 3.82 we cannot mix normal and wildcard targets | 47 | # With make 3.82 we cannot mix normal and wildcard targets |
diff --git a/arch/c6x/boot/Makefile b/arch/c6x/boot/Makefile index 6891257d514c..8734abee548e 100644 --- a/arch/c6x/boot/Makefile +++ b/arch/c6x/boot/Makefile | |||
@@ -6,25 +6,5 @@ OBJCOPYFLAGS_vmlinux.bin := -O binary | |||
6 | $(obj)/vmlinux.bin: vmlinux FORCE | 6 | $(obj)/vmlinux.bin: vmlinux FORCE |
7 | $(call if_changed,objcopy) | 7 | $(call if_changed,objcopy) |
8 | 8 | ||
9 | DTC_FLAGS ?= -p 1024 | ||
10 | |||
11 | ifneq ($(DTB),) | ||
12 | obj-y += linked_dtb.o | ||
13 | endif | ||
14 | |||
15 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE | ||
16 | $(call if_changed_dep,dtc) | ||
17 | |||
18 | quiet_cmd_cp = CP $< $@$2 | ||
19 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) | ||
20 | |||
21 | # Generate builtin.dtb from $(DTB).dtb | ||
22 | $(obj)/builtin.dtb: $(obj)/$(DTB).dtb | ||
23 | $(call if_changed,cp) | ||
24 | |||
25 | $(obj)/linked_dtb.o: $(obj)/builtin.dtb | ||
26 | |||
27 | $(obj)/dtbImage.%: vmlinux | 9 | $(obj)/dtbImage.%: vmlinux |
28 | $(call if_changed,objcopy) | 10 | $(call if_changed,objcopy) |
29 | |||
30 | clean-files := $(obj)/*.dtb | ||
diff --git a/arch/c6x/boot/dts/Makefile b/arch/c6x/boot/dts/Makefile new file mode 100644 index 000000000000..c7528b02d061 --- /dev/null +++ b/arch/c6x/boot/dts/Makefile | |||
@@ -0,0 +1,20 @@ | |||
1 | # | ||
2 | # Makefile for device trees | ||
3 | # | ||
4 | |||
5 | DTC_FLAGS ?= -p 1024 | ||
6 | |||
7 | ifneq ($(DTB),) | ||
8 | obj-y += linked_dtb.o | ||
9 | endif | ||
10 | |||
11 | quiet_cmd_cp = CP $< $@$2 | ||
12 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) | ||
13 | |||
14 | # Generate builtin.dtb from $(DTB).dtb | ||
15 | $(obj)/builtin.dtb: $(obj)/$(DTB).dtb | ||
16 | $(call if_changed,cp) | ||
17 | |||
18 | $(obj)/linked_dtb.o: $(obj)/builtin.dtb | ||
19 | |||
20 | clean-files := *.dtb | ||
diff --git a/arch/c6x/boot/dts/linked_dtb.S b/arch/c6x/boot/dts/linked_dtb.S new file mode 100644 index 000000000000..cf347f1d16ce --- /dev/null +++ b/arch/c6x/boot/dts/linked_dtb.S | |||
@@ -0,0 +1,2 @@ | |||
1 | .section __fdt_blob,"a" | ||
2 | .incbin "arch/c6x/boot/dts/builtin.dtb" | ||
diff --git a/arch/c6x/boot/linked_dtb.S b/arch/c6x/boot/linked_dtb.S deleted file mode 100644 index 57a4454eaec3..000000000000 --- a/arch/c6x/boot/linked_dtb.S +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | .section __fdt_blob,"a" | ||
2 | .incbin "arch/c6x/boot/builtin.dtb" | ||
diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index 112a496d8355..eae7b5963e86 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild | |||
@@ -49,6 +49,7 @@ generic-y += termbits.h | |||
49 | generic-y += termios.h | 49 | generic-y += termios.h |
50 | generic-y += tlbflush.h | 50 | generic-y += tlbflush.h |
51 | generic-y += topology.h | 51 | generic-y += topology.h |
52 | generic-y += trace_clock.h | ||
52 | generic-y += types.h | 53 | generic-y += types.h |
53 | generic-y += ucontext.h | 54 | generic-y += ucontext.h |
54 | generic-y += user.h | 55 | generic-y += user.h |
diff --git a/arch/c6x/include/asm/syscalls.h b/arch/c6x/include/asm/syscalls.h index e7b8991dc07c..df3d05feb153 100644 --- a/arch/c6x/include/asm/syscalls.h +++ b/arch/c6x/include/asm/syscalls.h | |||
@@ -41,10 +41,6 @@ extern long sys_fallocate_c6x(int fd, int mode, | |||
41 | u32 len_lo, u32 len_hi); | 41 | u32 len_lo, u32 len_hi); |
42 | extern int sys_cache_sync(unsigned long s, unsigned long e); | 42 | extern int sys_cache_sync(unsigned long s, unsigned long e); |
43 | 43 | ||
44 | struct pt_regs; | ||
45 | |||
46 | extern asmlinkage long sys_c6x_clone(struct pt_regs *regs); | ||
47 | |||
48 | #include <asm-generic/syscalls.h> | 44 | #include <asm-generic/syscalls.h> |
49 | 45 | ||
50 | #endif /* __ASM_C6X_SYSCALLS_H */ | 46 | #endif /* __ASM_C6X_SYSCALLS_H */ |
diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h index 4ff747d12dad..f3987a8703d9 100644 --- a/arch/c6x/include/uapi/asm/unistd.h +++ b/arch/c6x/include/uapi/asm/unistd.h | |||
@@ -14,8 +14,8 @@ | |||
14 | * more details. | 14 | * more details. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define __ARCH_WANT_KERNEL_EXECVE | ||
18 | #define __ARCH_WANT_SYS_EXECVE | 17 | #define __ARCH_WANT_SYS_EXECVE |
18 | #define __ARCH_WANT_SYS_CLONE | ||
19 | 19 | ||
20 | /* Use the standard ABI for syscalls. */ | 20 | /* Use the standard ABI for syscalls. */ |
21 | #include <asm-generic/unistd.h> | 21 | #include <asm-generic/unistd.h> |
diff --git a/arch/c6x/kernel/entry.S b/arch/c6x/kernel/entry.S index 0ed6157dd256..5239057de4c4 100644 --- a/arch/c6x/kernel/entry.S +++ b/arch/c6x/kernel/entry.S | |||
@@ -415,19 +415,9 @@ ENTRY(ret_from_kernel_thread) | |||
415 | 0: | 415 | 0: |
416 | B .S2 B10 /* call fn */ | 416 | B .S2 B10 /* call fn */ |
417 | LDW .D2T1 *+SP(REGS_A1+8),A4 /* get arg */ | 417 | LDW .D2T1 *+SP(REGS_A1+8),A4 /* get arg */ |
418 | MVKL .S2 sys_exit,B11 | 418 | ADDKPC .S2 ret_from_fork_2,B3,3 |
419 | MVKH .S2 sys_exit,B11 | ||
420 | ADDKPC .S2 0f,B3,1 | ||
421 | 0: | ||
422 | BNOP .S2 B11,5 /* jump to sys_exit */ | ||
423 | ENDPROC(ret_from_kernel_thread) | 419 | ENDPROC(ret_from_kernel_thread) |
424 | 420 | ||
425 | ENTRY(ret_from_kernel_execve) | ||
426 | GET_THREAD_INFO A12 | ||
427 | BNOP .S2 syscall_exit,4 | ||
428 | ADD .D2X A4,-8,SP | ||
429 | ENDPROC(ret_from_kernel_execve) | ||
430 | |||
431 | ;; | 421 | ;; |
432 | ;; These are the interrupt handlers, responsible for calling c6x_do_IRQ() | 422 | ;; These are the interrupt handlers, responsible for calling c6x_do_IRQ() |
433 | ;; | 423 | ;; |
@@ -624,18 +614,6 @@ ENDPROC(sys_sigaltstack) | |||
624 | ;; Special system calls | 614 | ;; Special system calls |
625 | ;; return address is in B3 | 615 | ;; return address is in B3 |
626 | ;; | 616 | ;; |
627 | ENTRY(sys_clone) | ||
628 | ADD .D1X SP,8,A4 | ||
629 | #ifdef CONFIG_C6X_BIG_KERNEL | ||
630 | || MVKL .S1 sys_c6x_clone,A0 | ||
631 | MVKH .S1 sys_c6x_clone,A0 | ||
632 | BNOP .S2X A0,5 | ||
633 | #else | ||
634 | || B .S2 sys_c6x_clone | ||
635 | NOP 5 | ||
636 | #endif | ||
637 | ENDPROC(sys_clone) | ||
638 | |||
639 | ENTRY(sys_rt_sigreturn) | 617 | ENTRY(sys_rt_sigreturn) |
640 | ADD .D1X SP,8,A4 | 618 | ADD .D1X SP,8,A4 |
641 | #ifdef CONFIG_C6X_BIG_KERNEL | 619 | #ifdef CONFIG_C6X_BIG_KERNEL |
diff --git a/arch/c6x/kernel/process.c b/arch/c6x/kernel/process.c index 2770d9a9a84e..6434df476f77 100644 --- a/arch/c6x/kernel/process.c +++ b/arch/c6x/kernel/process.c | |||
@@ -112,22 +112,6 @@ void exit_thread(void) | |||
112 | { | 112 | { |
113 | } | 113 | } |
114 | 114 | ||
115 | SYSCALL_DEFINE1(c6x_clone, struct pt_regs *, regs) | ||
116 | { | ||
117 | unsigned long clone_flags; | ||
118 | unsigned long newsp; | ||
119 | |||
120 | /* syscall puts clone_flags in A4 and usp in B4 */ | ||
121 | clone_flags = regs->orig_a4; | ||
122 | if (regs->b4) | ||
123 | newsp = regs->b4; | ||
124 | else | ||
125 | newsp = regs->sp; | ||
126 | |||
127 | return do_fork(clone_flags, newsp, regs, 0, (int __user *)regs->a6, | ||
128 | (int __user *)regs->b6); | ||
129 | } | ||
130 | |||
131 | /* | 115 | /* |
132 | * Do necessary setup to start up a newly executed thread. | 116 | * Do necessary setup to start up a newly executed thread. |
133 | */ | 117 | */ |
@@ -155,13 +139,13 @@ void start_thread(struct pt_regs *regs, unsigned int pc, unsigned long usp) | |||
155 | */ | 139 | */ |
156 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 140 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
157 | unsigned long ustk_size, | 141 | unsigned long ustk_size, |
158 | struct task_struct *p, struct pt_regs *regs) | 142 | struct task_struct *p) |
159 | { | 143 | { |
160 | struct pt_regs *childregs; | 144 | struct pt_regs *childregs; |
161 | 145 | ||
162 | childregs = task_pt_regs(p); | 146 | childregs = task_pt_regs(p); |
163 | 147 | ||
164 | if (!regs) { | 148 | if (unlikely(p->flags & PF_KTHREAD)) { |
165 | /* case of __kernel_thread: we return to supervisor space */ | 149 | /* case of __kernel_thread: we return to supervisor space */ |
166 | memset(childregs, 0, sizeof(struct pt_regs)); | 150 | memset(childregs, 0, sizeof(struct pt_regs)); |
167 | childregs->sp = (unsigned long)(childregs + 1); | 151 | childregs->sp = (unsigned long)(childregs + 1); |
@@ -170,8 +154,9 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
170 | childregs->a1 = ustk_size; /* argument */ | 154 | childregs->a1 = ustk_size; /* argument */ |
171 | } else { | 155 | } else { |
172 | /* Otherwise use the given stack */ | 156 | /* Otherwise use the given stack */ |
173 | *childregs = *regs; | 157 | *childregs = *current_pt_regs(); |
174 | childregs->sp = usp; | 158 | if (usp) |
159 | childregs->sp = usp; | ||
175 | p->thread.pc = (unsigned long) ret_from_fork; | 160 | p->thread.pc = (unsigned long) ret_from_fork; |
176 | } | 161 | } |
177 | 162 | ||