xtensa: kernel: add "asm/ftrace.h" for pass compiling

Need add "asm/ftrace.h" for pass compiling.

Cross-compiler is compiled from binutils-2.23.2 and gcc-4.9.0 source.

The related error (with allmodconfig for fsf processor):

  arch/xtensa/kernel/xtensa_ksyms.c:129:15: error: '_mcount' undeclared here (not in a function)

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: fix arch spinlock function names

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: fix __delay for small loop count

Avoid __delay counter underflow for loop counts < 2.

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

This fixes the following build warnings:

arch/xtensa/mm/misc.S: Assembler messages:
arch/xtensa/mm/misc.S:143: Warning: value 0xffffffff30000106 truncated to 0x30000106
arch/xtensa/mm/misc.S:197: Warning: value 0xffffffff30000106 truncated to 0x30000106

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: check thread flags atomically on return from user exception

Check pending signals and rescheduling thread flags with interrupts
disabled, and don't enable them if no flags are set. Call
trace_hardirqs_on after thread flags handling, so that rescheduling is
done and hardirqs tracking flag is updated in the correct task context.

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

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: keep a3 and excsave1 on entry to exception handlers

Based on the SMP patch by Joe Taylor and subsequent fixes.
Preserve exception table pointer (normally stored in excsave1 SR) as it
cannot be easily restored in SMP environment.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: new fast_alloca handler

Instead of emulating movsp instruction in the kernel use window
underflow handler to load missing register window and retry failed
movsp.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
xtensa: don't use echo -e needlessly

-e is not needed to output strings without escape sequences. This breaks
big endian FSF build when the shell is dash, because its builtin echo
doesn't understand '-e' switch and outputs it in the echoed string.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>