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"

+137 -140
+4 -6
drivers/acpi/acpica/tbfadt.c
··· 480 u32 i; 481 482 /* 483 - * For ACPI 1.0 FADTs (revision 1), ensure that reserved fields which 484 * should be zero are indeed zero. This will workaround BIOSs that 485 * inadvertently place values in these fields. 486 * 487 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located 488 * at offset 45, 55, 95, and the word located at offset 109, 110. 489 * 490 - * Note: The FADT revision value is unreliable because of BIOS errors. 491 - * The table length is instead used as the final word on the version. 492 - * 493 - * Note: FADT revision 3 is the ACPI 2.0 version of the FADT. 494 */ 495 - if (acpi_gbl_FADT.header.length <= ACPI_FADT_V3_SIZE) { 496 acpi_gbl_FADT.preferred_profile = 0; 497 acpi_gbl_FADT.pstate_control = 0; 498 acpi_gbl_FADT.cst_control = 0;
··· 480 u32 i; 481 482 /* 483 + * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which 484 * should be zero are indeed zero. This will workaround BIOSs that 485 * inadvertently place values in these fields. 486 * 487 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located 488 * at offset 45, 55, 95, and the word located at offset 109, 110. 489 * 490 + * Note: The FADT revision value is unreliable. Only the length can be 491 + * trusted. 492 */ 493 + if (acpi_gbl_FADT.header.length <= ACPI_FADT_V2_SIZE) { 494 acpi_gbl_FADT.preferred_profile = 0; 495 acpi_gbl_FADT.pstate_control = 0; 496 acpi_gbl_FADT.cst_control = 0;
+7 -6
drivers/mailbox/pcc.c
··· 65 #include <linux/mailbox_controller.h> 66 #include <linux/mailbox_client.h> 67 #include <linux/io-64-nonatomic-lo-hi.h> 68 69 #include "mailbox.h" 70 ··· 268 if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone) 269 chan->txdone_method |= TXDONE_BY_ACK; 270 271 if (pcc_doorbell_irq[subspace_id] > 0) { 272 int rc; 273 ··· 278 if (unlikely(rc)) { 279 dev_err(dev, "failed to register PCC interrupt %d\n", 280 pcc_doorbell_irq[subspace_id]); 281 chan = ERR_PTR(rc); 282 } 283 } 284 - 285 - spin_unlock_irqrestore(&chan->lock, flags); 286 287 return chan; 288 } ··· 306 return; 307 } 308 309 spin_lock_irqsave(&chan->lock, flags); 310 chan->cl = NULL; 311 chan->active_req = NULL; 312 if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK)) 313 chan->txdone_method = TXDONE_BY_POLL; 314 315 - if (pcc_doorbell_irq[id] > 0) 316 - devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan); 317 - 318 spin_unlock_irqrestore(&chan->lock, flags); 319 } 320 EXPORT_SYMBOL_GPL(pcc_mbox_free_channel); 321 - 322 323 /** 324 * pcc_send_data - Called from Mailbox Controller code. Used
··· 65 #include <linux/mailbox_controller.h> 66 #include <linux/mailbox_client.h> 67 #include <linux/io-64-nonatomic-lo-hi.h> 68 + #include <acpi/pcc.h> 69 70 #include "mailbox.h" 71 ··· 267 if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone) 268 chan->txdone_method |= TXDONE_BY_ACK; 269 270 + spin_unlock_irqrestore(&chan->lock, flags); 271 + 272 if (pcc_doorbell_irq[subspace_id] > 0) { 273 int rc; 274 ··· 275 if (unlikely(rc)) { 276 dev_err(dev, "failed to register PCC interrupt %d\n", 277 pcc_doorbell_irq[subspace_id]); 278 + pcc_mbox_free_channel(chan); 279 chan = ERR_PTR(rc); 280 } 281 } 282 283 return chan; 284 } ··· 304 return; 305 } 306 307 + if (pcc_doorbell_irq[id] > 0) 308 + devm_free_irq(chan->mbox->dev, pcc_doorbell_irq[id], chan); 309 + 310 spin_lock_irqsave(&chan->lock, flags); 311 chan->cl = NULL; 312 chan->active_req = NULL; 313 if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK)) 314 chan->txdone_method = TXDONE_BY_POLL; 315 316 spin_unlock_irqrestore(&chan->lock, flags); 317 } 318 EXPORT_SYMBOL_GPL(pcc_mbox_free_channel); 319 320 /** 321 * pcc_send_data - Called from Mailbox Controller code. Used
+70 -94
include/acpi/actbl.h
··· 230 /* Fields common to all versions of the FADT */ 231 232 struct acpi_table_fadt { 233 - struct acpi_table_header header; /* [V1] Common ACPI table header */ 234 - u32 facs; /* [V1] 32-bit physical address of FACS */ 235 - u32 dsdt; /* [V1] 32-bit physical address of DSDT */ 236 - u8 model; /* [V1] System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ 237 - u8 preferred_profile; /* [V1] Conveys preferred power management profile to OSPM. */ 238 - u16 sci_interrupt; /* [V1] System vector of SCI interrupt */ 239 - u32 smi_command; /* [V1] 32-bit Port address of SMI command port */ 240 - u8 acpi_enable; /* [V1] Value to write to SMI_CMD to enable ACPI */ 241 - u8 acpi_disable; /* [V1] Value to write to SMI_CMD to disable ACPI */ 242 - u8 s4_bios_request; /* [V1] Value to write to SMI_CMD to enter S4BIOS state */ 243 - u8 pstate_control; /* [V1] Processor performance state control */ 244 - u32 pm1a_event_block; /* [V1] 32-bit port address of Power Mgt 1a Event Reg Blk */ 245 - u32 pm1b_event_block; /* [V1] 32-bit port address of Power Mgt 1b Event Reg Blk */ 246 - u32 pm1a_control_block; /* [V1] 32-bit port address of Power Mgt 1a Control Reg Blk */ 247 - u32 pm1b_control_block; /* [V1] 32-bit port address of Power Mgt 1b Control Reg Blk */ 248 - u32 pm2_control_block; /* [V1] 32-bit port address of Power Mgt 2 Control Reg Blk */ 249 - u32 pm_timer_block; /* [V1] 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ 250 - u32 gpe0_block; /* [V1] 32-bit port address of General Purpose Event 0 Reg Blk */ 251 - u32 gpe1_block; /* [V1] 32-bit port address of General Purpose Event 1 Reg Blk */ 252 - u8 pm1_event_length; /* [V1] Byte Length of ports at pm1x_event_block */ 253 - u8 pm1_control_length; /* [V1] Byte Length of ports at pm1x_control_block */ 254 - u8 pm2_control_length; /* [V1] Byte Length of ports at pm2_control_block */ 255 - u8 pm_timer_length; /* [V1] Byte Length of ports at pm_timer_block */ 256 - u8 gpe0_block_length; /* [V1] Byte Length of ports at gpe0_block */ 257 - u8 gpe1_block_length; /* [V1] Byte Length of ports at gpe1_block */ 258 - u8 gpe1_base; /* [V1] Offset in GPE number space where GPE1 events start */ 259 - u8 cst_control; /* [V1] Support for the _CST object and C-States change notification */ 260 - u16 c2_latency; /* [V1] Worst case HW latency to enter/exit C2 state */ 261 - u16 c3_latency; /* [V1] Worst case HW latency to enter/exit C3 state */ 262 - u16 flush_size; /* [V1] Processor memory cache line width, in bytes */ 263 - u16 flush_stride; /* [V1] Number of flush strides that need to be read */ 264 - u8 duty_offset; /* [V1] Processor duty cycle index in processor P_CNT reg */ 265 - u8 duty_width; /* [V1] Processor duty cycle value bit width in P_CNT register */ 266 - u8 day_alarm; /* [V1] Index to day-of-month alarm in RTC CMOS RAM */ 267 - u8 month_alarm; /* [V1] Index to month-of-year alarm in RTC CMOS RAM */ 268 - u8 century; /* [V1] Index to century in RTC CMOS RAM */ 269 - u16 boot_flags; /* [V3] IA-PC Boot Architecture Flags (see below for individual flags) */ 270 - u8 reserved; /* [V1] Reserved, must be zero */ 271 - u32 flags; /* [V1] Miscellaneous flag bits (see below for individual flags) */ 272 - /* End of Version 1 FADT fields (ACPI 1.0) */ 273 - 274 - struct acpi_generic_address reset_register; /* [V3] 64-bit address of the Reset register */ 275 - u8 reset_value; /* [V3] Value to write to the reset_register port to reset the system */ 276 - u16 arm_boot_flags; /* [V5] ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ 277 - u8 minor_revision; /* [V5] FADT Minor Revision (ACPI 5.1) */ 278 - u64 Xfacs; /* [V3] 64-bit physical address of FACS */ 279 - u64 Xdsdt; /* [V3] 64-bit physical address of DSDT */ 280 - struct acpi_generic_address xpm1a_event_block; /* [V3] 64-bit Extended Power Mgt 1a Event Reg Blk address */ 281 - struct acpi_generic_address xpm1b_event_block; /* [V3] 64-bit Extended Power Mgt 1b Event Reg Blk address */ 282 - struct acpi_generic_address xpm1a_control_block; /* [V3] 64-bit Extended Power Mgt 1a Control Reg Blk address */ 283 - struct acpi_generic_address xpm1b_control_block; /* [V3] 64-bit Extended Power Mgt 1b Control Reg Blk address */ 284 - struct acpi_generic_address xpm2_control_block; /* [V3] 64-bit Extended Power Mgt 2 Control Reg Blk address */ 285 - struct acpi_generic_address xpm_timer_block; /* [V3] 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ 286 - struct acpi_generic_address xgpe0_block; /* [V3] 64-bit Extended General Purpose Event 0 Reg Blk address */ 287 - struct acpi_generic_address xgpe1_block; /* [V3] 64-bit Extended General Purpose Event 1 Reg Blk address */ 288 - /* End of Version 3 FADT fields (ACPI 2.0) */ 289 - 290 - struct acpi_generic_address sleep_control; /* [V4] 64-bit Sleep Control register (ACPI 5.0) */ 291 - /* End of Version 4 FADT fields (ACPI 3.0 and ACPI 4.0) (Field was originally reserved in ACPI 3.0) */ 292 - 293 - struct acpi_generic_address sleep_status; /* [V5] 64-bit Sleep Status register (ACPI 5.0) */ 294 - /* End of Version 5 FADT fields (ACPI 5.0) */ 295 - 296 - u64 hypervisor_id; /* [V6] Hypervisor Vendor ID (ACPI 6.0) */ 297 - /* End of Version 6 FADT fields (ACPI 6.0) */ 298 - 299 }; 300 301 /* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ ··· 301 302 /* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */ 303 304 - #define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5] PSCI 0.2+ is implemented */ 305 - #define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5] HVC must be used instead of SMC as the PSCI conduit */ 306 307 /* Masks for FADT flags */ 308 ··· 399 * match the expected length. In other words, the length of the 400 * FADT is the bottom line as to what the version really is. 401 * 402 - * NOTE: There is no officialy released V2 of the FADT. This 403 - * version was used only for prototyping and testing during the 404 - * 32-bit to 64-bit transition. V3 was the first official 64-bit 405 - * version of the FADT. 406 - * 407 - * Update this list of defines when a new version of the FADT is 408 - * added to the ACPI specification. Note that the FADT version is 409 - * only incremented when new fields are appended to the existing 410 - * version. Therefore, the FADT version is competely independent 411 - * from the version of the ACPI specification where it is 412 - * defined. 413 - * 414 - * For reference, the various FADT lengths are as follows: 415 - * FADT V1 size: 0x074 ACPI 1.0 416 - * FADT V3 size: 0x0F4 ACPI 2.0 417 - * FADT V4 size: 0x100 ACPI 3.0 and ACPI 4.0 418 - * FADT V5 size: 0x10C ACPI 5.0 419 - * FADT V6 size: 0x114 ACPI 6.0 420 */ 421 - #define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) /* ACPI 1.0 */ 422 - #define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) /* ACPI 2.0 */ 423 - #define ACPI_FADT_V4_SIZE (u32) (ACPI_FADT_OFFSET (sleep_status)) /* ACPI 3.0 and ACPI 4.0 */ 424 - #define ACPI_FADT_V5_SIZE (u32) (ACPI_FADT_OFFSET (hypervisor_id)) /* ACPI 5.0 */ 425 - #define ACPI_FADT_V6_SIZE (u32) (sizeof (struct acpi_table_fadt)) /* ACPI 6.0 */ 426 427 - /* Update these when new FADT versions are added */ 428 - 429 - #define ACPI_FADT_MAX_VERSION 6 430 #define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)" 431 432 #endif /* __ACTBL_H__ */
··· 230 /* Fields common to all versions of the FADT */ 231 232 struct acpi_table_fadt { 233 + struct acpi_table_header header; /* Common ACPI table header */ 234 + u32 facs; /* 32-bit physical address of FACS */ 235 + u32 dsdt; /* 32-bit physical address of DSDT */ 236 + u8 model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ 237 + u8 preferred_profile; /* Conveys preferred power management profile to OSPM. */ 238 + u16 sci_interrupt; /* System vector of SCI interrupt */ 239 + u32 smi_command; /* 32-bit Port address of SMI command port */ 240 + u8 acpi_enable; /* Value to write to SMI_CMD to enable ACPI */ 241 + u8 acpi_disable; /* Value to write to SMI_CMD to disable ACPI */ 242 + u8 s4_bios_request; /* Value to write to SMI_CMD to enter S4BIOS state */ 243 + u8 pstate_control; /* Processor performance state control */ 244 + u32 pm1a_event_block; /* 32-bit port address of Power Mgt 1a Event Reg Blk */ 245 + u32 pm1b_event_block; /* 32-bit port address of Power Mgt 1b Event Reg Blk */ 246 + u32 pm1a_control_block; /* 32-bit port address of Power Mgt 1a Control Reg Blk */ 247 + u32 pm1b_control_block; /* 32-bit port address of Power Mgt 1b Control Reg Blk */ 248 + u32 pm2_control_block; /* 32-bit port address of Power Mgt 2 Control Reg Blk */ 249 + u32 pm_timer_block; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ 250 + u32 gpe0_block; /* 32-bit port address of General Purpose Event 0 Reg Blk */ 251 + u32 gpe1_block; /* 32-bit port address of General Purpose Event 1 Reg Blk */ 252 + u8 pm1_event_length; /* Byte Length of ports at pm1x_event_block */ 253 + u8 pm1_control_length; /* Byte Length of ports at pm1x_control_block */ 254 + u8 pm2_control_length; /* Byte Length of ports at pm2_control_block */ 255 + u8 pm_timer_length; /* Byte Length of ports at pm_timer_block */ 256 + u8 gpe0_block_length; /* Byte Length of ports at gpe0_block */ 257 + u8 gpe1_block_length; /* Byte Length of ports at gpe1_block */ 258 + u8 gpe1_base; /* Offset in GPE number space where GPE1 events start */ 259 + u8 cst_control; /* Support for the _CST object and C-States change notification */ 260 + u16 c2_latency; /* Worst case HW latency to enter/exit C2 state */ 261 + u16 c3_latency; /* Worst case HW latency to enter/exit C3 state */ 262 + u16 flush_size; /* Processor memory cache line width, in bytes */ 263 + u16 flush_stride; /* Number of flush strides that need to be read */ 264 + u8 duty_offset; /* Processor duty cycle index in processor P_CNT reg */ 265 + u8 duty_width; /* Processor duty cycle value bit width in P_CNT register */ 266 + u8 day_alarm; /* Index to day-of-month alarm in RTC CMOS RAM */ 267 + u8 month_alarm; /* Index to month-of-year alarm in RTC CMOS RAM */ 268 + u8 century; /* Index to century in RTC CMOS RAM */ 269 + u16 boot_flags; /* IA-PC Boot Architecture Flags (see below for individual flags) */ 270 + u8 reserved; /* Reserved, must be zero */ 271 + u32 flags; /* Miscellaneous flag bits (see below for individual flags) */ 272 + struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */ 273 + u8 reset_value; /* Value to write to the reset_register port to reset the system */ 274 + u16 arm_boot_flags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ 275 + u8 minor_revision; /* FADT Minor Revision (ACPI 5.1) */ 276 + u64 Xfacs; /* 64-bit physical address of FACS */ 277 + u64 Xdsdt; /* 64-bit physical address of DSDT */ 278 + struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ 279 + struct acpi_generic_address xpm1b_event_block; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ 280 + struct acpi_generic_address xpm1a_control_block; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */ 281 + struct acpi_generic_address xpm1b_control_block; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */ 282 + struct acpi_generic_address xpm2_control_block; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */ 283 + struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ 284 + struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ 285 + struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ 286 + struct acpi_generic_address sleep_control; /* 64-bit Sleep Control register (ACPI 5.0) */ 287 + struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */ 288 + u64 hypervisor_id; /* Hypervisor Vendor ID (ACPI 6.0) */ 289 }; 290 291 /* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ ··· 311 312 /* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */ 313 314 + #define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */ 315 + #define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */ 316 317 /* Masks for FADT flags */ 318 ··· 409 * match the expected length. In other words, the length of the 410 * FADT is the bottom line as to what the version really is. 411 * 412 + * For reference, the values below are as follows: 413 + * FADT V1 size: 0x074 414 + * FADT V2 size: 0x084 415 + * FADT V3 size: 0x0F4 416 + * FADT V4 size: 0x0F4 417 + * FADT V5 size: 0x10C 418 + * FADT V6 size: 0x114 419 */ 420 + #define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) 421 + #define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (minor_revision) + 1) 422 + #define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) 423 + #define ACPI_FADT_V5_SIZE (u32) (ACPI_FADT_OFFSET (hypervisor_id)) 424 + #define ACPI_FADT_V6_SIZE (u32) (sizeof (struct acpi_table_fadt)) 425 426 #define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)" 427 428 #endif /* __ACTBL_H__ */
+3
include/acpi/platform/aclinux.h
··· 191 #ifndef __init 192 #define __init 193 #endif 194 195 /* Host-dependent types and defines for user-space ACPICA */ 196
··· 191 #ifndef __init 192 #define __init 193 #endif 194 + #ifndef __iomem 195 + #define __iomem 196 + #endif 197 198 /* Host-dependent types and defines for user-space ACPICA */ 199
+12 -11
tools/power/acpi/Makefile.config
··· 8 # as published by the Free Software Foundation; version 2 9 # of the License. 10 11 - include ../../../../scripts/Makefile.include 12 13 - OUTPUT=./ 14 ifeq ("$(origin O)", "command line") 15 - OUTPUT := $(O)/ 16 endif 17 - 18 - ifneq ($(OUTPUT),) 19 - # check that the output directory actually exists 20 - OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) 21 - $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) 22 - endif 23 24 # --- CONFIGURATION BEGIN --- 25 ··· 71 WARNINGS += $(call cc-supports,-Wstrict-prototypes) 72 WARNINGS += $(call cc-supports,-Wdeclaration-after-statement) 73 74 - KERNEL_INCLUDE := ../../../include 75 - ACPICA_INCLUDE := ../../../drivers/acpi/acpica 76 CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE) 77 CFLAGS += $(WARNINGS) 78
··· 8 # as published by the Free Software Foundation; version 2 9 # of the License. 10 11 + ifeq ($(srctree),) 12 + srctree := $(patsubst %/,%,$(dir $(shell pwd))) 13 + srctree := $(patsubst %/,%,$(dir $(srctree))) 14 + #$(info Determined 'srctree' to be $(srctree)) 15 + endif 16 17 + include $(srctree)/../../scripts/Makefile.include 18 + 19 + OUTPUT=$(srctree)/ 20 ifeq ("$(origin O)", "command line") 21 + OUTPUT := $(O)/power/acpi/ 22 endif 23 + #$(info Determined 'OUTPUT' to be $(OUTPUT)) 24 25 # --- CONFIGURATION BEGIN --- 26 ··· 70 WARNINGS += $(call cc-supports,-Wstrict-prototypes) 71 WARNINGS += $(call cc-supports,-Wdeclaration-after-statement) 72 73 + KERNEL_INCLUDE := $(OUTPUT)include 74 + ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica 75 CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE) 76 CFLAGS += $(WARNINGS) 77
+27 -13
tools/power/acpi/Makefile.rules
··· 8 # as published by the Free Software Foundation; version 2 9 # of the License. 10 11 - $(OUTPUT)$(TOOL): $(TOOL_OBJS) FORCE 12 - $(ECHO) " LD " $@ 13 - $(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(TOOL_OBJS) -L$(OUTPUT) -o $@ 14 $(QUIET) $(STRIPCMD) $@ 15 16 - $(OUTPUT)%.o: %.c 17 - $(ECHO) " CC " $@ 18 $(QUIET) $(CC) -c $(CFLAGS) -o $@ $< 19 20 all: $(OUTPUT)$(TOOL) 21 clean: 22 - -find $(OUTPUT) \( -not -type d \) \ 23 - -and \( -name '*~' -o -name '*.[oas]' \) \ 24 - -type f -print \ 25 - | xargs rm -f 26 - -rm -f $(OUTPUT)$(TOOL) 27 28 install-tools: 29 - $(INSTALL) -d $(DESTDIR)${sbindir} 30 - $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)${sbindir} 31 uninstall-tools: 32 - - rm -f $(DESTDIR)${sbindir}/$(TOOL) 33 34 install: all install-tools $(EXTRA_INSTALL) 35 uninstall: uninstall-tools $(EXTRA_UNINSTALL)
··· 8 # as published by the Free Software Foundation; version 2 9 # of the License. 10 11 + objdir := $(OUTPUT)tools/$(TOOL)/ 12 + toolobjs := $(addprefix $(objdir),$(TOOL_OBJS)) 13 + $(OUTPUT)$(TOOL): $(toolobjs) FORCE 14 + $(ECHO) " LD " $(subst $(OUTPUT),,$@) 15 + $(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(toolobjs) -L$(OUTPUT) -o $@ 16 + $(ECHO) " STRIP " $(subst $(OUTPUT),,$@) 17 $(QUIET) $(STRIPCMD) $@ 18 19 + $(KERNEL_INCLUDE): 20 + $(ECHO) " MKDIR " $(subst $(OUTPUT),,$@) 21 + $(QUIET) mkdir -p $(KERNEL_INCLUDE) 22 + $(ECHO) " CP " $(subst $(OUTPUT),,$@) 23 + $(QUIET) cp -rf $(srctree)/../../../include/acpi $(KERNEL_INCLUDE)/ 24 + 25 + $(objdir)%.o: %.c $(KERNEL_INCLUDE) 26 + $(ECHO) " CC " $(subst $(OUTPUT),,$@) 27 $(QUIET) $(CC) -c $(CFLAGS) -o $@ $< 28 29 all: $(OUTPUT)$(TOOL) 30 clean: 31 + $(ECHO) " RMOBJ " $(subst $(OUTPUT),,$(objdir)) 32 + $(QUIET) find $(objdir) \( -not -type d \)\ 33 + -and \( -name '*~' -o -name '*.[oas]' \)\ 34 + -type f -print | xargs rm -f 35 + $(ECHO) " RM " $(TOOL) 36 + $(QUIET) rm -f $(OUTPUT)$(TOOL) 37 + $(ECHO) " RMINC " $(subst $(OUTPUT),,$(KERNEL_INCLUDE)) 38 + $(QUIET) rm -rf $(KERNEL_INCLUDE) 39 40 install-tools: 41 + $(ECHO) " INST " $(TOOL) 42 + $(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir) 43 + $(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir) 44 uninstall-tools: 45 + $(ECHO) " UNINST " $(TOOL) 46 + $(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL) 47 48 install: all install-tools $(EXTRA_INSTALL) 49 uninstall: uninstall-tools $(EXTRA_UNINSTALL)
+1 -3
tools/power/acpi/tools/acpidbg/Makefile
··· 17 ../../os_specific/service_layers\ 18 . 19 CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\ 20 - -I.\ 21 - -I../../../../../drivers/acpi/acpica\ 22 - -I../../../../../include 23 LDFLAGS += -lpthread 24 TOOL_OBJS = \ 25 acpidbg.o
··· 17 ../../os_specific/service_layers\ 18 . 19 CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\ 20 + -I. 21 LDFLAGS += -lpthread 22 TOOL_OBJS = \ 23 acpidbg.o
+7 -1
tools/power/acpi/tools/acpidbg/acpidbg.c
··· 12 #include <acpi/acpi.h> 13 14 /* Headers not included by include/acpi/platform/aclinux.h */ 15 #include <stdbool.h> 16 #include <fcntl.h> 17 #include <assert.h> 18 - #include <linux/circ_buf.h> 19 20 #define ACPI_AML_FILE "/sys/kernel/debug/acpi/acpidbg" 21 #define ACPI_AML_SEC_TICK 1
··· 12 #include <acpi/acpi.h> 13 14 /* Headers not included by include/acpi/platform/aclinux.h */ 15 + #include <unistd.h> 16 + #include <stdio.h> 17 + #include <stdlib.h> 18 + #include <string.h> 19 + #include <error.h> 20 #include <stdbool.h> 21 #include <fcntl.h> 22 #include <assert.h> 23 + #include <sys/select.h> 24 + #include "../../../../../include/linux/circ_buf.h" 25 26 #define ACPI_AML_FILE "/sys/kernel/debug/acpi/acpidbg" 27 #define ACPI_AML_SEC_TICK 1
+6 -6
tools/power/acpi/tools/acpidump/Makefile
··· 19 ./\ 20 ../../common\ 21 ../../os_specific/service_layers 22 - CFLAGS += -DACPI_DUMP_APP -I.\ 23 - -I../../../../../drivers/acpi/acpica\ 24 - -I../../../../../include 25 TOOL_OBJS = \ 26 apdump.o\ 27 apfiles.o\ ··· 47 48 include ../../Makefile.rules 49 50 - install-man: ../../man/acpidump.8 51 - $(INSTALL_DATA) -D $< $(DESTDIR)${mandir}/man8/acpidump.8 52 uninstall-man: 53 - - rm -f $(DESTDIR)${mandir}/man8/acpidump.8
··· 19 ./\ 20 ../../common\ 21 ../../os_specific/service_layers 22 + CFLAGS += -DACPI_DUMP_APP -I. 23 TOOL_OBJS = \ 24 apdump.o\ 25 apfiles.o\ ··· 49 50 include ../../Makefile.rules 51 52 + install-man: $(srctree)/man/acpidump.8 53 + $(ECHO) " INST " acpidump.8 54 + $(QUIET) $(INSTALL_DATA) -D $< $(DESTDIR)$(mandir)/man8/acpidump.8 55 uninstall-man: 56 + $(ECHO) " UNINST " acpidump.8 57 + $(QUIET) rm -f $(DESTDIR)$(mandir)/man8/acpidump.8