Commit da0a4e5c authored by Max Filippov's avatar Max Filippov
Browse files

xtensa: only build windowed register support code when needed



There's no need in window overflow/underflow/alloca exception handlers
or window spill code when neither kernel nor userspace support windowed
registers. Don't build or link it.

Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent 09af39f6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ void secondary_trap_init(void);

static inline void spill_registers(void)
{
#if defined(__XTENSA_WINDOWED_ABI__)
#if XCHAL_NUM_AREGS > 16
	__asm__ __volatile__ (
		"	call8	1f\n"
@@ -96,6 +97,7 @@ static inline void spill_registers(void)
		"	mov	a12, a12\n"
		: : : "memory");
#endif
#endif
}

struct debug_table {
+4 −1
Original line number Diff line number Diff line
@@ -969,6 +969,7 @@ ENDPROC(unrecoverable_exception)
	__XTENSA_HANDLER
	.literal_position

#ifdef SUPPORT_WINDOWED
/*
 * Fast-handler for alloca exceptions
 *
@@ -1032,6 +1033,7 @@ ENTRY(fast_alloca)
8:	j	_WindowUnderflow8
4:	j	_WindowUnderflow4
ENDPROC(fast_alloca)
#endif

#ifdef CONFIG_USER_ABI_CALL0_PROBE
/*
@@ -1228,7 +1230,8 @@ ENDPROC(fast_syscall_xtensa)
 * Note: We assume the stack pointer is EXC_TABLE_KSTK in the fixup handler.
 */

#ifdef CONFIG_FAST_SYSCALL_SPILL_REGISTERS
#if defined(CONFIG_FAST_SYSCALL_SPILL_REGISTERS) && \
		defined(USER_SUPPORT_WINDOWED)

ENTRY(fast_syscall_spill_registers)

+2 −0
Original line number Diff line number Diff line
@@ -349,8 +349,10 @@ void __init setup_arch(char **cmdline_p)
#endif

#ifdef CONFIG_VECTORS_ADDR
#ifdef SUPPORT_WINDOWED
	mem_reserve(__pa(&_WindowVectors_text_start),
		    __pa(&_WindowVectors_text_end));
#endif

	mem_reserve(__pa(&_DebugInterruptVector_text_start),
		    __pa(&_DebugInterruptVector_text_end));
+10 −2
Original line number Diff line number Diff line
@@ -45,12 +45,13 @@ struct rt_sigframe
	unsigned int window[4];
};

#if defined(USER_SUPPORT_WINDOWED)
/*
 * Flush register windows stored in pt_regs to stack.
 * Returns 1 for errors.
 */

int
static int
flush_window_regs_user(struct pt_regs *regs)
{
	const unsigned long ws = regs->windowstart;
@@ -121,6 +122,13 @@ flush_window_regs_user(struct pt_regs *regs)
errout:
	return err;
}
#else
static int
flush_window_regs_user(struct pt_regs *regs)
{
	return 0;
}
#endif

/*
 * Note: We don't copy double exception 'regs', we have to finish double exc. 
+2 −0
Original line number Diff line number Diff line
@@ -97,7 +97,9 @@ static dispatch_init_table_t __initdata dispatch_init_table[] = {
/* EXCCAUSE_INSTRUCTION_FETCH unhandled */
/* EXCCAUSE_LOAD_STORE_ERROR unhandled*/
{ EXCCAUSE_LEVEL1_INTERRUPT,	0,	   do_interrupt },
#ifdef SUPPORT_WINDOWED
{ EXCCAUSE_ALLOCA,		USER|KRNL, fast_alloca },
#endif
/* EXCCAUSE_INTEGER_DIVIDE_BY_ZERO unhandled */
/* EXCCAUSE_PRIVILEGED unhandled */
#if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
Loading