summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/host/system.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/chip/host/system.c b/chip/host/system.c
index 757d00fc51..194a9565ab 100644
--- a/chip/host/system.c
+++ b/chip/host/system.c
@@ -17,10 +17,10 @@
#include "util.h"
#define SHARED_MEM_SIZE 0x2000 /* bytes */
-uint8_t __shared_mem_buf[SHARED_MEM_SIZE];
-
#define RAM_DATA_SIZE (sizeof(struct panic_data) + 512) /* bytes */
-static char __ram_data[RAM_DATA_SIZE];
+uint8_t __shared_mem_buf[SHARED_MEM_SIZE + RAM_DATA_SIZE];
+
+static char *__ram_data = __shared_mem_buf + SHARED_MEM_SIZE;
static enum system_image_copy_t __running_copy;
@@ -31,7 +31,7 @@ static void ramdata_set_persistent(void)
ASSERT(f != NULL);
- sz = fwrite(__ram_data, sizeof(__ram_data), 1, f);
+ sz = fwrite(__ram_data, RAM_DATA_SIZE, 1, f);
ASSERT(sz == 1);
release_persistent_storage(f);
@@ -44,11 +44,11 @@ static void ramdata_get_persistent(void)
if (f == NULL) {
fprintf(stderr,
"No RAM data found. Initializing to 0x00.\n");
- memset(__ram_data, 0, sizeof(__ram_data));
+ memset(__ram_data, 0, RAM_DATA_SIZE);
return;
}
- fread(__ram_data, sizeof(__ram_data), 1, f);
+ fread(__ram_data, RAM_DATA_SIZE, 1, f);
release_persistent_storage(f);