summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_scratch.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-02-19 15:41:22 +0300
committerAnup Patel <anup@brainfault.org>2019-02-20 09:32:40 +0300
commit122d00ba67c9caeffc65ddd96dd22c0d204f4c72 (patch)
treeaf897791de84a0c92221af20979ebc0982f46cb1 /include/sbi/sbi_scratch.h
parentce6189f7a5adbf6ac88b95f78a6d5e9b5481faf9 (diff)
downloadopensbi-122d00ba67c9caeffc65ddd96dd22c0d204f4c72.tar.xz
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>
Diffstat (limited to 'include/sbi/sbi_scratch.h')
-rw-r--r--include/sbi/sbi_scratch.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
index ff6aed0..8389ef3 100644
--- a/include/sbi/sbi_scratch.h
+++ b/include/sbi/sbi_scratch.h
@@ -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 */