From patchwork Mon Oct 24 14:11:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9392155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62D6360762 for ; Mon, 24 Oct 2016 14:11:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 546752840A for ; Mon, 24 Oct 2016 14:11:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4849F28A77; Mon, 24 Oct 2016 14:11:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF4CA2840A for ; Mon, 24 Oct 2016 14:11:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938869AbcJXOLn (ORCPT ); Mon, 24 Oct 2016 10:11:43 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35546 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936517AbcJXOLm (ORCPT ); Mon, 24 Oct 2016 10:11:42 -0400 Received: by mail-oi0-f68.google.com with SMTP id d132so2094347oib.2; Mon, 24 Oct 2016 07:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=YNOpi2z4nvpxwszunzAiMnivrww7rTLfNpgcV4whOJ4=; b=NDCbQ4Uuo+kuEvxaIAYhuFuSZiRdslTzdT9v71SDVekY0fzWoMYo+7aMKqn2O4Ya7v coz8cXydHj7fPRNCIavW2qiE9mf1Sxtw1sy4I/palDlA0FWeDcsSIMMFH+D+lYyK+KyX vgWsedSV/HrYydUo+HLcpWA1vStRT56dHNpxe6hJeQsEfoIIlA22nq0RTHZCwqR6NfYU 3wD7bARzOsmX1DhQl/c/e6it2VeDpjFhXzODDX92Eg4HdMEcRw0nWzVkKEZ35lO1xub1 mHG2dvQ6xpKgfrUgXIETvpbbWLMDeLbjC2krKK83o7v56UMogC6PAV5yhIqK6FEy25Bq LGSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YNOpi2z4nvpxwszunzAiMnivrww7rTLfNpgcV4whOJ4=; b=AzGWAaYvUFy+VR8561p+WSrVJXc9P0l4QcRmcRtk4XeMsngjOy3XeXRdGRPcGQe41a zMWM8sFHh6TE0ROHByJXinZWDX7AB7nKby4RwJT0+Lq94WTHVtvtx5BnUYpio+TS/I+f +zy+y61sM1NXYrZzoMUlNt6ostNnStAbVFpxE11PMhc3IbrJpA4eju9nYQhRi21AqkUm dq4bteXJeaPY5yxUtexwfPi70hjeDeEMoM0b9PGQkH3RAa9Od0ClqESHRVXiK4IO+pSh B6bkERvX4DrgdscRUtbmEWz3DIV6l322BsoDR/9/Kuc3PRo4XM8GwjdVYwhuNoBELf0f Zplg== X-Gm-Message-State: AA6/9Rnp2G8Ah2DsIQ6z+NHvc4hMipm7r/8PmGPNax2kcfU0+JUc7nA7VIN7DaR/2w9FJA== X-Received: by 10.202.181.7 with SMTP id e7mr19084960oif.16.1477318301703; Mon, 24 Oct 2016 07:11:41 -0700 (PDT) Received: from localhost.localdomain (h3.246.129.40.static.ip.windstream.net. [40.129.246.3]) by smtp.gmail.com with ESMTPSA id r126sm5252025oib.27.2016.10.24.07.11.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 07:11:40 -0700 (PDT) From: Lv Zheng X-Google-Original-From: Lv Zheng To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Len Brown Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Lv Zheng Subject: [PATCH] tools/power/acpi: Remove direct kernel source include reference Date: Mon, 24 Oct 2016 22:11:19 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ACPICA tools trickily uses integer types, and trickily includes kernel include directory directly, which breaks tools build for some cross compilers. This patch fixes this build issue. Reported-and-tested-by: Yisheng Xie Signed-off-by: Lv Zheng --- include/acpi/platform/aclinux.h | 3 +++ tools/power/acpi/Makefile | 10 ++++++++-- tools/power/acpi/tools/acpidbg/Makefile | 2 +- tools/power/acpi/tools/acpidbg/acpidbg.c | 8 +++++++- tools/power/acpi/tools/acpidump/Makefile | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index a5d98d1..e861a24 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -191,6 +191,9 @@ #ifndef __init #define __init #endif +#ifndef __iomem +#define __iomem +#endif /* Host-dependent types and defines for user-space ACPICA */ diff --git a/tools/power/acpi/Makefile b/tools/power/acpi/Makefile index a8bf908..ddb38d5 100644 --- a/tools/power/acpi/Makefile +++ b/tools/power/acpi/Makefile @@ -11,11 +11,17 @@ include ../../scripts/Makefile.include all: acpidbg acpidump ec -clean: acpidbg_clean acpidump_clean ec_clean +clean: acpidbg_clean acpidump_clean include_clean ec_clean install: acpidbg_install acpidump_install ec_install uninstall: acpidbg_uninstall acpidump_uninstall ec_uninstall +include/acpi: + mkdir -p include + ln -s ../../../../include/acpi include/acpi +include_clean: + rm -f include/acpi + rm -rf include -acpidbg acpidump ec: FORCE +acpidbg acpidump ec: include/acpi FORCE $(call descend,tools/$@,all) acpidbg_clean acpidump_clean ec_clean: $(call descend,tools/$(@:_clean=),clean) diff --git a/tools/power/acpi/tools/acpidbg/Makefile b/tools/power/acpi/tools/acpidbg/Makefile index 352df4b..1f35977 100644 --- a/tools/power/acpi/tools/acpidbg/Makefile +++ b/tools/power/acpi/tools/acpidbg/Makefile @@ -19,7 +19,7 @@ vpath %.c \ CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\ -I.\ -I../../../../../drivers/acpi/acpica\ - -I../../../../../include + -I../../include LDFLAGS += -lpthread TOOL_OBJS = \ acpidbg.o diff --git a/tools/power/acpi/tools/acpidbg/acpidbg.c b/tools/power/acpi/tools/acpidbg/acpidbg.c index a88ac45..4308362 100644 --- a/tools/power/acpi/tools/acpidbg/acpidbg.c +++ b/tools/power/acpi/tools/acpidbg/acpidbg.c @@ -12,10 +12,16 @@ #include /* Headers not included by include/acpi/platform/aclinux.h */ +#include +#include +#include +#include +#include #include #include #include -#include +#include +#include "../../../../../include/linux/circ_buf.h" #define ACPI_AML_FILE "/sys/kernel/debug/acpi/acpidbg" #define ACPI_AML_SEC_TICK 1 diff --git a/tools/power/acpi/tools/acpidump/Makefile b/tools/power/acpi/tools/acpidump/Makefile index 04b5db7..e9f05d5 100644 --- a/tools/power/acpi/tools/acpidump/Makefile +++ b/tools/power/acpi/tools/acpidump/Makefile @@ -21,7 +21,7 @@ vpath %.c \ ../../os_specific/service_layers CFLAGS += -DACPI_DUMP_APP -I.\ -I../../../../../drivers/acpi/acpica\ - -I../../../../../include + -I../../include TOOL_OBJS = \ apdump.o\ apfiles.o\