summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVignesh Raghavendra <vigneshr@ti.com>2023-06-06 20:11:36 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2023-06-06 11:17:11 -0500
commit650d94371a0ae2ac9ab9a7c8225ef3a3b8b2e2aa (patch)
treeed479785050bc4a11e93bc0e89af3565373d7b8b /common
parent9d86bafd0c3caca037d6e314252c972eec8a4ca4 (diff)
common: spl: Warn about overflow of SRAM stack
If early stack usage is exactly same as SIZE_LIMIT_PROVIDE_STACK, then its most likely to have overflowed beyond this limit and corrupted any regions beyond stack. Warn about this to the user. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index a630e79866..6c377ce465 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -935,6 +935,13 @@ __weak void spl_relocate_stack_check(void)
}
printf("SPL initial stack usage: %lu bytes\n",
CONFIG_VAL(SIZE_LIMIT_PROVIDE_STACK) - i);
+
+ /*
+ * If we used up all of the SIZE_LIMIT_PROVIDE_STACK, then here is high
+ * possibility of stack overflow, warn the user accordingly
+ */
+ if (!i)
+ printf("SPL possible initial stack overflow detected!!\n");
#endif
}