coreboot-kgpe-d16/src
Julius Werner b8534f767c assert: Add new dead_code() macro to assert dead code paths
This patch adds a new kind of compile-time assertion based on Linux'
compiletime_assert(). The difference to the existing use of
_Static_assert() in coreboot (which should continue to be used where
appropriate) is that this new assertion only hits if the call to it is
not optimized out at compile time. It is therefore ideal to assert that
certain code paths are not included in the image if a certain Kconfig
option is (not) set. For example,

 assert(!IS_ENABLED(CONFIG_THAT_MAKES_THIS_INAPPROPRIATE));

can be rewritten as

 if (!IS_ENABLED(CONFIG_THAT_MAKES_THIS_INAPPROPRIATE))
   dead_code("This code shouldn't be built for config X");

to turn it into a compile-time check.

Change-Id: Ida2911e2e4b3191a00d09231b493bf755e6f0fcb
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/20585
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-07-16 23:56:34 +00:00
..
acpi
arch src: add IS_ENABLED() around Kconfig symbol references 2017-07-13 23:57:07 +00:00
commonlib Rename __attribute__((packed)) --> __packed 2017-07-13 19:45:59 +00:00
console src: add IS_ENABLED() around Kconfig symbol references 2017-07-13 23:57:07 +00:00
cpu vendorcode/amd/agesa: Tidy up gcccar.inc 2017-07-15 16:10:19 +00:00
device device/pciexp_device.c: Terminate CLK PM message with newline 2017-07-15 21:54:23 +00:00
drivers siemens/nc_fpga: Fix wrong type cast 2017-07-15 22:11:17 +00:00
ec ec/mec1308: Fix fan control ACPI 2017-07-08 19:06:00 +00:00
include assert: Add new dead_code() macro to assert dead code paths 2017-07-16 23:56:34 +00:00
lib Rename __attribute__((packed)) --> __packed 2017-07-13 19:45:59 +00:00
mainboard google/fizz: Override PL2 and SysPL2 values 2017-07-14 22:47:31 +00:00
northbridge Rename __attribute__((packed)) --> __packed 2017-07-13 19:45:59 +00:00
soc soc/amd/stoneyridge:Fix IS_ENABLED() around Kconfig symbol references 2017-07-16 19:22:33 +00:00
southbridge southbridge/intel: add IS_ENABLED() around Kconfig symbol references 2017-07-16 19:22:18 +00:00
superio superio/ite/it8716f: Update init_ec 2017-07-08 19:02:13 +00:00
vboot Rename __attribute__((packed)) --> __packed 2017-07-13 19:45:59 +00:00
vendorcode vendorcode/amd/agesa: Tidy up gcccar.inc 2017-07-15 16:10:19 +00:00
Kconfig Add support for Undefined Behavior Sanitizer 2017-06-14 19:56:59 +02:00