Commit 6c0b92cd authored by Jorge Ramirez-Ortiz's avatar Jorge Ramirez-Ortiz Committed by Philippe Gerum
Browse files

arm64/ipipe: 3.18 arm64 support

( merge of 3.18.20 port changes from "introduce arm64 support". -dm )
parent 3c912c92
......@@ -267,7 +267,7 @@ static inline unsigned long __ipipe_ffnz(unsigned long ul)
static inline void ipipe_handle_multi_irq(int irq, struct pt_regs *regs)
{
handle_IRQ(irq, regs);
__handle_domain_irq(NULL, irq, false, regs);
}
#ifdef CONFIG_SMP
......
......@@ -207,6 +207,7 @@ __do_switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk, bool may_defer)
{
const unsigned int cpu = ipipe_processor_id();
int ret = 0;
/*
* init_mm.pgd does not contain any user mappings and it is always
......@@ -218,17 +219,13 @@ __do_switch_mm(struct mm_struct *prev, struct mm_struct *next,
}
if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) {
int rc = check_and_switch_context(next, tsk, may_defer);
ret = check_and_switch_context(next, tsk, may_defer);
#ifdef CONFIG_IPIPE
if (rc < 0) {
if (ret < 0)
cpumask_clear_cpu(cpu, mm_cpumask(next));
return rc;
}
#else /* !CONFIG_IPIPE */
(void)rc;
#endif /* CONFIG_IPIPE */
}
return 0;
return ret;
}
#if defined(CONFIG_IPIPE) && defined(CONFIG_MMU)
......
......@@ -739,10 +739,15 @@ el0_svc_naked: // compat entry point
blt __ipipe_ret_to_user
get_thread_info tsk
bgt ret_to_user
ldp x0, x1, [sp] // restore the syscall args
/*
* Save/restore needed during syscalls. Restore syscall arguments from
* the values already saved on stack during kernel_entry.
*/
ldp x0, x1, [sp]
ldp x2, x3, [sp, #S_X2]
ldp x4, x5, [sp, #S_X4]
ldp x6, x7, [sp, #S_X6]
#endif /* CONFIG_IPIPE */
ct_user_exit 1
......
......@@ -233,21 +233,6 @@ static int ipipe_disable_smp(void)
arch_initcall(ipipe_disable_smp);
#endif /* SMP_ON_UP */
/*
* ipipe_raise_irq() -- Push the interrupt at front of the pipeline
* just like if it has been actually received from a hw source. Also
* works for virtual interrupts.
*/
void ipipe_raise_irq(unsigned irq)
{
unsigned long flags;
flags = hard_local_irq_save();
__ipipe_dispatch_irq(irq, IPIPE_IRQF_NOACK);
hard_local_irq_restore(flags);
}
EXPORT_SYMBOL_GPL(ipipe_raise_irq);
int ipipe_get_sysinfo(struct ipipe_sysinfo *info)
{
info->sys_nr_cpus = num_online_cpus();
......@@ -330,6 +315,12 @@ asmlinkage int __ipipe_check_root_interruptible(void)
return __ipipe_root_p && !irqs_disabled();
}
asmlinkage void __ipipe_stall_root(void)
{
ipipe_stall_root();
}
__kprobes int
__ipipe_switch_to_notifier_call_chain(struct atomic_notifier_head *nh,
unsigned long val, void *v)
......@@ -440,7 +431,7 @@ void __ipipe_exit_irq(struct pt_regs *regs)
/* hw irqs off */
asmlinkage void __exception __ipipe_grab_irq(int irq, struct pt_regs *regs)
{
struct ipipe_percpu_data *p = __ipipe_this_cpu_ptr(&ipipe_percpu);
struct ipipe_percpu_data *p = __ipipe_raw_cpu_ptr(&ipipe_percpu);
ipipe_trace_irq_entry(irq);
......@@ -476,7 +467,8 @@ asmlinkage void __exception __ipipe_grab_irq(int irq, struct pt_regs *regs)
static void __ipipe_do_IRQ(unsigned irq, void *cookie)
{
handle_IRQ(irq, __this_cpu_ptr(&ipipe_percpu.tick_regs));
struct pt_regs *regs = this_cpu_ptr(&ipipe_percpu.tick_regs);
__handle_domain_irq(NULL, irq, false, regs);
}
#ifdef CONFIG_MMU
......@@ -485,7 +477,7 @@ void __switch_mm_inner(struct mm_struct *prev, struct mm_struct *next,
{
#ifdef CONFIG_IPIPE_WANT_ACTIVE_MM
struct mm_struct ** const active_mm =
__this_cpu_ptr(&ipipe_percpu.active_mm);
this_cpu_ptr(&ipipe_percpu.active_mm);
#endif /* CONFIG_IPIPE_WANT_ACTIVE_MM */
#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
struct thread_info *const tip = current_thread_info();
......@@ -542,7 +534,7 @@ void deferred_switch_mm(struct mm_struct *next)
{
#ifdef CONFIG_IPIPE_WANT_ACTIVE_MM
struct mm_struct ** const active_mm =
__this_cpu_ptr(&ipipe_percpu.active_mm);
this_cpu_ptr(&ipipe_percpu.active_mm);
struct mm_struct *prev = *active_mm;
#endif /* CONFIG_IPIPE_WANT_ACTIVE_MM */
#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
......
......@@ -110,8 +110,7 @@ void arch_cpu_idle(void)
* This should do all the clock switching and wait for interrupt
* tricks
*/
if (!need_resched())
__ipipe_halt_root();
__ipipe_halt_root();
local_irq_enable();
}
......
......@@ -560,7 +560,8 @@ EXPORT_SYMBOL_GPL(__ipipe_first_ipi);
static void __ipipe_do_IPI(unsigned virq, void *cookie)
{
enum ipi_msg_type msg = virq - IPIPE_IPI_BASE;
handle_IPI(msg, __this_cpu_ptr(&ipipe_percpu.tick_regs));
struct pt_regs *p = this_cpu_ptr(&ipipe_percpu.tick_regs);
handle_IPI(msg, p);
}
void __ipipe_ipis_alloc(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment