firmware: rockchip_sip: define fiq_pt_regs as a global variable

"fiq_pt_regs" is a big data structures, so it'll save
lots of stack space if define "fiq_pt_regs" as a global
variable instead of a local variable.

Change-Id: Id447c41009fc4454bc821c194e9d50ec00087754
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
This commit is contained in:
XiaoDong Huang
2022-05-17 18:33:15 +08:00
parent 4c2c5e87e1
commit 81bad55a0c

View File

@@ -332,16 +332,17 @@ static phys_addr_t ft_fiq_mem_phy;
static void __iomem *ft_fiq_mem_base;
static void (*sip_fiq_debugger_uart_irq_tf)(struct pt_regs _pt_regs,
unsigned long cpu);
static struct pt_regs fiq_pt_regs;
int sip_fiq_debugger_is_enabled(void)
{
return fiq_sip_enabled;
}
EXPORT_SYMBOL_GPL(sip_fiq_debugger_is_enabled);
static struct pt_regs sip_fiq_debugger_get_pt_regs(void *reg_base,
unsigned long sp_el1)
static void sip_fiq_debugger_get_pt_regs(void *reg_base,
unsigned long sp_el1)
{
struct pt_regs fiq_pt_regs;
__maybe_unused struct sm_nsec_ctx *nsec_ctx = reg_base;
__maybe_unused struct gp_regs_ctx *gp_regs = reg_base;
@@ -413,21 +414,18 @@ static struct pt_regs sip_fiq_debugger_get_pt_regs(void *reg_base,
fiq_pt_regs.ARM_pc = nsec_ctx->und_lr;
}
#endif
return fiq_pt_regs;
}
static void sip_fiq_debugger_uart_irq_tf_cb(unsigned long sp_el1,
unsigned long offset,
unsigned long cpu)
{
struct pt_regs fiq_pt_regs;
char *cpu_context;
/* calling fiq handler */
if (ft_fiq_mem_base) {
cpu_context = (char *)ft_fiq_mem_base + offset;
fiq_pt_regs = sip_fiq_debugger_get_pt_regs(cpu_context, sp_el1);
sip_fiq_debugger_get_pt_regs(cpu_context, sp_el1);
sip_fiq_debugger_uart_irq_tf(fiq_pt_regs, cpu);
}