coreboot/src
Julius Werner cef5fa13c3 Add check_member macro to allow clean and easy struct offset checking
This patch adds a new static assertion macro that can be used to check
the offsets in structures that overlay register sets at compile time. It
uses the _Static_assert() declaration from the new ISO C11 standard,
which is supported (even without -std=c11) by GCC after version 4.6.
(There is supposedly also support in clang, although I haven't tried
it... let's deal with compiler issues when/if they turn up.)

I've added it to all structures for our current ARM SoCs for now, and I
think every new register overlay we add going forward should use them
(at least for the last member, but feel free to add more if you think
it's useful).

BUG=None
TEST=Compiled for Snow, Pit and Nyan.

Change-Id: If32510e7049739ad05618d363a854dc372d64386
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/179412
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2013-12-11 22:12:25 +00:00
..
arch exynos: Install the BL1 and set the checksum in the Makefile. 2013-12-10 03:26:39 +00:00
console ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
cpu x86: Add SMM helper functions to MP infrastructure 2013-10-23 04:08:19 +00:00
device pnp: Allow setting of misc register 0xfa in device tree 2013-11-08 00:52:45 +00:00
drivers tpm: Clean up I2C TPM driver 2013-11-11 23:47:09 +00:00
ec baytrail: Basic DPTF framework 2013-12-11 19:50:19 +00:00
include Add check_member macro to allow clean and easy struct offset checking 2013-12-11 22:12:25 +00:00
lib reg_script: add reg_script_run_on_dev() 2013-12-11 19:51:56 +00:00
mainboard rambi: Enable DPTF 2013-12-11 19:50:23 +00:00
northbridge haswell: Report x32 memory as "x8 or x32" 2013-10-23 21:27:19 +00:00
soc Add check_member macro to allow clean and easy struct offset checking 2013-12-11 22:12:25 +00:00
southbridge lynxpoint: Add SATA DEVSLP disable option 2013-11-15 04:58:50 +00:00
superio pnp: Allow setting of misc register 0xfa in device tree 2013-11-08 00:52:45 +00:00
vendorcode baytrail: Add support for LPSS and SCC devices in ACPI mode 2013-12-11 19:50:27 +00:00
Kconfig Fix the reg_script stuff to not be used in ARM builds and not break them. 2013-11-02 01:07:13 +00:00