diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-08-01 10:27:33 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-08-01 14:22:44 -0700 |
commit | bebfb9431ed973703df03c8e2da11cf280315272 (patch) | |
tree | 8bf468e22ac06fd4593aa11061026c8dc44b0fd6 /include/common.h | |
parent | 8e28efa7ac4bc6cec969a928d1b34b6d423d582f (diff) | |
download | chrome-ec-bebfb9431ed973703df03c8e2da11cf280315272.tar.gz |
Word-align the host memory map
This fixes unaligned access exceptions when totally-unrelated code
changes happen to move around host_command.c's global variables.
BUG=chrome-os-partner:21578
BRANCH=none
TEST=add a ccprintf() call to host_command.c; no longer causes an exception
Change-Id: I5407e5631a08ea647dc40e5bd9c7bd101868ced0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64233
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/common.h')
-rw-r--r-- | include/common.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/common.h b/include/common.h index c6eeb11fef..235540d220 100644 --- a/include/common.h +++ b/include/common.h @@ -32,9 +32,14 @@ #define REG16(addr) (*(volatile uint16_t *)(addr)) /* - * Define __packed if someone hasn't beat us to it. Linux kernel style - * checking prefers __packed over __attribute__((packed)). + * Define __aligned(n) and __packed if someone hasn't beat us to it. Linux + * kernel style checking prefers these over __attribute__((packed)) and + * __attribute__((aligned(n))). */ +#ifndef __aligned +#define __aligned(n) __attribute__((aligned(n))) +#endif + #ifndef __packed #define __packed __attribute__((packed)) #endif |