xtensa: add stacktrace support

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: provide custom CALLER_ADDR* implementations

Definition of CALLER_ADDR* through __builtin_return_address makes
compiler insert calls to __xtensa_libgcc_window_spill, which in turn
makes fast_syscall_spill_registers syscall that clobbers registers when
called from the kernel mode, leading to invalid opcode exceptions on
return to userspace.

Provide definition for CALLER_ADDR0 as MAKE_PC_FROM_RA(a0, a1) and in
case CONFIG_FRAME_POINTER is enabled extract CALLER_ADDR{1-3} from
stack.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: add irq flags trace support

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: fix arch_irqs_disabled_flags implementation

IRQs are disabled when PS.EXCM is set or PS.INTLEVEL is equal to or
higher than LOCKLEVEL.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: enable lockdep support

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: disable IRQs while IRQ handler is running

IRQ handlers are expected to run with IRQs disabled.
See e.g. http://lwn.net/Articles/380931/ for a longer story.

This was overlooked in the commit
  2d1c645 xtensa: dispatch medium-priority interrupts
Revert to old behavior and simplify interrupt entry and exit code.
Interrupt handler still honours IRQ priority.

do_notify_resume/schedule must be called with interrupts enabled, enable
interrupts if we return from user exception.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: ISS: fix timer_lock usage in rs_open

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: WIP: add Three Core HiFi-2 MX Variant.

Signed-off-by: Pete Delaney <piet@tensilica.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: WIP: add SMP support

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: fix __flush_dtlb_all isync/dsync

xtensa ISA says that IDTLB instruction must be separated from the
following translations possibly affected by the invalidation by the
DSYNC instruction, not the ISYNC. Replace ISYNC with DSYNC and rename
invalidate_dtlb_entry_no_isync to invalidate_dtlb_entry_no_dsync.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: fix local_save_flags usage in local_flush_tlb*

local_save_flags looks meaningless in the context, replace them with
local_irq_save.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: WIP: add shabu core

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: WIP: update FSF variant

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: WIP: clockevents

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>