summaryrefslogtreecommitdiff
path: root/util/comm-host.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-07-03 14:45:59 -0700
committerGerrit <chrome-bot@google.com>2012-07-07 17:14:18 -0700
commit7f5f7be3e5df92ec2e9447b3d5d0b8ddeb96c9a0 (patch)
treef58e23fa5d053e31163faf8279882f0d9891c1fe /util/comm-host.h
parent0e42faf85b3a4adbc83cb087e0bdab7641df9f1b (diff)
downloadchrome-ec-7f5f7be3e5df92ec2e9447b3d5d0b8ddeb96c9a0.tar.gz
Add memory-mapped data support for I2C and SPI protocols
And fix returning memory-mapped string length on LPC as well. BUG=chrome-os-partner:11090 TEST=manual from EC, 'hostevent set 0x40000' from host, 'ectool eventget' --> should print 0x40000 Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I9edbd0a1468b5d4160ce67c471332226e51fa868 Reviewed-on: https://gerrit.chromium.org/gerrit/26719 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'util/comm-host.h')
-rw-r--r--util/comm-host.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/comm-host.h b/util/comm-host.h
index b3790b4717..7a3f856bf9 100644
--- a/util/comm-host.h
+++ b/util/comm-host.h
@@ -29,6 +29,11 @@ int ec_command(int command, const void *indata, int insize,
uint8_t read_mapped_mem8(uint8_t offset);
uint16_t read_mapped_mem16(uint8_t offset);
uint32_t read_mapped_mem32(uint8_t offset);
+/*
+ * Read a memory-mapped string at the specified offset and store into buf,
+ * which must be at least size EC_MEMMAP_TEXT_MAX. Returns the length of
+ * the copied string, not counting the terminating '\0', or <0 if error.
+ */
int read_mapped_string(uint8_t offset, char *buf);
#endif /* COMM_HOST_H */