From acf96dfcdc0ea73c416a4d598bdaeaf55e88bc4c Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 8 Dec 2022 20:42:02 +0100 Subject: [PATCH] include/gpio: skip everything but soc/gpio.h include in ASM & ACPI cases When gpio.h gets directly or indirectly included in the DSDT ar an assembly file, everything but the preprocessor defines for the GPIOs shouldn't be included to keep IASL or the assembler happy. Signed-off-by: Felix Held Change-Id: I046ed87d3947ba5b1fcd0bdd4cffcda57bc13404 Reviewed-on: https://review.coreboot.org/c/coreboot/+/70509 Reviewed-by: Fred Reitberger Tested-by: build bot (Jenkins) --- src/include/gpio.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/include/gpio.h b/src/include/gpio.h index db8776a417..daf602977d 100644 --- a/src/include/gpio.h +++ b/src/include/gpio.h @@ -4,6 +4,9 @@ #define __SRC_INCLUDE_GPIO_H__ #include /* IWYU pragma: export */ + +#ifndef __ASSEMBLER__ /* __ASSEMBLER__ also covers __ACPI__ case */ + #include /* must typedef a gpio_t that fits in 32 bits. */ @@ -96,4 +99,6 @@ static inline uint32_t gpio_binary_first_base3_value(const gpio_t gpio[], return _gpio_base3_value(gpio, num_gpio, 1); } +#endif /* !__ASSEMBLER__ */ + #endif /* __SRC_INCLUDE_GPIO_H__ */