assert.h: Add a tag parameter to dead_code()
When dead_code() is used in inline functions in a header file, the generated function names (based on the line number) may collide with a dead_code() in the code file. Now that we are hit by such a case, we need a quick solution: Add a tag argument for all invocations in header files. Change-Id: I0c548ce998cf8e28ae9f76b5c0ea5630b4e91ae2 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40140 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
@ -65,13 +65,13 @@
|
|||||||
* ramstage/lib/bootmode.o: In function `display_init_required':
|
* ramstage/lib/bootmode.o: In function `display_init_required':
|
||||||
* bootmode.c:42: undefined reference to `dead_code_assertion_failed_at_line_42'
|
* bootmode.c:42: undefined reference to `dead_code_assertion_failed_at_line_42'
|
||||||
*/
|
*/
|
||||||
#define __dead_code(line) do { \
|
#define __dead_code(tag, line) do { \
|
||||||
extern void dead_code_assertion_failed_at_line_##line(void) \
|
extern void dead_code_assertion_failed##tag##_at_line_##line(void) \
|
||||||
__attribute__((noreturn)); \
|
__attribute__((noreturn)); \
|
||||||
dead_code_assertion_failed_at_line_##line(); \
|
dead_code_assertion_failed##tag##_at_line_##line(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define _dead_code(line) __dead_code(line)
|
#define _dead_code(tag, line) __dead_code(tag, line)
|
||||||
#define dead_code() _dead_code(__LINE__)
|
#define dead_code(tag) _dead_code(tag, __LINE__)
|
||||||
|
|
||||||
/* This can be used in the context of an expression of type 'type'. */
|
/* This can be used in the context of an expression of type 'type'. */
|
||||||
#define dead_code_t(type) ({ \
|
#define dead_code_t(type) ({ \
|
||||||
|
@ -53,7 +53,7 @@ static inline int verification_should_run(void)
|
|||||||
else if (CONFIG(VBOOT_STARTS_IN_BOOTBLOCK))
|
else if (CONFIG(VBOOT_STARTS_IN_BOOTBLOCK))
|
||||||
return ENV_BOOTBLOCK;
|
return ENV_BOOTBLOCK;
|
||||||
else
|
else
|
||||||
dead_code();
|
dead_code(_in_vboot_misc_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int verstage_should_load(void)
|
static inline int verstage_should_load(void)
|
||||||
@ -82,7 +82,7 @@ static inline int vboot_logic_executed(void)
|
|||||||
/* Post-RAM stages are "after the romstage" */
|
/* Post-RAM stages are "after the romstage" */
|
||||||
return !ENV_ROMSTAGE_OR_BEFORE;
|
return !ENV_ROMSTAGE_OR_BEFORE;
|
||||||
} else {
|
} else {
|
||||||
dead_code();
|
dead_code(_in_vboot_misc_h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user