Go to the documentation of this file.
11 #ifndef _XTENSA_PROCESSOR_H
12 #define _XTENSA_PROCESSOR_H
14 #include <variant/core.h>
15 #include <platform/hardware.h>
17 #include <linux/compiler.h>
18 #include <asm/ptrace.h>
19 #include <asm/types.h>
24 #if (XCHAL_HAVE_WINDOWED != 1)
25 # error Linux requires the Xtensa Windowed Registers Option.
28 #define ARCH_SLAB_MINALIGN XCHAL_DATA_WIDTH
39 #define TASK_SIZE __XTENSA_UL_CONST(0x40000000)
41 #define TASK_SIZE (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE)
44 #define STACK_TOP TASK_SIZE
45 #define STACK_TOP_MAX STACK_TOP
56 #define EXCCAUSE_MAPPED_DEBUG 63
66 #define VALID_DOUBLE_EXCEPTION_ADDRESS 64
76 #define WSBITS (XCHAL_NUM_AREGS / 4)
77 #define WBBITS (XCHAL_NUM_AREGS_LOG2 - 2)
84 #define MAKE_RA_FOR_CALL(ra,ws) (((ra) & 0x3fffffff) | (ws) << 30)
89 #define MAKE_PC_FROM_RA(ra,sp) (((ra) & 0x3fffffff) | ((sp) & 0xc0000000))
122 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
128 #define TASK_UNMAPPED_BASE (TASK_SIZE / 2)
130 #define INIT_THREAD \
133 sp: sizeof(init_stack) + (long) &init_stack, \
147 #define USER_PS_VALUE ((1 << PS_WOE_BIT) | \
148 (1 << PS_CALLINC_SHIFT) | \
149 (USER_RING << PS_RING_SHIFT) | \
154 #define start_thread(regs, new_pc, new_sp) \
155 memset(regs, 0, sizeof(*regs)); \
157 regs->ps = USER_PS_VALUE; \
158 regs->areg[1] = new_sp; \
162 regs->windowbase = 0; \
163 regs->windowstart = 1;
170 #define release_thread(thread) do { } while(0)
173 #define copy_segments(p, mm) do { } while(0)
174 #define release_segments(mm) do { } while(0)
175 #define forget_segments() do { } while (0)
177 #define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)
181 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
182 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1])
184 #define cpu_relax() barrier()
188 #define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v));
189 #define RSR(v,sr) __asm__ __volatile__ ("rsr %0,"__stringify(sr) : "=a"(v));
191 #define set_sr(x,sr) ({unsigned int v=(unsigned int)x; WSR(v,sr);})
192 #define get_sr(sr) ({unsigned int v; RSR(v,sr); v; })