firmware: Improve low-level trap handler for M-mode to M-mode traps

This patch extends our low-level trap handler in fw_base.S for
handling M-mode to M-mode traps without overwritting stack.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Anup Patel
2019-02-19 18:11:22 +05:30
committed by Anup Patel
parent ce6189f7a5
commit 122d00ba67
2 changed files with 58 additions and 40 deletions

View File

@@ -30,6 +30,8 @@
#define SBI_SCRATCH_HARTID_TO_SCRATCH_OFFSET (7 * __SIZEOF_POINTER__)
/** Offset of ipi_type member in sbi_scratch */
#define SBI_SCRATCH_IPI_TYPE_OFFSET (8 * __SIZEOF_POINTER__)
/** Offset of tmp0 member in sbi_scratch */
#define SBI_SCRATCH_TMP0_OFFSET (9 * __SIZEOF_POINTER__)
/** Maximum size of sbi_scratch */
#define SBI_SCRATCH_SIZE 256
@@ -57,6 +59,8 @@ struct sbi_scratch {
unsigned long hartid_to_scratch;
/** IPI type (or flags) */
unsigned long ipi_type;
/** Temporary storage */
unsigned long tmp0;
} __packed;
/** Get pointer to sbi_scratch for current HART */