summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhuo-hao Lee <zhuo-hao.lee@intel.com>2017-01-13 15:11:46 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-01-20 02:52:45 +0000
commit870fe1340832a165c909f6a332226cb00f594832 (patch)
treea74e4de3af52179cdc94ffd764817ce41358fa57
parentb954b5072cada4780fe1f276ab17823dd7f2eccc (diff)
downloadchrome-ec-870fe1340832a165c909f6a332226cb00f594832.tar.gz
common: update the precalculate value for jump data + panic data
The precalculate value of the jump data + panic data is incorrect. By now, jump data for RO is 24bytes, panic data is 116 bytes. BUG=chrome-os-partner:61241 BRANCH=firmware-glados-7820.B TEST=Print out sizeof(struct panic_data) and sizeof(struct jump_data) Change-Id: I9c47184a5d3721eb615201407ed528f65a92005e Signed-off-by: Zhuo-hao Lee <zhuo-hao.lee@intel.com> Reviewed-on: https://chromium-review.googlesource.com/427601 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--core/cortex-m/ec.lds.S20
-rw-r--r--core/cortex-m0/ec.lds.S20
2 files changed, 24 insertions, 16 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 8ebc4b0c78..34c859b105 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -308,19 +308,23 @@ SECTIONS
/*
* Check the shared memory is not too small.
* The end of memory can have jump data and panic data.
- * Based on calculation, set aside 128 bytes for these.
- * This assert is approximate but prevents unexpected behavior at run time.
+ * Based on calculation, set aside 140 bytes for these.
+ * This assert is approximate for RO region but prevents unexpected
+ * behavior at run time.
*
- * CONFIG_RAM_BASE + CONFIG_RAM_SIZE
- * ---+---------------------+---------+----------+
- * | shared memory |jump data|panic data|
- * ---+---------------------+---------+----------+
- * __shared_mem_buf jdata(RO) pdata_ptr(if present)
+ * CONFIG_RAM_BASE + CONFIG_RAM_SIZE
+ * ---+----------------------------------+---------+---------------------+
+ * | shared memory |jump data| panic data |
+ * ---+----------------------------------+---------+---------------------+
+ * __shared_mem_buf | jdata(RO) pdata_ptr(if present)
+ * ---+-------------------+--------------+---------+---------------------+
+ * __shared_mem_buf | jdata->total | jdata(RW) pdata_ptr(if present)
+ * ---+-------------------+--------------+---------+---------------------+
*
* If hash calculation is disable, it is likely the shared memory is not
* used.
*/
- ASSERT((CONFIG_RAM_BASE + CONFIG_RAM_SIZE - 128) >=
+ ASSERT((CONFIG_RAM_BASE + CONFIG_RAM_SIZE - 140) >=
(__shared_mem_buf + CONFIG_SHARED_MEM_MIN_SIZE),
"Not enough space for shared memory")
#endif
diff --git a/core/cortex-m0/ec.lds.S b/core/cortex-m0/ec.lds.S
index 575cbf66e3..45f0f1ee4d 100644
--- a/core/cortex-m0/ec.lds.S
+++ b/core/cortex-m0/ec.lds.S
@@ -227,19 +227,23 @@ SECTIONS
/*
* Check the shared memory is not too small.
* The end of memory can have jump data and panic data.
- * Based on calculation, set aside 128 bytes for these.
- * This assert is approximate but prevents unexpected behavior at run time.
+ * Based on calculation, set aside 140 bytes for these.
+ * This assert is approximate for RO region but prevents unexpected
+ * behavior at run time.
*
- * CONFIG_RAM_BASE + CONFIG_RAM_SIZE
- * ---+---------------------+---------+----------+
- * | shared memory |jump data|panic data|
- * ---+---------------------+---------+----------+
- * __shared_mem_buf jdata(RO) pdata_ptr(if present)
+ * CONFIG_RAM_BASE + CONFIG_RAM_SIZE
+ * ---+----------------------------------+---------+---------------------+
+ * | shared memory |jump data| panic data |
+ * ---+----------------------------------+---------+---------------------+
+ * __shared_mem_buf | jdata(RO) pdata_ptr(if present)
+ * ---+-------------------+--------------+---------+---------------------+
+ * __shared_mem_buf | jdata->total | jdata(RW) pdata_ptr(if present)
+ * ---+-------------------+--------------+---------+---------------------+
*
* If hash calculation is disable, it is likely the shared memory is not
* used.
*/
- ASSERT((CONFIG_RAM_BASE + CONFIG_RAM_SIZE - 128) >=
+ ASSERT((CONFIG_RAM_BASE + CONFIG_RAM_SIZE - 140) >=
(__shared_mem_buf + CONFIG_SHARED_MEM_MIN_SIZE),
"Not enough space for shared memory")
#endif