mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
ACPI fixes for v4.9-rc6
- Revert a recent ACPICA cleanup that attempted to get rid of all FADT version 2 legacy, but broke ACPI thermal management on at least one system (Rafael Wysocki). - Fix cross-compiled builds of ACPI tools that stopped working after a recent cleanup related to the handling of header files in ACPICA (Lv Zheng). - Fix a locking issue in the PCC channel initialization code that invokes devm_request_irq() under a spinlock (among other things) and causes lockdep to complain (Hoan Tran). -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABCAAGBQJYL2zcAAoJEILEb/54YlRx344P/1TDKMXiyWh8JmAAWFAPdK49 jZpRS+hD15droQuhpBLz7KJDpmAU/KKOg+dRrtl4NpYMf+ApWtkBUblUYE/8d/sv L9WSoTx6KlxhSI+Av5BqaCyIYUwMtn4NRT2MP8lz9eQ1A91M+RWvdKm/8XzsppXc spCVi0NxO8qRIJjnFgkYdLRvGYLVMmCTkf2ptxnao5SnmyE/wefhZCW/bZFFEAiY QIIXkCZrdJ1PH0mre7P2+CvmAzdlxl02A/3aZquNTjDD33KBGvhQcvASGxrnAvs+ QG4EF29cHO2XAxPo50PLkn5kE+Fef3ulSi2hpKIOqdayRFmCPEFneHed9E1G5hNA 05nzMbw9nvz9QGFnqaWDbebfhueJ6ztqxgnqPb8j4YXTsr8P8giGj3Djk2eawCX+ F67OCm0c0NZpo63zqAsCd3WC9s2MOKNntnRGq4dJ2xNfC6qk0+eJLCDaCxoKoOn4 oMwYU+AWgjxK/vsXKL0RNQfd1xkuy3E4/HCy1knPkpYpJpC29qqFwcKH8DbLig/+ PZ1yRC2ZZ1EqxUpRjEoGuU9g2ElkY6pqjTGh1qquB9PiYQrTK/HYGjnW23eKb1tH iUj/kSO486nlUP1hOk77BOUoKOBjDrt9o520WNHn3yLDknljZsUcG2QtmlO6fmpS BLxyCWXWCJcsPyEcGSoY =9ZhJ -----END PGP SIGNATURE----- Merge tag 'acpi-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "They fix an ACPI thermal management regression introduced by a recent FADT handling cleanup, an ACPI tools build issue introduced by a recent ACPICA commit and a PCC mailbox initialization bug causing lockdep to complain loudly. Specifics: - Revert a recent ACPICA cleanup that attempted to get rid of all FADT version 2 legacy, but broke ACPI thermal management on at least one system (Rafael Wysocki). - Fix cross-compiled builds of ACPI tools that stopped working after a recent cleanup related to the handling of header files in ACPICA (Lv Zheng). - Fix a locking issue in the PCC channel initialization code that invokes devm_request_irq() under a spinlock (among other things) and causes lockdep to complain (Hoan Tran)" * tag 'acpi-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: tools/power/acpi: Remove direct kernel source include reference mailbox: PCC: Fix lockdep warning when request PCC channel Revert "ACPICA: FADT support cleanup"
This commit is contained in:
commit
20afa6e2f9
@ -480,19 +480,17 @@ static void acpi_tb_convert_fadt(void)
|
||||
u32 i;
|
||||
|
||||
/*
|
||||
* For ACPI 1.0 FADTs (revision 1), ensure that reserved fields which
|
||||
* For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
|
||||
* should be zero are indeed zero. This will workaround BIOSs that
|
||||
* inadvertently place values in these fields.
|
||||
*
|
||||
* The ACPI 1.0 reserved fields that will be zeroed are the bytes located
|
||||
* at offset 45, 55, 95, and the word located at offset 109, 110.
|
||||
*
|
||||
* Note: The FADT revision value is unreliable because of BIOS errors.
|
||||
* The table length is instead used as the final word on the version.
|
||||
*
|
||||
* Note: FADT revision 3 is the ACPI 2.0 version of the FADT.
|
||||
* Note: The FADT revision value is unreliable. Only the length can be
|
||||
* trusted.
|
||||
*/
|
||||
if (acpi_gbl_FADT.header.length <= ACPI_FADT_V3_SIZE) {
|
||||
if (acpi_gbl_FADT.header.length <= ACPI_FADT_V2_SIZE) {
|
||||
acpi_gbl_FADT.preferred_profile = 0;
|
||||
acpi_gbl_FADT.pstate_control = 0;
|
||||
acpi_gbl_FADT.cst_control = 0;
|
||||
|
@ -65,6 +65,7 @@
|
||||
#include <linux/mailbox_controller.h>
|
||||
#include <linux/mailbox_client.h>
|
||||
#include <linux/io-64-nonatomic-lo-hi.h>
|
||||
#include <acpi/pcc.h>
|
||||
|
||||
#include "mailbox.h"
|
||||
|
||||
@ -267,6 +268,8 @@ struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
|
||||
if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
|
||||
chan->txdone_method |= TXDONE_BY_ACK;
|
||||
|
||||
spin_unlock_irqrestore(&chan->lock, flags);
|
||||
|
||||
if (pcc_doorbell_irq[subspace_id] > 0) {
|
||||
int rc;
|
||||
|
||||
@ -275,12 +278,11 @@ struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
|
||||
if (unlikely(rc)) {
|
||||
dev_err(dev, "failed to register PCC interrupt %d\n",
|
||||
pcc_doorbell_irq[subspace_id]);
|
||||
pcc_mbox_free_channel(chan);
|
||||
chan = ERR_PTR(rc);
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&chan->lock, flags);
|
||||
|
||||
return chan;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
|
||||
@ -304,20 +306,19 @@ void pcc_mbox_free_channel(struct mbox_chan *chan)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pcc_doorbell_irq[id] > 0)
|
||||
devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);
|
||||
|
||||
spin_lock_irqsave(&chan->lock, flags);
|
||||
chan->cl = NULL;
|
||||
chan->active_req = NULL;
|
||||
if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK))
|
||||
chan->txdone_method = TXDONE_BY_POLL;
|
||||
|
||||
if (pcc_doorbell_irq[id] > 0)
|
||||
devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan);
|
||||
|
||||
spin_unlock_irqrestore(&chan->lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pcc_mbox_free_channel);
|
||||
|
||||
|
||||
/**
|
||||
* pcc_send_data - Called from Mailbox Controller code. Used
|
||||
* here only to ring the channel doorbell. The PCC client
|
||||
|
@ -230,72 +230,62 @@ struct acpi_table_facs {
|
||||
/* Fields common to all versions of the FADT */
|
||||
|
||||
struct acpi_table_fadt {
|
||||
struct acpi_table_header header; /* [V1] Common ACPI table header */
|
||||
u32 facs; /* [V1] 32-bit physical address of FACS */
|
||||
u32 dsdt; /* [V1] 32-bit physical address of DSDT */
|
||||
u8 model; /* [V1] System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
|
||||
u8 preferred_profile; /* [V1] Conveys preferred power management profile to OSPM. */
|
||||
u16 sci_interrupt; /* [V1] System vector of SCI interrupt */
|
||||
u32 smi_command; /* [V1] 32-bit Port address of SMI command port */
|
||||
u8 acpi_enable; /* [V1] Value to write to SMI_CMD to enable ACPI */
|
||||
u8 acpi_disable; /* [V1] Value to write to SMI_CMD to disable ACPI */
|
||||
u8 s4_bios_request; /* [V1] Value to write to SMI_CMD to enter S4BIOS state */
|
||||
u8 pstate_control; /* [V1] Processor performance state control */
|
||||
u32 pm1a_event_block; /* [V1] 32-bit port address of Power Mgt 1a Event Reg Blk */
|
||||
u32 pm1b_event_block; /* [V1] 32-bit port address of Power Mgt 1b Event Reg Blk */
|
||||
u32 pm1a_control_block; /* [V1] 32-bit port address of Power Mgt 1a Control Reg Blk */
|
||||
u32 pm1b_control_block; /* [V1] 32-bit port address of Power Mgt 1b Control Reg Blk */
|
||||
u32 pm2_control_block; /* [V1] 32-bit port address of Power Mgt 2 Control Reg Blk */
|
||||
u32 pm_timer_block; /* [V1] 32-bit port address of Power Mgt Timer Ctrl Reg Blk */
|
||||
u32 gpe0_block; /* [V1] 32-bit port address of General Purpose Event 0 Reg Blk */
|
||||
u32 gpe1_block; /* [V1] 32-bit port address of General Purpose Event 1 Reg Blk */
|
||||
u8 pm1_event_length; /* [V1] Byte Length of ports at pm1x_event_block */
|
||||
u8 pm1_control_length; /* [V1] Byte Length of ports at pm1x_control_block */
|
||||
u8 pm2_control_length; /* [V1] Byte Length of ports at pm2_control_block */
|
||||
u8 pm_timer_length; /* [V1] Byte Length of ports at pm_timer_block */
|
||||
u8 gpe0_block_length; /* [V1] Byte Length of ports at gpe0_block */
|
||||
u8 gpe1_block_length; /* [V1] Byte Length of ports at gpe1_block */
|
||||
u8 gpe1_base; /* [V1] Offset in GPE number space where GPE1 events start */
|
||||
u8 cst_control; /* [V1] Support for the _CST object and C-States change notification */
|
||||
u16 c2_latency; /* [V1] Worst case HW latency to enter/exit C2 state */
|
||||
u16 c3_latency; /* [V1] Worst case HW latency to enter/exit C3 state */
|
||||
u16 flush_size; /* [V1] Processor memory cache line width, in bytes */
|
||||
u16 flush_stride; /* [V1] Number of flush strides that need to be read */
|
||||
u8 duty_offset; /* [V1] Processor duty cycle index in processor P_CNT reg */
|
||||
u8 duty_width; /* [V1] Processor duty cycle value bit width in P_CNT register */
|
||||
u8 day_alarm; /* [V1] Index to day-of-month alarm in RTC CMOS RAM */
|
||||
u8 month_alarm; /* [V1] Index to month-of-year alarm in RTC CMOS RAM */
|
||||
u8 century; /* [V1] Index to century in RTC CMOS RAM */
|
||||
u16 boot_flags; /* [V3] IA-PC Boot Architecture Flags (see below for individual flags) */
|
||||
u8 reserved; /* [V1] Reserved, must be zero */
|
||||
u32 flags; /* [V1] Miscellaneous flag bits (see below for individual flags) */
|
||||
/* End of Version 1 FADT fields (ACPI 1.0) */
|
||||
|
||||
struct acpi_generic_address reset_register; /* [V3] 64-bit address of the Reset register */
|
||||
u8 reset_value; /* [V3] Value to write to the reset_register port to reset the system */
|
||||
u16 arm_boot_flags; /* [V5] ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
|
||||
u8 minor_revision; /* [V5] FADT Minor Revision (ACPI 5.1) */
|
||||
u64 Xfacs; /* [V3] 64-bit physical address of FACS */
|
||||
u64 Xdsdt; /* [V3] 64-bit physical address of DSDT */
|
||||
struct acpi_generic_address xpm1a_event_block; /* [V3] 64-bit Extended Power Mgt 1a Event Reg Blk address */
|
||||
struct acpi_generic_address xpm1b_event_block; /* [V3] 64-bit Extended Power Mgt 1b Event Reg Blk address */
|
||||
struct acpi_generic_address xpm1a_control_block; /* [V3] 64-bit Extended Power Mgt 1a Control Reg Blk address */
|
||||
struct acpi_generic_address xpm1b_control_block; /* [V3] 64-bit Extended Power Mgt 1b Control Reg Blk address */
|
||||
struct acpi_generic_address xpm2_control_block; /* [V3] 64-bit Extended Power Mgt 2 Control Reg Blk address */
|
||||
struct acpi_generic_address xpm_timer_block; /* [V3] 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
|
||||
struct acpi_generic_address xgpe0_block; /* [V3] 64-bit Extended General Purpose Event 0 Reg Blk address */
|
||||
struct acpi_generic_address xgpe1_block; /* [V3] 64-bit Extended General Purpose Event 1 Reg Blk address */
|
||||
/* End of Version 3 FADT fields (ACPI 2.0) */
|
||||
|
||||
struct acpi_generic_address sleep_control; /* [V4] 64-bit Sleep Control register (ACPI 5.0) */
|
||||
/* End of Version 4 FADT fields (ACPI 3.0 and ACPI 4.0) (Field was originally reserved in ACPI 3.0) */
|
||||
|
||||
struct acpi_generic_address sleep_status; /* [V5] 64-bit Sleep Status register (ACPI 5.0) */
|
||||
/* End of Version 5 FADT fields (ACPI 5.0) */
|
||||
|
||||
u64 hypervisor_id; /* [V6] Hypervisor Vendor ID (ACPI 6.0) */
|
||||
/* End of Version 6 FADT fields (ACPI 6.0) */
|
||||
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u32 facs; /* 32-bit physical address of FACS */
|
||||
u32 dsdt; /* 32-bit physical address of DSDT */
|
||||
u8 model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
|
||||
u8 preferred_profile; /* Conveys preferred power management profile to OSPM. */
|
||||
u16 sci_interrupt; /* System vector of SCI interrupt */
|
||||
u32 smi_command; /* 32-bit Port address of SMI command port */
|
||||
u8 acpi_enable; /* Value to write to SMI_CMD to enable ACPI */
|
||||
u8 acpi_disable; /* Value to write to SMI_CMD to disable ACPI */
|
||||
u8 s4_bios_request; /* Value to write to SMI_CMD to enter S4BIOS state */
|
||||
u8 pstate_control; /* Processor performance state control */
|
||||
u32 pm1a_event_block; /* 32-bit port address of Power Mgt 1a Event Reg Blk */
|
||||
u32 pm1b_event_block; /* 32-bit port address of Power Mgt 1b Event Reg Blk */
|
||||
u32 pm1a_control_block; /* 32-bit port address of Power Mgt 1a Control Reg Blk */
|
||||
u32 pm1b_control_block; /* 32-bit port address of Power Mgt 1b Control Reg Blk */
|
||||
u32 pm2_control_block; /* 32-bit port address of Power Mgt 2 Control Reg Blk */
|
||||
u32 pm_timer_block; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */
|
||||
u32 gpe0_block; /* 32-bit port address of General Purpose Event 0 Reg Blk */
|
||||
u32 gpe1_block; /* 32-bit port address of General Purpose Event 1 Reg Blk */
|
||||
u8 pm1_event_length; /* Byte Length of ports at pm1x_event_block */
|
||||
u8 pm1_control_length; /* Byte Length of ports at pm1x_control_block */
|
||||
u8 pm2_control_length; /* Byte Length of ports at pm2_control_block */
|
||||
u8 pm_timer_length; /* Byte Length of ports at pm_timer_block */
|
||||
u8 gpe0_block_length; /* Byte Length of ports at gpe0_block */
|
||||
u8 gpe1_block_length; /* Byte Length of ports at gpe1_block */
|
||||
u8 gpe1_base; /* Offset in GPE number space where GPE1 events start */
|
||||
u8 cst_control; /* Support for the _CST object and C-States change notification */
|
||||
u16 c2_latency; /* Worst case HW latency to enter/exit C2 state */
|
||||
u16 c3_latency; /* Worst case HW latency to enter/exit C3 state */
|
||||
u16 flush_size; /* Processor memory cache line width, in bytes */
|
||||
u16 flush_stride; /* Number of flush strides that need to be read */
|
||||
u8 duty_offset; /* Processor duty cycle index in processor P_CNT reg */
|
||||
u8 duty_width; /* Processor duty cycle value bit width in P_CNT register */
|
||||
u8 day_alarm; /* Index to day-of-month alarm in RTC CMOS RAM */
|
||||
u8 month_alarm; /* Index to month-of-year alarm in RTC CMOS RAM */
|
||||
u8 century; /* Index to century in RTC CMOS RAM */
|
||||
u16 boot_flags; /* IA-PC Boot Architecture Flags (see below for individual flags) */
|
||||
u8 reserved; /* Reserved, must be zero */
|
||||
u32 flags; /* Miscellaneous flag bits (see below for individual flags) */
|
||||
struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */
|
||||
u8 reset_value; /* Value to write to the reset_register port to reset the system */
|
||||
u16 arm_boot_flags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
|
||||
u8 minor_revision; /* FADT Minor Revision (ACPI 5.1) */
|
||||
u64 Xfacs; /* 64-bit physical address of FACS */
|
||||
u64 Xdsdt; /* 64-bit physical address of DSDT */
|
||||
struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
|
||||
struct acpi_generic_address xpm1b_event_block; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */
|
||||
struct acpi_generic_address xpm1a_control_block; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */
|
||||
struct acpi_generic_address xpm1b_control_block; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */
|
||||
struct acpi_generic_address xpm2_control_block; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */
|
||||
struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
|
||||
struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
|
||||
struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
|
||||
struct acpi_generic_address sleep_control; /* 64-bit Sleep Control register (ACPI 5.0) */
|
||||
struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */
|
||||
u64 hypervisor_id; /* Hypervisor Vendor ID (ACPI 6.0) */
|
||||
};
|
||||
|
||||
/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
|
||||
@ -311,8 +301,8 @@ struct acpi_table_fadt {
|
||||
|
||||
/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
|
||||
|
||||
#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5] PSCI 0.2+ is implemented */
|
||||
#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5] HVC must be used instead of SMC as the PSCI conduit */
|
||||
#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */
|
||||
#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
|
||||
|
||||
/* Masks for FADT flags */
|
||||
|
||||
@ -409,34 +399,20 @@ struct acpi_table_desc {
|
||||
* match the expected length. In other words, the length of the
|
||||
* FADT is the bottom line as to what the version really is.
|
||||
*
|
||||
* NOTE: There is no officialy released V2 of the FADT. This
|
||||
* version was used only for prototyping and testing during the
|
||||
* 32-bit to 64-bit transition. V3 was the first official 64-bit
|
||||
* version of the FADT.
|
||||
*
|
||||
* Update this list of defines when a new version of the FADT is
|
||||
* added to the ACPI specification. Note that the FADT version is
|
||||
* only incremented when new fields are appended to the existing
|
||||
* version. Therefore, the FADT version is competely independent
|
||||
* from the version of the ACPI specification where it is
|
||||
* defined.
|
||||
*
|
||||
* For reference, the various FADT lengths are as follows:
|
||||
* FADT V1 size: 0x074 ACPI 1.0
|
||||
* FADT V3 size: 0x0F4 ACPI 2.0
|
||||
* FADT V4 size: 0x100 ACPI 3.0 and ACPI 4.0
|
||||
* FADT V5 size: 0x10C ACPI 5.0
|
||||
* FADT V6 size: 0x114 ACPI 6.0
|
||||
* For reference, the values below are as follows:
|
||||
* FADT V1 size: 0x074
|
||||
* FADT V2 size: 0x084
|
||||
* FADT V3 size: 0x0F4
|
||||
* FADT V4 size: 0x0F4
|
||||
* FADT V5 size: 0x10C
|
||||
* FADT V6 size: 0x114
|
||||
*/
|
||||
#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) /* ACPI 1.0 */
|
||||
#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) /* ACPI 2.0 */
|
||||
#define ACPI_FADT_V4_SIZE (u32) (ACPI_FADT_OFFSET (sleep_status)) /* ACPI 3.0 and ACPI 4.0 */
|
||||
#define ACPI_FADT_V5_SIZE (u32) (ACPI_FADT_OFFSET (hypervisor_id)) /* ACPI 5.0 */
|
||||
#define ACPI_FADT_V6_SIZE (u32) (sizeof (struct acpi_table_fadt)) /* ACPI 6.0 */
|
||||
#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4)
|
||||
#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (minor_revision) + 1)
|
||||
#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control))
|
||||
#define ACPI_FADT_V5_SIZE (u32) (ACPI_FADT_OFFSET (hypervisor_id))
|
||||
#define ACPI_FADT_V6_SIZE (u32) (sizeof (struct acpi_table_fadt))
|
||||
|
||||
/* Update these when new FADT versions are added */
|
||||
|
||||
#define ACPI_FADT_MAX_VERSION 6
|
||||
#define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)"
|
||||
|
||||
#endif /* __ACTBL_H__ */
|
||||
|
@ -191,6 +191,9 @@
|
||||
#ifndef __init
|
||||
#define __init
|
||||
#endif
|
||||
#ifndef __iomem
|
||||
#define __iomem
|
||||
#endif
|
||||
|
||||
/* Host-dependent types and defines for user-space ACPICA */
|
||||
|
||||
|
@ -8,18 +8,19 @@
|
||||
# as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
|
||||
include ../../../../scripts/Makefile.include
|
||||
ifeq ($(srctree),)
|
||||
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
|
||||
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
||||
#$(info Determined 'srctree' to be $(srctree))
|
||||
endif
|
||||
|
||||
OUTPUT=./
|
||||
include $(srctree)/../../scripts/Makefile.include
|
||||
|
||||
OUTPUT=$(srctree)/
|
||||
ifeq ("$(origin O)", "command line")
|
||||
OUTPUT := $(O)/
|
||||
endif
|
||||
|
||||
ifneq ($(OUTPUT),)
|
||||
# check that the output directory actually exists
|
||||
OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
|
||||
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
|
||||
OUTPUT := $(O)/power/acpi/
|
||||
endif
|
||||
#$(info Determined 'OUTPUT' to be $(OUTPUT))
|
||||
|
||||
# --- CONFIGURATION BEGIN ---
|
||||
|
||||
@ -70,8 +71,8 @@ WARNINGS := -Wall
|
||||
WARNINGS += $(call cc-supports,-Wstrict-prototypes)
|
||||
WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
|
||||
|
||||
KERNEL_INCLUDE := ../../../include
|
||||
ACPICA_INCLUDE := ../../../drivers/acpi/acpica
|
||||
KERNEL_INCLUDE := $(OUTPUT)include
|
||||
ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica
|
||||
CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
|
||||
CFLAGS += $(WARNINGS)
|
||||
|
||||
|
@ -8,28 +8,42 @@
|
||||
# as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
|
||||
$(OUTPUT)$(TOOL): $(TOOL_OBJS) FORCE
|
||||
$(ECHO) " LD " $@
|
||||
$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(TOOL_OBJS) -L$(OUTPUT) -o $@
|
||||
objdir := $(OUTPUT)tools/$(TOOL)/
|
||||
toolobjs := $(addprefix $(objdir),$(TOOL_OBJS))
|
||||
$(OUTPUT)$(TOOL): $(toolobjs) FORCE
|
||||
$(ECHO) " LD " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(toolobjs) -L$(OUTPUT) -o $@
|
||||
$(ECHO) " STRIP " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) $(STRIPCMD) $@
|
||||
|
||||
$(OUTPUT)%.o: %.c
|
||||
$(ECHO) " CC " $@
|
||||
$(KERNEL_INCLUDE):
|
||||
$(ECHO) " MKDIR " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) mkdir -p $(KERNEL_INCLUDE)
|
||||
$(ECHO) " CP " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) cp -rf $(srctree)/../../../include/acpi $(KERNEL_INCLUDE)/
|
||||
|
||||
$(objdir)%.o: %.c $(KERNEL_INCLUDE)
|
||||
$(ECHO) " CC " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
all: $(OUTPUT)$(TOOL)
|
||||
clean:
|
||||
-find $(OUTPUT) \( -not -type d \) \
|
||||
-and \( -name '*~' -o -name '*.[oas]' \) \
|
||||
-type f -print \
|
||||
| xargs rm -f
|
||||
-rm -f $(OUTPUT)$(TOOL)
|
||||
$(ECHO) " RMOBJ " $(subst $(OUTPUT),,$(objdir))
|
||||
$(QUIET) find $(objdir) \( -not -type d \)\
|
||||
-and \( -name '*~' -o -name '*.[oas]' \)\
|
||||
-type f -print | xargs rm -f
|
||||
$(ECHO) " RM " $(TOOL)
|
||||
$(QUIET) rm -f $(OUTPUT)$(TOOL)
|
||||
$(ECHO) " RMINC " $(subst $(OUTPUT),,$(KERNEL_INCLUDE))
|
||||
$(QUIET) rm -rf $(KERNEL_INCLUDE)
|
||||
|
||||
install-tools:
|
||||
$(INSTALL) -d $(DESTDIR)${sbindir}
|
||||
$(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)${sbindir}
|
||||
$(ECHO) " INST " $(TOOL)
|
||||
$(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir)
|
||||
$(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir)
|
||||
uninstall-tools:
|
||||
- rm -f $(DESTDIR)${sbindir}/$(TOOL)
|
||||
$(ECHO) " UNINST " $(TOOL)
|
||||
$(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL)
|
||||
|
||||
install: all install-tools $(EXTRA_INSTALL)
|
||||
uninstall: uninstall-tools $(EXTRA_UNINSTALL)
|
||||
|
@ -17,9 +17,7 @@ vpath %.c \
|
||||
../../os_specific/service_layers\
|
||||
.
|
||||
CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\
|
||||
-I.\
|
||||
-I../../../../../drivers/acpi/acpica\
|
||||
-I../../../../../include
|
||||
-I.
|
||||
LDFLAGS += -lpthread
|
||||
TOOL_OBJS = \
|
||||
acpidbg.o
|
||||
|
@ -12,10 +12,16 @@
|
||||
#include <acpi/acpi.h>
|
||||
|
||||
/* Headers not included by include/acpi/platform/aclinux.h */
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <error.h>
|
||||
#include <stdbool.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <linux/circ_buf.h>
|
||||
#include <sys/select.h>
|
||||
#include "../../../../../include/linux/circ_buf.h"
|
||||
|
||||
#define ACPI_AML_FILE "/sys/kernel/debug/acpi/acpidbg"
|
||||
#define ACPI_AML_SEC_TICK 1
|
||||
|
@ -19,9 +19,7 @@ vpath %.c \
|
||||
./\
|
||||
../../common\
|
||||
../../os_specific/service_layers
|
||||
CFLAGS += -DACPI_DUMP_APP -I.\
|
||||
-I../../../../../drivers/acpi/acpica\
|
||||
-I../../../../../include
|
||||
CFLAGS += -DACPI_DUMP_APP -I.
|
||||
TOOL_OBJS = \
|
||||
apdump.o\
|
||||
apfiles.o\
|
||||
@ -49,7 +47,9 @@ TOOL_OBJS = \
|
||||
|
||||
include ../../Makefile.rules
|
||||
|
||||
install-man: ../../man/acpidump.8
|
||||
$(INSTALL_DATA) -D $< $(DESTDIR)${mandir}/man8/acpidump.8
|
||||
install-man: $(srctree)/man/acpidump.8
|
||||
$(ECHO) " INST " acpidump.8
|
||||
$(QUIET) $(INSTALL_DATA) -D $< $(DESTDIR)$(mandir)/man8/acpidump.8
|
||||
uninstall-man:
|
||||
- rm -f $(DESTDIR)${mandir}/man8/acpidump.8
|
||||
$(ECHO) " UNINST " acpidump.8
|
||||
$(QUIET) rm -f $(DESTDIR)$(mandir)/man8/acpidump.8
|
||||
|
Loading…
Reference in New Issue
Block a user