diff options
| -rw-r--r-- | arch/xtensa/kernel/entry.S | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 03709ef2f3ce..3f3de283d707 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | /* Unimplemented features. */ | 31 | /* Unimplemented features. */ |
| 32 | 32 | ||
| 33 | #undef KERNEL_STACK_OVERFLOW_CHECK | 33 | #undef KERNEL_STACK_OVERFLOW_CHECK |
| 34 | #undef PREEMPTIBLE_KERNEL | ||
| 35 | #undef ALLOCA_EXCEPTION_IN_IRAM | 34 | #undef ALLOCA_EXCEPTION_IN_IRAM |
| 36 | 35 | ||
| 37 | /* Not well tested. | 36 | /* Not well tested. |
| @@ -429,7 +428,9 @@ common_exception_return: | |||
| 429 | /* Jump if we are returning from kernel exceptions. */ | 428 | /* Jump if we are returning from kernel exceptions. */ |
| 430 | 429 | ||
| 431 | l32i a3, a1, PT_PS | 430 | l32i a3, a1, PT_PS |
| 432 | _bbci.l a3, PS_UM_BIT, 4f | 431 | GET_THREAD_INFO(a2, a1) |
| 432 | l32i a4, a2, TI_FLAGS | ||
| 433 | _bbci.l a3, PS_UM_BIT, 6f | ||
| 433 | 434 | ||
| 434 | /* Specific to a user exception exit: | 435 | /* Specific to a user exception exit: |
| 435 | * We need to check some flags for signal handling and rescheduling, | 436 | * We need to check some flags for signal handling and rescheduling, |
| @@ -438,9 +439,6 @@ common_exception_return: | |||
| 438 | * Note that we don't disable interrupts here. | 439 | * Note that we don't disable interrupts here. |
| 439 | */ | 440 | */ |
| 440 | 441 | ||
| 441 | GET_THREAD_INFO(a2,a1) | ||
| 442 | l32i a4, a2, TI_FLAGS | ||
| 443 | |||
| 444 | _bbsi.l a4, TIF_NEED_RESCHED, 3f | 442 | _bbsi.l a4, TIF_NEED_RESCHED, 3f |
| 445 | _bbsi.l a4, TIF_NOTIFY_RESUME, 2f | 443 | _bbsi.l a4, TIF_NOTIFY_RESUME, 2f |
| 446 | _bbci.l a4, TIF_SIGPENDING, 5f | 444 | _bbci.l a4, TIF_SIGPENDING, 5f |
| @@ -463,6 +461,19 @@ common_exception_return: | |||
| 463 | callx4 a4 | 461 | callx4 a4 |
| 464 | j 1b | 462 | j 1b |
| 465 | 463 | ||
| 464 | #ifdef CONFIG_PREEMPT | ||
| 465 | 6: | ||
| 466 | _bbci.l a4, TIF_NEED_RESCHED, 4f | ||
| 467 | |||
| 468 | /* Check current_thread_info->preempt_count */ | ||
| 469 | |||
| 470 | l32i a4, a2, TI_PRE_COUNT | ||
| 471 | bnez a4, 4f | ||
| 472 | movi a4, preempt_schedule_irq | ||
| 473 | callx4 a4 | ||
| 474 | j 1b | ||
| 475 | #endif | ||
| 476 | |||
| 466 | 5: | 477 | 5: |
| 467 | #ifdef CONFIG_DEBUG_TLB_SANITY | 478 | #ifdef CONFIG_DEBUG_TLB_SANITY |
| 468 | l32i a4, a1, PT_DEPC | 479 | l32i a4, a1, PT_DEPC |
| @@ -470,6 +481,7 @@ common_exception_return: | |||
| 470 | movi a4, check_tlb_sanity | 481 | movi a4, check_tlb_sanity |
| 471 | callx4 a4 | 482 | callx4 a4 |
| 472 | #endif | 483 | #endif |
| 484 | 6: | ||
| 473 | 4: | 485 | 4: |
| 474 | #ifdef CONFIG_TRACE_IRQFLAGS | 486 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 475 | l32i a4, a1, PT_DEPC | 487 | l32i a4, a1, PT_DEPC |
| @@ -573,29 +585,6 @@ user_exception_exit: | |||
| 573 | 585 | ||
| 574 | kernel_exception_exit: | 586 | kernel_exception_exit: |
| 575 | 587 | ||
| 576 | #ifdef PREEMPTIBLE_KERNEL | ||
| 577 | |||
| 578 | #ifdef CONFIG_PREEMPT | ||
| 579 | |||
| 580 | /* | ||
| 581 | * Note: We've just returned from a call4, so we have | ||
| 582 | * at least 4 addt'l regs. | ||
| 583 | */ | ||
| 584 | |||
| 585 | /* Check current_thread_info->preempt_count */ | ||
| 586 | |||
| 587 | GET_THREAD_INFO(a2) | ||
| 588 | l32i a3, a2, TI_PREEMPT | ||
| 589 | bnez a3, 1f | ||
| 590 | |||
| 591 | l32i a2, a2, TI_FLAGS | ||
| 592 | |||
| 593 | 1: | ||
| 594 | |||
| 595 | #endif | ||
| 596 | |||
| 597 | #endif | ||
| 598 | |||
| 599 | /* Check if we have to do a movsp. | 588 | /* Check if we have to do a movsp. |
| 600 | * | 589 | * |
| 601 | * We only have to do a movsp if the previous window-frame has | 590 | * We only have to do a movsp if the previous window-frame has |
