From patchwork Mon Jan 27 05:05:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1229516 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ADlRrM9U; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 485dBt6fCGz9sR1 for ; Mon, 27 Jan 2020 16:11:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7B46B817E4; Mon, 27 Jan 2020 06:10:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ADlRrM9U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1431A8177D; Mon, 27 Jan 2020 06:08:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 56D5C8177F for ; Mon, 27 Jan 2020 06:08:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd35.google.com with SMTP id e7so8539017iof.11 for ; Sun, 26 Jan 2020 21:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y9bOh/rVPwxFLU1n4I6tCUloBvneIB+4z6ZTq//9osY=; b=ADlRrM9UmXngb9FKXfusuqYFJJ7od9rs8VF6o0WbthA5dWqjfQjqWnIMSsIYP1wH9M zGuzB5fSMe0siZQjMUhUuwLUWG6J0dI1eZBz8+FXY3QtvBsQQbvVWkvFnu3r45QTmkU9 dhiac/uZl3FnYVZufDmoB4fBxLYQDSggBDO7Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y9bOh/rVPwxFLU1n4I6tCUloBvneIB+4z6ZTq//9osY=; b=iLPc5/UGsW3kkjHq11aGXtjDbUk7HmXNmtNrkX2kNuPQCalklSNzspwVJgj3+HuLjF Lg3+lT0quytq62Nj5v6K55ZrIvruWvPOgo17duY/GlpxmzigBjXuqa3hChdbeqhK99E4 OqKdqnjRTVA5v5SOJGZgpvLPEqLkFYzPETGNLxpIeNqhrwyK5jahBM0KOwbhi4JGhEPb Uqi9Yhckix31V51XUVkQ/Ey3VneZT/7tWiM0aUFzcizA6NzPsOfyGLDajH3WCDcDuiAE 2YduhfetYTpZlxB1W6pEZGTvBzQpjGNtY8D6OON80tpxzdiYbCjuPVJ6xkDboOV5ZTjJ Hb1g== X-Gm-Message-State: APjAAAWly0Pzyw7PYXO3nn78HixQ7zdSlYCNyxtbH8WRGCPXhjLr5o27 miLD4bIF3euRmxqEa24F/a8hlCyvOspRQQ== X-Google-Smtp-Source: APXvYqz+gpqgpd+ikgglVFcFbJBvvpTBTouChnxykpctUS7R10YEIkn+UrG3DcdJKUy4Dc3AVGHt5Q== X-Received: by 2002:a05:6638:34c:: with SMTP id x12mr11258312jap.144.1580101718019; Sun, 26 Jan 2020 21:08:38 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id h23sm4313195ilf.57.2020.01.26.21.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jan 2020 21:08:37 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 016/108] acpi: Add an __ACPI__ preprocessor symbol Date: Sun, 26 Jan 2020 22:05:23 -0700 Message-Id: <20200126220508.16.I6e674b2388c5a74a6912deb2dcc9c8acc8875da0@changeid> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200127050655.170614-1-sjg@chromium.org> References: <20200127050655.170614-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean The ASL compiler cannot handle C structures and the like so needs some sort of header guard around these. We already have an __ASSEMBLY__ #define but it seems best to create a new one for ACPI since the rules may be different. Add the check to a few files that ACPI always includes. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/acpi_table.h | 4 ++++ include/dm/acpi.h | 4 ++++ scripts/Makefile.lib | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/acpi_table.h b/include/acpi_table.h index b4404a632c..dd74895813 100644 --- a/include/acpi_table.h +++ b/include/acpi_table.h @@ -21,6 +21,8 @@ #define ACPI_RSDP_REV_ACPI_1_0 0 #define ACPI_RSDP_REV_ACPI_2_0 2 +#if !defined(__ACPI__) + /* * RSDP (Root System Description Pointer) * Note: ACPI 1.0 didn't have length, xsdt_address, and ext_checksum @@ -389,6 +391,8 @@ struct __packed acpi_spcr { u32 reserved2; }; +#endif /* !__ACPI__*/ + #include #endif /* __ACPI_TABLE_H__ */ diff --git a/include/dm/acpi.h b/include/dm/acpi.h index 120576adc0..8d6c3fd424 100644 --- a/include/dm/acpi.h +++ b/include/dm/acpi.h @@ -22,6 +22,8 @@ /* Length of an ACPI name string including nul terminator */ #define ACPI_NAME_MAX 5 +#if !defined(__ACPI__) + /** * struct acpi_ops - ACPI operations supported by driver model */ @@ -70,4 +72,6 @@ int acpi_get_name(const struct udevice *dev, char *out_name); */ int acpi_return_name(char *out_name, const char *name); +#endif /* __ACPI__ */ + #endif diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index c10cd83a0a..d466ef5be7 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -409,8 +409,8 @@ ASL_TMP = $(patsubst %.c,%.asl.tmp,$@) quiet_cmd_acpi_c_asl= ASL $< cmd_acpi_c_asl= \ - $(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -P $(UBOOTINCLUDE) \ - -o $(ASL_TMP) $< && \ + $(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -D__ACPI__ \ + -P $(UBOOTINCLUDE) -o $(ASL_TMP) $< && \ iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \ mv $(patsubst %.c,%.hex,$@) $@