Commit 58bb5081 authored by Rander Wang's avatar Rander Wang Committed by Mark Brown

ASoC: SOF: Xtensa: dump ar registers to restore call stack

On Xtensa platform ar0 is for caller address and ar1 is for stack
address. The ar register dump can be used to rebuild call stack with
FW elf file by debug tools.
Signed-off-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-2-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 88e20c1f
...@@ -132,6 +132,17 @@ static void xtensa_stack(struct snd_sof_dev *sdev, const char *level, void *oops ...@@ -132,6 +132,17 @@ static void xtensa_stack(struct snd_sof_dev *sdev, const char *level, void *oops
buf, sizeof(buf), false); buf, sizeof(buf), false);
dev_printk(level, sdev->dev, "0x%08x: %s\n", stack_ptr + i * 4, buf); dev_printk(level, sdev->dev, "0x%08x: %s\n", stack_ptr + i * 4, buf);
} }
if (!xoops->plat_hdr.numaregs)
return;
dev_printk(level, sdev->dev, "AR registers:\n");
/* the number of ar registers is a multiple of 4 */
for (i = 0; i < xoops->plat_hdr.numaregs; i += 4) {
hex_dump_to_buffer(xoops->ar + i, 16, 16, 4,
buf, sizeof(buf), false);
dev_printk(level, sdev->dev, "%#x: %s\n", i * 4, buf);
}
} }
const struct dsp_arch_ops sof_xtensa_arch_ops = { const struct dsp_arch_ops sof_xtensa_arch_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment