aboutsummaryrefslogtreecommitdiffstats
path: root/arch/nios2
diff options
context:
space:
mode:
Diffstat (limited to 'arch/nios2')
-rw-r--r--arch/nios2/kernel/cpuinfo.c1
-rw-r--r--arch/nios2/kernel/entry.S20
2 files changed, 3 insertions, 18 deletions
diff --git a/arch/nios2/kernel/cpuinfo.c b/arch/nios2/kernel/cpuinfo.c
index 51d5bb90d3e5..a223691dff4f 100644
--- a/arch/nios2/kernel/cpuinfo.c
+++ b/arch/nios2/kernel/cpuinfo.c
@@ -72,6 +72,7 @@ void __init setup_cpuinfo(void)
72 cpuinfo.has_div = fcpu_has(cpu, "altr,has-div"); 72 cpuinfo.has_div = fcpu_has(cpu, "altr,has-div");
73 cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul"); 73 cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul");
74 cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx"); 74 cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx");
75 cpuinfo.mmu = fcpu_has(cpu, "altr,has-mmu");
75 76
76 if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div) 77 if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div)
77 err_cpu("DIV"); 78 err_cpu("DIV");
diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
index 83bca17d1008..0bdfd13ff98b 100644
--- a/arch/nios2/kernel/entry.S
+++ b/arch/nios2/kernel/entry.S
@@ -365,30 +365,14 @@ ENTRY(ret_from_interrupt)
365 GET_THREAD_INFO r1 365 GET_THREAD_INFO r1
366 ldw r4, TI_PREEMPT_COUNT(r1) 366 ldw r4, TI_PREEMPT_COUNT(r1)
367 bne r4, r0, restore_all 367 bne r4, r0, restore_all
368
369need_resched:
370 ldw r4, TI_FLAGS(r1) /* ? Need resched set */ 368 ldw r4, TI_FLAGS(r1) /* ? Need resched set */
371 BTBZ r10, r4, TIF_NEED_RESCHED, restore_all 369 BTBZ r10, r4, TIF_NEED_RESCHED, restore_all
372 ldw r4, PT_ESTATUS(sp) /* ? Interrupts off */ 370 ldw r4, PT_ESTATUS(sp) /* ? Interrupts off */
373 andi r10, r4, ESTATUS_EPIE 371 andi r10, r4, ESTATUS_EPIE
374 beq r10, r0, restore_all 372 beq r10, r0, restore_all
375 movia r4, PREEMPT_ACTIVE 373 call preempt_schedule_irq
376 stw r4, TI_PREEMPT_COUNT(r1)
377 rdctl r10, status /* enable intrs again */
378 ori r10, r10 ,STATUS_PIE
379 wrctl status, r10
380 PUSH r1
381 call schedule
382 POP r1
383 mov r4, r0
384 stw r4, TI_PREEMPT_COUNT(r1)
385 rdctl r10, status /* disable intrs */
386 andi r10, r10, %lo(~STATUS_PIE)
387 wrctl status, r10
388 br need_resched
389#else
390 br restore_all
391#endif 374#endif
375 br restore_all
392 376
393/*********************************************************************** 377/***********************************************************************
394 * A few syscall wrappers 378 * A few syscall wrappers