diff options
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/Kconfig | 1 | ||||
-rw-r--r-- | arch/microblaze/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/microblaze/include/asm/delay.h | 28 | ||||
-rw-r--r-- | arch/microblaze/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/microblaze/include/asm/scatterlist.h | 1 | ||||
-rw-r--r-- | arch/microblaze/include/uapi/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/microblaze/kernel/ftrace.c | 3 | ||||
-rw-r--r-- | arch/microblaze/kernel/mcount.S | 5 | ||||
-rw-r--r-- | arch/microblaze/kernel/signal.c | 55 | ||||
-rw-r--r-- | arch/microblaze/kernel/syscall_table.S | 3 | ||||
-rw-r--r-- | arch/microblaze/lib/Makefile | 14 |
11 files changed, 52 insertions, 61 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 9ae0854..40e1c1d 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -22,7 +22,6 @@ config MICROBLAZE select HAVE_DYNAMIC_FTRACE select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_GRAPH_TRACER - select HAVE_FUNCTION_TRACE_MCOUNT_TEST select HAVE_FUNCTION_TRACER select HAVE_MEMBLOCK select HAVE_MEMBLOCK_NODE_MAP diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild index 35b3ecaf..27a3acd 100644 --- a/arch/microblaze/include/asm/Kbuild +++ b/arch/microblaze/include/asm/Kbuild @@ -7,5 +7,6 @@ generic-y += exec.h generic-y += hash.h generic-y += mcs_spinlock.h generic-y += preempt.h +generic-y += scatterlist.h generic-y += syscalls.h generic-y += trace_clock.h diff --git a/arch/microblaze/include/asm/delay.h b/arch/microblaze/include/asm/delay.h index 66fc24c..60cb39d 100644 --- a/arch/microblaze/include/asm/delay.h +++ b/arch/microblaze/include/asm/delay.h @@ -61,13 +61,29 @@ extern inline void __udelay(unsigned int x) extern void __bad_udelay(void); /* deliberately undefined */ extern void __bad_ndelay(void); /* deliberately undefined */ -#define udelay(n) (__builtin_constant_p(n) ? \ - ((n) > __MAX_UDELAY ? __bad_udelay() : __udelay((n) * (19 * HZ))) : \ - __udelay((n) * (19 * HZ))) +#define udelay(n) \ + ({ \ + if (__builtin_constant_p(n)) { \ + if ((n) / __MAX_UDELAY >= 1) \ + __bad_udelay(); \ + else \ + __udelay((n) * (19 * HZ)); \ + } else { \ + __udelay((n) * (19 * HZ)); \ + } \ + }) -#define ndelay(n) (__builtin_constant_p(n) ? \ - ((n) > __MAX_NDELAY ? __bad_ndelay() : __udelay((n) * HZ)) : \ - __udelay((n) * HZ)) +#define ndelay(n) \ + ({ \ + if (__builtin_constant_p(n)) { \ + if ((n) / __MAX_NDELAY >= 1) \ + __bad_ndelay(); \ + else \ + __udelay((n) * HZ); \ + } else { \ + __udelay((n) * HZ); \ + } \ + }) #define muldiv(a, b, c) (((a)*(b))/(c)) diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h index 9d31b05..497a988 100644 --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h @@ -22,6 +22,7 @@ extern const struct seq_operations cpuinfo_op; # define cpu_relax() barrier() +# define cpu_relax_lowlatency() cpu_relax() #define task_pt_regs(tsk) \ (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1) diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h deleted file mode 100644 index 35d786f..0000000 --- a/arch/microblaze/include/asm/scatterlist.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/scatterlist.h> diff --git a/arch/microblaze/include/uapi/asm/unistd.h b/arch/microblaze/include/uapi/asm/unistd.h index 8d0791b..4e1ddc9 100644 --- a/arch/microblaze/include/uapi/asm/unistd.h +++ b/arch/microblaze/include/uapi/asm/unistd.h @@ -398,5 +398,6 @@ #define __NR_finit_module 380 #define __NR_sched_setattr 381 #define __NR_sched_getattr 382 +#define __NR_renameat2 383 #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ diff --git a/arch/microblaze/kernel/ftrace.c b/arch/microblaze/kernel/ftrace.c index bbcd253..fc7b48a 100644 --- a/arch/microblaze/kernel/ftrace.c +++ b/arch/microblaze/kernel/ftrace.c @@ -27,6 +27,9 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) unsigned long return_hooker = (unsigned long) &return_to_handler; + if (unlikely(ftrace_graph_is_dead())) + return; + if (unlikely(atomic_read(¤t->tracing_graph_pause))) return; diff --git a/arch/microblaze/kernel/mcount.S b/arch/microblaze/kernel/mcount.S index fc1e132..fed9da5 100644 --- a/arch/microblaze/kernel/mcount.S +++ b/arch/microblaze/kernel/mcount.S @@ -91,11 +91,6 @@ ENTRY(ftrace_caller) #endif /* CONFIG_DYNAMIC_FTRACE */ SAVE_REGS swi r15, r1, 0; - /* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST begin of checking */ - lwi r5, r0, function_trace_stop; - bneid r5, end; - nop; - /* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST end of checking */ #ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifndef CONFIG_DYNAMIC_FTRACE lwi r5, r0, ftrace_graph_return; diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 49a07a4..8955a38 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -145,22 +145,19 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, * Determine which stack to use.. */ static inline void __user * -get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) +get_sigframe(struct ksignal *ksig, struct pt_regs *regs, size_t frame_size) { /* Default to using normal stack */ - unsigned long sp = regs->r1; - - if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && !on_sig_stack(sp)) - sp = current->sas_ss_sp + current->sas_ss_size; + unsigned long sp = sigsp(regs->r1, ksig); return (void __user *)((sp - frame_size) & -8UL); } -static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, - sigset_t *set, struct pt_regs *regs) +static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, + struct pt_regs *regs) { struct rt_sigframe __user *frame; - int err = 0; + int err = 0, sig = ksig->sig; int signal; unsigned long address = 0; #ifdef CONFIG_MMU @@ -168,10 +165,10 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, pte_t *ptep; #endif - frame = get_sigframe(ka, regs, sizeof(*frame)); + frame = get_sigframe(ksig, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) - goto give_sigsegv; + return -EFAULT; signal = current_thread_info()->exec_domain && current_thread_info()->exec_domain->signal_invmap @@ -179,8 +176,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ? current_thread_info()->exec_domain->signal_invmap[sig] : sig; - if (info) - err |= copy_siginfo_to_user(&frame->info, info); + if (ksig->ka.sa.sa_flags & SA_SIGINFO) + err |= copy_siginfo_to_user(&frame->info, &ksig->info); /* Create the ucontext. */ err |= __put_user(0, &frame->uc.uc_flags); @@ -227,7 +224,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, flush_dcache_range(address, address + 8); #endif if (err) - goto give_sigsegv; + return -EFAULT; /* Set up registers for signal handler */ regs->r1 = (unsigned long) frame; @@ -237,7 +234,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, regs->r6 = (unsigned long) &frame->info; /* arg 1: siginfo */ regs->r7 = (unsigned long) &frame->uc; /* arg2: ucontext */ /* Offset to handle microblaze rtid r14, 0 */ - regs->pc = (unsigned long)ka->sa.sa_handler; + regs->pc = (unsigned long)ksig->ka.sa.sa_handler; set_fs(USER_DS); @@ -247,10 +244,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, #endif return 0; - -give_sigsegv: - force_sigsegv(sig, current); - return -EFAULT; } /* Handle restarting system calls */ @@ -283,23 +276,15 @@ do_restart: */ static void -handle_signal(unsigned long sig, struct k_sigaction *ka, - siginfo_t *info, struct pt_regs *regs) +handle_signal(struct ksignal *ksig, struct pt_regs *regs) { sigset_t *oldset = sigmask_to_save(); int ret; /* Set up the stack frame */ - if (ka->sa.sa_flags & SA_SIGINFO) - ret = setup_rt_frame(sig, ka, info, oldset, regs); - else - ret = setup_rt_frame(sig, ka, NULL, oldset, regs); + ret = setup_rt_frame(ksig, oldset, regs); - if (ret) - return; - - signal_delivered(sig, info, ka, regs, - test_thread_flag(TIF_SINGLESTEP)); + signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLESTEP)); } /* @@ -313,21 +298,19 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, */ static void do_signal(struct pt_regs *regs, int in_syscall) { - siginfo_t info; - int signr; - struct k_sigaction ka; + struct ksignal ksig; + #ifdef DEBUG_SIG pr_info("do signal: %p %d\n", regs, in_syscall); pr_info("do signal2: %lx %lx %ld [%lx]\n", regs->pc, regs->r1, regs->r12, current_thread_info()->flags); #endif - signr = get_signal_to_deliver(&info, &ka, regs, NULL); - if (signr > 0) { + if (get_signal(&ksig)) { /* Whee! Actually deliver the signal. */ if (in_syscall) - handle_restart(regs, &ka, 1); - handle_signal(signr, &ka, &info, regs); + handle_restart(regs, &ksig.ka, 1); + handle_signal(&ksig, regs); return; } diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index 329dfba..1a23d5d 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S @@ -380,6 +380,7 @@ ENTRY(sys_call_table) .long sys_process_vm_readv .long sys_process_vm_writev .long sys_kcmp - .long sys_finit_module + .long sys_finit_module /* 380 */ .long sys_sched_setattr .long sys_sched_getattr + .long sys_renameat2 diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile index 844960e..70c7ae6 100644 --- a/arch/microblaze/lib/Makefile +++ b/arch/microblaze/lib/Makefile @@ -18,14 +18,6 @@ endif lib-y += uaccess_old.o -lib-y += ashldi3.o -lib-y += ashrdi3.o -lib-y += cmpdi2.o -lib-y += divsi3.o -lib-y += lshrdi3.o -lib-y += modsi3.o -lib-y += muldi3.o -lib-y += mulsi3.o -lib-y += ucmpdi2.o -lib-y += udivsi3.o -lib-y += umodsi3.o +# libgcc-style stuff needed in the kernel +obj-y += ashldi3.o ashrdi3.o cmpdi2.o divsi3.o lshrdi3.o modsi3.o +obj-y += muldi3.o mulsi3.o ucmpdi2.o udivsi3.o umodsi3.o |