aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acconfig.h4
-rw-r--r--include/acpi/acoutput.h6
-rw-r--r--include/acpi/acpiosxf.h43
-rw-r--r--include/acpi/acpixf.h44
-rw-r--r--include/acpi/actbl.h164
-rw-r--r--include/acpi/actypes.h64
-rw-r--r--include/acpi/cppc_acpi.h18
-rw-r--r--include/acpi/platform/acenv.h90
-rw-r--r--include/acpi/platform/acenvex.h21
-rw-r--r--include/acpi/platform/acgcc.h17
-rw-r--r--include/acpi/platform/acgccex.h58
-rw-r--r--include/acpi/platform/aclinux.h22
-rw-r--r--include/acpi/platform/aclinuxex.h2
13 files changed, 304 insertions, 249 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index fe2e3ac7b5e3..12c2882bf647 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -144,6 +144,10 @@
144 144
145#define ACPI_ADDRESS_RANGE_MAX 2 145#define ACPI_ADDRESS_RANGE_MAX 2
146 146
147/* Maximum number of While() loops before abort */
148
149#define ACPI_MAX_LOOP_COUNT 0xFFFF
150
147/****************************************************************************** 151/******************************************************************************
148 * 152 *
149 * ACPI Specification constants (Do not change unless the specification changes) 153 * ACPI Specification constants (Do not change unless the specification changes)
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 34f601e7b88d..48eb4dd99bb1 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -366,7 +366,7 @@
366 ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, u32, value) 366 ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, u32, value)
367 367
368#define ACPI_FUNCTION_TRACE_STR(name, string) \ 368#define ACPI_FUNCTION_TRACE_STR(name, string) \
369 ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, char *, string) 369 ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, const char *, string)
370 370
371#define ACPI_FUNCTION_ENTRY() \ 371#define ACPI_FUNCTION_ENTRY() \
372 acpi_ut_track_stack_ptr() 372 acpi_ut_track_stack_ptr()
@@ -425,6 +425,9 @@
425#define return_PTR(pointer) \ 425#define return_PTR(pointer) \
426 ACPI_TRACE_EXIT (acpi_ut_ptr_exit, void *, pointer) 426 ACPI_TRACE_EXIT (acpi_ut_ptr_exit, void *, pointer)
427 427
428#define return_STR(string) \
429 ACPI_TRACE_EXIT (acpi_ut_str_exit, const char *, string)
430
428#define return_VALUE(value) \ 431#define return_VALUE(value) \
429 ACPI_TRACE_EXIT (acpi_ut_value_exit, u64, value) 432 ACPI_TRACE_EXIT (acpi_ut_value_exit, u64, value)
430 433
@@ -478,6 +481,7 @@
478#define return_VOID return 481#define return_VOID return
479#define return_ACPI_STATUS(s) return(s) 482#define return_ACPI_STATUS(s) return(s)
480#define return_PTR(s) return(s) 483#define return_PTR(s) return(s)
484#define return_STR(s) return(s)
481#define return_VALUE(s) return(s) 485#define return_VALUE(s) return(s)
482#define return_UINT8(s) return(s) 486#define return_UINT8(s) return(s)
483#define return_UINT32(s) return(s) 487#define return_UINT32(s) return(s)
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 562603d7aabe..f3414c83abb1 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -371,6 +371,12 @@ acpi_status acpi_os_wait_command_ready(void);
371acpi_status acpi_os_notify_command_complete(void); 371acpi_status acpi_os_notify_command_complete(void);
372#endif 372#endif
373 373
374#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_trace_point
375void
376acpi_os_trace_point(acpi_trace_event_type type,
377 u8 begin, u8 *aml, char *pathname);
378#endif
379
374/* 380/*
375 * Obtain ACPI table(s) 381 * Obtain ACPI table(s)
376 */ 382 */
@@ -416,41 +422,4 @@ char *acpi_os_get_next_filename(void *dir_handle);
416void acpi_os_close_directory(void *dir_handle); 422void acpi_os_close_directory(void *dir_handle);
417#endif 423#endif
418 424
419/*
420 * File I/O and related support
421 */
422#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_file
423ACPI_FILE acpi_os_open_file(const char *path, u8 modes);
424#endif
425
426#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_file
427void acpi_os_close_file(ACPI_FILE file);
428#endif
429
430#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_file
431int
432acpi_os_read_file(ACPI_FILE file,
433 void *buffer, acpi_size size, acpi_size count);
434#endif
435
436#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_file
437int
438acpi_os_write_file(ACPI_FILE file,
439 void *buffer, acpi_size size, acpi_size count);
440#endif
441
442#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_file_offset
443long acpi_os_get_file_offset(ACPI_FILE file);
444#endif
445
446#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_set_file_offset
447acpi_status acpi_os_set_file_offset(ACPI_FILE file, long offset, u8 from);
448#endif
449
450#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_trace_point
451void
452acpi_os_trace_point(acpi_trace_event_type type,
453 u8 begin, u8 *aml, char *pathname);
454#endif
455
456#endif /* __ACPIOSXF_H__ */ 425#endif /* __ACPIOSXF_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 1ff3a76c265d..c7b3a132dbe7 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20160422 49#define ACPI_CA_VERSION 0x20160831
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -195,6 +195,13 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
195ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE); 195ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE);
196 196
197/* 197/*
198 * Optionally support module level code by parsing the entire table as
199 * a term_list. Default is FALSE, do not execute entire table until some
200 * lock order issues are fixed.
201 */
202ACPI_INIT_GLOBAL(u8, acpi_gbl_parse_table_as_term_list, FALSE);
203
204/*
198 * Optionally use 32-bit FADT addresses if and when there is a conflict 205 * Optionally use 32-bit FADT addresses if and when there is a conflict
199 * (address mismatch) between the 32-bit and 64-bit versions of the 206 * (address mismatch) between the 32-bit and 64-bit versions of the
200 * address. Although ACPICA adheres to the ACPI specification which 207 * address. Although ACPICA adheres to the ACPI specification which
@@ -416,18 +423,19 @@ ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
416/* 423/*
417 * Initialization 424 * Initialization
418 */ 425 */
419ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init 426ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
420 acpi_initialize_tables(struct acpi_table_desc 427 acpi_initialize_tables(struct acpi_table_desc
421 *initial_storage, 428 *initial_storage,
422 u32 initial_table_count, 429 u32 initial_table_count,
423 u8 allow_resize)) 430 u8 allow_resize))
424ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_initialize_subsystem(void)) 431ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
425 432 acpi_initialize_subsystem(void))
426ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_enable_subsystem(u32 flags)) 433ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
427 434 acpi_enable_subsystem(u32 flags))
428ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init 435ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
429 acpi_initialize_objects(u32 flags)) 436 acpi_initialize_objects(u32 flags))
430ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_terminate(void)) 437ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
438 acpi_terminate(void))
431 439
432/* 440/*
433 * Miscellaneous global interfaces 441 * Miscellaneous global interfaces
@@ -467,7 +475,7 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
467/* 475/*
468 * ACPI table load/unload interfaces 476 * ACPI table load/unload interfaces
469 */ 477 */
470ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init 478ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
471 acpi_install_table(acpi_physical_address address, 479 acpi_install_table(acpi_physical_address address,
472 u8 physical)) 480 u8 physical))
473 481
@@ -476,14 +484,17 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
476 484
477ACPI_EXTERNAL_RETURN_STATUS(acpi_status 485ACPI_EXTERNAL_RETURN_STATUS(acpi_status
478 acpi_unload_parent_table(acpi_handle object)) 486 acpi_unload_parent_table(acpi_handle object))
479ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void)) 487
488ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
489 acpi_load_tables(void))
480 490
481/* 491/*
482 * ACPI table manipulation interfaces 492 * ACPI table manipulation interfaces
483 */ 493 */
484ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void)) 494ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
495 acpi_reallocate_root_table(void))
485 496
486ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init 497ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
487 acpi_find_root_pointer(acpi_physical_address 498 acpi_find_root_pointer(acpi_physical_address
488 *rsdp_address)) 499 *rsdp_address))
489ACPI_EXTERNAL_RETURN_STATUS(acpi_status 500ACPI_EXTERNAL_RETURN_STATUS(acpi_status
@@ -732,6 +743,10 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
732 u32 gpe_number)) 743 u32 gpe_number))
733 744
734ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 745ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
746 acpi_mask_gpe(acpi_handle gpe_device,
747 u32 gpe_number, u8 is_masked))
748
749ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
735 acpi_mark_gpe_for_wake(acpi_handle gpe_device, 750 acpi_mark_gpe_for_wake(acpi_handle gpe_device,
736 u32 gpe_number)) 751 u32 gpe_number))
737 752
@@ -935,9 +950,6 @@ ACPI_DBG_DEPENDENT_RETURN_VOID(void
935 acpi_trace_point(acpi_trace_event_type type, 950 acpi_trace_point(acpi_trace_event_type type,
936 u8 begin, 951 u8 begin,
937 u8 *aml, char *pathname)) 952 u8 *aml, char *pathname))
938ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
939 void ACPI_INTERNAL_VAR_XFACE
940 acpi_log_error(const char *format, ...))
941 953
942acpi_status acpi_initialize_debugger(void); 954acpi_status acpi_initialize_debugger(void);
943 955
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index c19700e2a2fe..1b949e08015c 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -230,62 +230,72 @@ struct acpi_table_facs {
230/* Fields common to all versions of the FADT */ 230/* Fields common to all versions of the FADT */
231 231
232struct acpi_table_fadt { 232struct acpi_table_fadt {
233 struct acpi_table_header header; /* Common ACPI table header */ 233 struct acpi_table_header header; /* [V1] Common ACPI table header */
234 u32 facs; /* 32-bit physical address of FACS */ 234 u32 facs; /* [V1] 32-bit physical address of FACS */
235 u32 dsdt; /* 32-bit physical address of DSDT */ 235 u32 dsdt; /* [V1] 32-bit physical address of DSDT */
236 u8 model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ 236 u8 model; /* [V1] System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
237 u8 preferred_profile; /* Conveys preferred power management profile to OSPM. */ 237 u8 preferred_profile; /* [V1] Conveys preferred power management profile to OSPM. */
238 u16 sci_interrupt; /* System vector of SCI interrupt */ 238 u16 sci_interrupt; /* [V1] System vector of SCI interrupt */
239 u32 smi_command; /* 32-bit Port address of SMI command port */ 239 u32 smi_command; /* [V1] 32-bit Port address of SMI command port */
240 u8 acpi_enable; /* Value to write to SMI_CMD to enable ACPI */ 240 u8 acpi_enable; /* [V1] Value to write to SMI_CMD to enable ACPI */
241 u8 acpi_disable; /* Value to write to SMI_CMD to disable ACPI */ 241 u8 acpi_disable; /* [V1] Value to write to SMI_CMD to disable ACPI */
242 u8 s4_bios_request; /* Value to write to SMI_CMD to enter S4BIOS state */ 242 u8 s4_bios_request; /* [V1] Value to write to SMI_CMD to enter S4BIOS state */
243 u8 pstate_control; /* Processor performance state control */ 243 u8 pstate_control; /* [V1] Processor performance state control */
244 u32 pm1a_event_block; /* 32-bit port address of Power Mgt 1a Event Reg Blk */ 244 u32 pm1a_event_block; /* [V1] 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 */ 245 u32 pm1b_event_block; /* [V1] 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 */ 246 u32 pm1a_control_block; /* [V1] 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 */ 247 u32 pm1b_control_block; /* [V1] 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 */ 248 u32 pm2_control_block; /* [V1] 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 */ 249 u32 pm_timer_block; /* [V1] 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 */ 250 u32 gpe0_block; /* [V1] 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 */ 251 u32 gpe1_block; /* [V1] 32-bit port address of General Purpose Event 1 Reg Blk */
252 u8 pm1_event_length; /* Byte Length of ports at pm1x_event_block */ 252 u8 pm1_event_length; /* [V1] Byte Length of ports at pm1x_event_block */
253 u8 pm1_control_length; /* Byte Length of ports at pm1x_control_block */ 253 u8 pm1_control_length; /* [V1] Byte Length of ports at pm1x_control_block */
254 u8 pm2_control_length; /* Byte Length of ports at pm2_control_block */ 254 u8 pm2_control_length; /* [V1] Byte Length of ports at pm2_control_block */
255 u8 pm_timer_length; /* Byte Length of ports at pm_timer_block */ 255 u8 pm_timer_length; /* [V1] Byte Length of ports at pm_timer_block */
256 u8 gpe0_block_length; /* Byte Length of ports at gpe0_block */ 256 u8 gpe0_block_length; /* [V1] Byte Length of ports at gpe0_block */
257 u8 gpe1_block_length; /* Byte Length of ports at gpe1_block */ 257 u8 gpe1_block_length; /* [V1] Byte Length of ports at gpe1_block */
258 u8 gpe1_base; /* Offset in GPE number space where GPE1 events start */ 258 u8 gpe1_base; /* [V1] Offset in GPE number space where GPE1 events start */
259 u8 cst_control; /* Support for the _CST object and C-States change notification */ 259 u8 cst_control; /* [V1] Support for the _CST object and C-States change notification */
260 u16 c2_latency; /* Worst case HW latency to enter/exit C2 state */ 260 u16 c2_latency; /* [V1] Worst case HW latency to enter/exit C2 state */
261 u16 c3_latency; /* Worst case HW latency to enter/exit C3 state */ 261 u16 c3_latency; /* [V1] Worst case HW latency to enter/exit C3 state */
262 u16 flush_size; /* Processor memory cache line width, in bytes */ 262 u16 flush_size; /* [V1] Processor memory cache line width, in bytes */
263 u16 flush_stride; /* Number of flush strides that need to be read */ 263 u16 flush_stride; /* [V1] Number of flush strides that need to be read */
264 u8 duty_offset; /* Processor duty cycle index in processor P_CNT reg */ 264 u8 duty_offset; /* [V1] Processor duty cycle index in processor P_CNT reg */
265 u8 duty_width; /* Processor duty cycle value bit width in P_CNT register */ 265 u8 duty_width; /* [V1] Processor duty cycle value bit width in P_CNT register */
266 u8 day_alarm; /* Index to day-of-month alarm in RTC CMOS RAM */ 266 u8 day_alarm; /* [V1] Index to day-of-month alarm in RTC CMOS RAM */
267 u8 month_alarm; /* Index to month-of-year alarm in RTC CMOS RAM */ 267 u8 month_alarm; /* [V1] Index to month-of-year alarm in RTC CMOS RAM */
268 u8 century; /* Index to century in RTC CMOS RAM */ 268 u8 century; /* [V1] Index to century in RTC CMOS RAM */
269 u16 boot_flags; /* IA-PC Boot Architecture Flags (see below for individual flags) */ 269 u16 boot_flags; /* [V3] IA-PC Boot Architecture Flags (see below for individual flags) */
270 u8 reserved; /* Reserved, must be zero */ 270 u8 reserved; /* [V1] Reserved, must be zero */
271 u32 flags; /* Miscellaneous flag bits (see below for individual flags) */ 271 u32 flags; /* [V1] Miscellaneous flag bits (see below for individual flags) */
272 struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */ 272 /* End of Version 1 FADT fields (ACPI 1.0) */
273 u8 reset_value; /* Value to write to the reset_register port to reset the system */ 273
274 u16 arm_boot_flags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ 274 struct acpi_generic_address reset_register; /* [V3] 64-bit address of the Reset register */
275 u8 minor_revision; /* FADT Minor Revision (ACPI 5.1) */ 275 u8 reset_value; /* [V3] Value to write to the reset_register port to reset the system */
276 u64 Xfacs; /* 64-bit physical address of FACS */ 276 u16 arm_boot_flags; /* [V5] ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
277 u64 Xdsdt; /* 64-bit physical address of DSDT */ 277 u8 minor_revision; /* [V5] FADT Minor Revision (ACPI 5.1) */
278 struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ 278 u64 Xfacs; /* [V3] 64-bit physical address of FACS */
279 struct acpi_generic_address xpm1b_event_block; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ 279 u64 Xdsdt; /* [V3] 64-bit physical address of DSDT */
280 struct acpi_generic_address xpm1a_control_block; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */ 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_control_block; /* 64-bit Extended Power Mgt 1b Control 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 xpm2_control_block; /* 64-bit Extended Power Mgt 2 Control 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 xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl 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 xgpe0_block; /* 64-bit Extended General Purpose Event 0 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 xgpe1_block; /* 64-bit Extended General Purpose Event 1 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 sleep_control; /* 64-bit Sleep Control register (ACPI 5.0) */ 286 struct acpi_generic_address xgpe0_block; /* [V3] 64-bit Extended General Purpose Event 0 Reg Blk address */
287 struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */ 287 struct acpi_generic_address xgpe1_block; /* [V3] 64-bit Extended General Purpose Event 1 Reg Blk address */
288 u64 hypervisor_id; /* Hypervisor Vendor ID (ACPI 6.0) */ 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
289}; 299};
290 300
291/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ 301/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
@@ -301,8 +311,8 @@ struct acpi_table_fadt {
301 311
302/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */ 312/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
303 313
304#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */ 314#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 */ 315#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5] HVC must be used instead of SMC as the PSCI conduit */
306 316
307/* Masks for FADT flags */ 317/* Masks for FADT flags */
308 318
@@ -399,20 +409,34 @@ struct acpi_table_desc {
399 * match the expected length. In other words, the length of the 409 * match the expected length. In other words, the length of the
400 * FADT is the bottom line as to what the version really is. 410 * FADT is the bottom line as to what the version really is.
401 * 411 *
402 * For reference, the values below are as follows: 412 * NOTE: There is no officialy released V2 of the FADT. This
403 * FADT V1 size: 0x074 413 * version was used only for prototyping and testing during the
404 * FADT V2 size: 0x084 414 * 32-bit to 64-bit transition. V3 was the first official 64-bit
405 * FADT V3 size: 0x0F4 415 * version of the FADT.
406 * FADT V4 size: 0x0F4 416 *
407 * FADT V5 size: 0x10C 417 * Update this list of defines when a new version of the FADT is
408 * FADT V6 size: 0x114 418 * added to the ACPI specification. Note that the FADT version is
419 * only incremented when new fields are appended to the existing
420 * version. Therefore, the FADT version is competely independent
421 * from the version of the ACPI specification where it is
422 * defined.
423 *
424 * For reference, the various FADT lengths are as follows:
425 * FADT V1 size: 0x074 ACPI 1.0
426 * FADT V3 size: 0x0F4 ACPI 2.0
427 * FADT V4 size: 0x100 ACPI 3.0 and ACPI 4.0
428 * FADT V5 size: 0x10C ACPI 5.0
429 * FADT V6 size: 0x114 ACPI 6.0
409 */ 430 */
410#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) 431#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) /* ACPI 1.0 */
411#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (minor_revision) + 1) 432#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) /* ACPI 2.0 */
412#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) 433#define ACPI_FADT_V4_SIZE (u32) (ACPI_FADT_OFFSET (sleep_status)) /* ACPI 3.0 and ACPI 4.0 */
413#define ACPI_FADT_V5_SIZE (u32) (ACPI_FADT_OFFSET (hypervisor_id)) 434#define ACPI_FADT_V5_SIZE (u32) (ACPI_FADT_OFFSET (hypervisor_id)) /* ACPI 5.0 */
414#define ACPI_FADT_V6_SIZE (u32) (sizeof (struct acpi_table_fadt)) 435#define ACPI_FADT_V6_SIZE (u32) (sizeof (struct acpi_table_fadt)) /* ACPI 6.0 */
436
437/* Update these when new FADT versions are added */
415 438
439#define ACPI_FADT_MAX_VERSION 6
416#define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)" 440#define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)"
417 441
418#endif /* __ACTBL_H__ */ 442#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index cb389efd321c..1d798abae710 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -732,16 +732,17 @@ typedef u32 acpi_event_type;
732 * The encoding of acpi_event_status is illustrated below. 732 * The encoding of acpi_event_status is illustrated below.
733 * Note that a set bit (1) indicates the property is TRUE 733 * Note that a set bit (1) indicates the property is TRUE
734 * (e.g. if bit 0 is set then the event is enabled). 734 * (e.g. if bit 0 is set then the event is enabled).
735 * +-------------+-+-+-+-+-+ 735 * +-------------+-+-+-+-+-+-+
736 * | Bits 31:5 |4|3|2|1|0| 736 * | Bits 31:6 |5|4|3|2|1|0|
737 * +-------------+-+-+-+-+-+ 737 * +-------------+-+-+-+-+-+-+
738 * | | | | | | 738 * | | | | | | |
739 * | | | | | +- Enabled? 739 * | | | | | | +- Enabled?
740 * | | | | +--- Enabled for wake? 740 * | | | | | +--- Enabled for wake?
741 * | | | +----- Status bit set? 741 * | | | | +----- Status bit set?
742 * | | +------- Enable bit set? 742 * | | | +------- Enable bit set?
743 * | +--------- Has a handler? 743 * | | +--------- Has a handler?
744 * +--------------- <Reserved> 744 * | +----------- Masked?
745 * +----------------- <Reserved>
745 */ 746 */
746typedef u32 acpi_event_status; 747typedef u32 acpi_event_status;
747 748
@@ -751,6 +752,7 @@ typedef u32 acpi_event_status;
751#define ACPI_EVENT_FLAG_STATUS_SET (acpi_event_status) 0x04 752#define ACPI_EVENT_FLAG_STATUS_SET (acpi_event_status) 0x04
752#define ACPI_EVENT_FLAG_ENABLE_SET (acpi_event_status) 0x08 753#define ACPI_EVENT_FLAG_ENABLE_SET (acpi_event_status) 0x08
753#define ACPI_EVENT_FLAG_HAS_HANDLER (acpi_event_status) 0x10 754#define ACPI_EVENT_FLAG_HAS_HANDLER (acpi_event_status) 0x10
755#define ACPI_EVENT_FLAG_MASKED (acpi_event_status) 0x20
754#define ACPI_EVENT_FLAG_SET ACPI_EVENT_FLAG_STATUS_SET 756#define ACPI_EVENT_FLAG_SET ACPI_EVENT_FLAG_STATUS_SET
755 757
756/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */ 758/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */
@@ -761,14 +763,15 @@ typedef u32 acpi_event_status;
761 763
762/* 764/*
763 * GPE info flags - Per GPE 765 * GPE info flags - Per GPE
764 * +-------+-+-+---+ 766 * +---+-+-+-+---+
765 * | 7:5 |4|3|2:0| 767 * |7:6|5|4|3|2:0|
766 * +-------+-+-+---+ 768 * +---+-+-+-+---+
767 * | | | | 769 * | | | | |
768 * | | | +-- Type of dispatch:to method, handler, notify, or none 770 * | | | | +-- Type of dispatch:to method, handler, notify, or none
769 * | | +----- Interrupt type: edge or level triggered 771 * | | | +----- Interrupt type: edge or level triggered
770 * | +------- Is a Wake GPE 772 * | | +------- Is a Wake GPE
771 * +------------ <Reserved> 773 * | +--------- Is GPE masked by the software GPE masking machanism
774 * +------------ <Reserved>
772 */ 775 */
773#define ACPI_GPE_DISPATCH_NONE (u8) 0x00 776#define ACPI_GPE_DISPATCH_NONE (u8) 0x00
774#define ACPI_GPE_DISPATCH_METHOD (u8) 0x01 777#define ACPI_GPE_DISPATCH_METHOD (u8) 0x01
@@ -1031,12 +1034,6 @@ struct acpi_statistics {
1031 u32 method_count; 1034 u32 method_count;
1032}; 1035};
1033 1036
1034/* Table Event Types */
1035
1036#define ACPI_TABLE_EVENT_LOAD 0x0
1037#define ACPI_TABLE_EVENT_UNLOAD 0x1
1038#define ACPI_NUM_TABLE_EVENTS 2
1039
1040/* 1037/*
1041 * Types specific to the OS service interfaces 1038 * Types specific to the OS service interfaces
1042 */ 1039 */
@@ -1088,9 +1085,13 @@ acpi_status (*acpi_exception_handler) (acpi_status aml_status,
1088typedef 1085typedef
1089acpi_status (*acpi_table_handler) (u32 event, void *table, void *context); 1086acpi_status (*acpi_table_handler) (u32 event, void *table, void *context);
1090 1087
1091#define ACPI_TABLE_LOAD 0x0 1088/* Table Event Types */
1092#define ACPI_TABLE_UNLOAD 0x1 1089
1093#define ACPI_NUM_TABLE_EVENTS 2 1090#define ACPI_TABLE_EVENT_LOAD 0x0
1091#define ACPI_TABLE_EVENT_UNLOAD 0x1
1092#define ACPI_TABLE_EVENT_INSTALL 0x2
1093#define ACPI_TABLE_EVENT_UNINSTALL 0x3
1094#define ACPI_NUM_TABLE_EVENTS 4
1094 1095
1095/* Address Spaces (For Operation Regions) */ 1096/* Address Spaces (For Operation Regions) */
1096 1097
@@ -1285,15 +1286,6 @@ typedef enum {
1285#define ACPI_OSI_WIN_8 0x0C 1286#define ACPI_OSI_WIN_8 0x0C
1286#define ACPI_OSI_WIN_10 0x0D 1287#define ACPI_OSI_WIN_10 0x0D
1287 1288
1288/* Definitions of file IO */
1289
1290#define ACPI_FILE_READING 0x01
1291#define ACPI_FILE_WRITING 0x02
1292#define ACPI_FILE_BINARY 0x04
1293
1294#define ACPI_FILE_BEGIN 0x01
1295#define ACPI_FILE_END 0x02
1296
1297/* Definitions of getopt */ 1289/* Definitions of getopt */
1298 1290
1299#define ACPI_OPT_END -1 1291#define ACPI_OPT_END -1
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index 284965cbc9af..427a7c3e6c75 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -24,7 +24,9 @@
24#define CPPC_NUM_ENT 21 24#define CPPC_NUM_ENT 21
25#define CPPC_REV 2 25#define CPPC_REV 2
26 26
27#define PCC_CMD_COMPLETE 1 27#define PCC_CMD_COMPLETE_MASK (1 << 0)
28#define PCC_ERROR_MASK (1 << 2)
29
28#define MAX_CPC_REG_ENT 19 30#define MAX_CPC_REG_ENT 19
29 31
30/* CPPC specific PCC commands. */ 32/* CPPC specific PCC commands. */
@@ -49,6 +51,7 @@ struct cpc_reg {
49 */ 51 */
50struct cpc_register_resource { 52struct cpc_register_resource {
51 acpi_object_type type; 53 acpi_object_type type;
54 u64 __iomem *sys_mem_vaddr;
52 union { 55 union {
53 struct cpc_reg reg; 56 struct cpc_reg reg;
54 u64 int_value; 57 u64 int_value;
@@ -60,8 +63,11 @@ struct cpc_desc {
60 int num_entries; 63 int num_entries;
61 int version; 64 int version;
62 int cpu_id; 65 int cpu_id;
66 int write_cmd_status;
67 int write_cmd_id;
63 struct cpc_register_resource cpc_regs[MAX_CPC_REG_ENT]; 68 struct cpc_register_resource cpc_regs[MAX_CPC_REG_ENT];
64 struct acpi_psd_package domain_info; 69 struct acpi_psd_package domain_info;
70 struct kobject kobj;
65}; 71};
66 72
67/* These are indexes into the per-cpu cpc_regs[]. Order is important. */ 73/* These are indexes into the per-cpu cpc_regs[]. Order is important. */
@@ -96,7 +102,6 @@ enum cppc_regs {
96struct cppc_perf_caps { 102struct cppc_perf_caps {
97 u32 highest_perf; 103 u32 highest_perf;
98 u32 nominal_perf; 104 u32 nominal_perf;
99 u32 reference_perf;
100 u32 lowest_perf; 105 u32 lowest_perf;
101}; 106};
102 107
@@ -108,13 +113,13 @@ struct cppc_perf_ctrls {
108 113
109struct cppc_perf_fb_ctrs { 114struct cppc_perf_fb_ctrs {
110 u64 reference; 115 u64 reference;
111 u64 prev_reference;
112 u64 delivered; 116 u64 delivered;
113 u64 prev_delivered; 117 u64 reference_perf;
118 u64 ctr_wrap_time;
114}; 119};
115 120
116/* Per CPU container for runtime CPPC management. */ 121/* Per CPU container for runtime CPPC management. */
117struct cpudata { 122struct cppc_cpudata {
118 int cpu; 123 int cpu;
119 struct cppc_perf_caps perf_caps; 124 struct cppc_perf_caps perf_caps;
120 struct cppc_perf_ctrls perf_ctrls; 125 struct cppc_perf_ctrls perf_ctrls;
@@ -127,6 +132,7 @@ struct cpudata {
127extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs); 132extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs);
128extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls); 133extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
129extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps); 134extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
130extern int acpi_get_psd_map(struct cpudata **); 135extern int acpi_get_psd_map(struct cppc_cpudata **);
136extern unsigned int cppc_get_transition_latency(int cpu);
131 137
132#endif /* _CPPC_ACPI_H*/ 138#endif /* _CPPC_ACPI_H*/
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 86b5a8447606..34cce729109c 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -78,6 +78,7 @@
78 (defined ACPI_EXAMPLE_APP) 78 (defined ACPI_EXAMPLE_APP)
79#define ACPI_APPLICATION 79#define ACPI_APPLICATION
80#define ACPI_SINGLE_THREADED 80#define ACPI_SINGLE_THREADED
81#define USE_NATIVE_ALLOCATE_ZEROED
81#endif 82#endif
82 83
83/* iASL configuration */ 84/* iASL configuration */
@@ -124,7 +125,6 @@
124 125
125#ifdef ACPI_DUMP_APP 126#ifdef ACPI_DUMP_APP
126#define ACPI_USE_NATIVE_MEMORY_MAPPING 127#define ACPI_USE_NATIVE_MEMORY_MAPPING
127#define USE_NATIVE_ALLOCATE_ZEROED
128#endif 128#endif
129 129
130/* acpi_names/Example configuration. Hardware disabled */ 130/* acpi_names/Example configuration. Hardware disabled */
@@ -149,7 +149,6 @@
149/* Common for all ACPICA applications */ 149/* Common for all ACPICA applications */
150 150
151#ifdef ACPI_APPLICATION 151#ifdef ACPI_APPLICATION
152#define ACPI_USE_SYSTEM_CLIBRARY
153#define ACPI_USE_LOCAL_CACHE 152#define ACPI_USE_LOCAL_CACHE
154#endif 153#endif
155 154
@@ -167,10 +166,21 @@
167/****************************************************************************** 166/******************************************************************************
168 * 167 *
169 * Host configuration files. The compiler configuration files are included 168 * Host configuration files. The compiler configuration files are included
170 * by the host files. 169 * first.
171 * 170 *
172 *****************************************************************************/ 171 *****************************************************************************/
173 172
173#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
174#include <acpi/platform/acgcc.h>
175
176#elif defined(_MSC_VER)
177#include "acmsvc.h"
178
179#elif defined(__INTEL_COMPILER)
180#include "acintel.h"
181
182#endif
183
174#if defined(_LINUX) || defined(__linux__) 184#if defined(_LINUX) || defined(__linux__)
175#include <acpi/platform/aclinux.h> 185#include <acpi/platform/aclinux.h>
176 186
@@ -210,18 +220,20 @@
210#elif defined(__OS2__) 220#elif defined(__OS2__)
211#include "acos2.h" 221#include "acos2.h"
212 222
213#elif defined(_AED_EFI)
214#include "acefi.h"
215
216#elif defined(_GNU_EFI)
217#include "acefi.h"
218
219#elif defined(__HAIKU__) 223#elif defined(__HAIKU__)
220#include "achaiku.h" 224#include "achaiku.h"
221 225
222#elif defined(__QNX__) 226#elif defined(__QNX__)
223#include "acqnx.h" 227#include "acqnx.h"
224 228
229/*
230 * EFI applications can be built with -nostdlib, in this case, it must be
231 * included after including all other host environmental definitions, in
232 * order to override the definitions.
233 */
234#elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
235#include "acefi.h"
236
225#else 237#else
226 238
227/* Unknown environment */ 239/* Unknown environment */
@@ -326,7 +338,8 @@
326 * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. 338 * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
327 * Otherwise, local versions of string/memory functions will be used. 339 * Otherwise, local versions of string/memory functions will be used.
328 * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and 340 * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
329 * the standard header files may be used. 341 * the standard header files may be used. Defining this implies that
342 * ACPI_USE_SYSTEM_CLIBRARY has been defined.
330 * 343 *
331 * The ACPICA subsystem only uses low level C library functions that do not 344 * The ACPICA subsystem only uses low level C library functions that do not
332 * call operating system services and may therefore be inlined in the code. 345 * call operating system services and may therefore be inlined in the code.
@@ -334,7 +347,6 @@
334 * It may be necessary to tailor these include files to the target 347 * It may be necessary to tailor these include files to the target
335 * generation environment. 348 * generation environment.
336 */ 349 */
337#ifdef ACPI_USE_SYSTEM_CLIBRARY
338 350
339/* Use the standard C library headers. We want to keep these to a minimum. */ 351/* Use the standard C library headers. We want to keep these to a minimum. */
340 352
@@ -342,57 +354,20 @@
342 354
343/* Use the standard headers from the standard locations */ 355/* Use the standard headers from the standard locations */
344 356
345#include <stdarg.h>
346#include <stdlib.h> 357#include <stdlib.h>
347#include <string.h> 358#include <string.h>
348#include <ctype.h> 359#include <ctype.h>
360#ifdef ACPI_APPLICATION
361#include <stdio.h>
362#include <fcntl.h>
363#include <errno.h>
364#include <time.h>
365#include <signal.h>
366#endif
349 367
350#endif /* ACPI_USE_STANDARD_HEADERS */ 368#endif /* ACPI_USE_STANDARD_HEADERS */
351 369
352/* We will be linking to the standard Clib functions */
353
354#else
355
356/******************************************************************************
357 *
358 * Not using native C library, use local implementations
359 *
360 *****************************************************************************/
361
362/*
363 * Use local definitions of C library macros and functions. These function
364 * implementations may not be as efficient as an inline or assembly code
365 * implementation provided by a native C library, but they are functionally
366 * equivalent.
367 */
368#ifndef va_arg
369
370#ifndef _VALIST
371#define _VALIST
372typedef char *va_list;
373#endif /* _VALIST */
374
375/* Storage alignment properties */
376
377#define _AUPBND (sizeof (acpi_native_int) - 1)
378#define _ADNBND (sizeof (acpi_native_int) - 1)
379
380/* Variable argument list macro definitions */
381
382#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd)))
383#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
384#define va_end(ap) (ap = (va_list) NULL)
385#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND))))
386
387#endif /* va_arg */
388
389/* Use the local (ACPICA) definitions of the clib functions */
390
391#endif /* ACPI_USE_SYSTEM_CLIBRARY */
392
393#ifndef ACPI_FILE
394#ifdef ACPI_APPLICATION 370#ifdef ACPI_APPLICATION
395#include <stdio.h>
396#define ACPI_FILE FILE * 371#define ACPI_FILE FILE *
397#define ACPI_FILE_OUT stdout 372#define ACPI_FILE_OUT stdout
398#define ACPI_FILE_ERR stderr 373#define ACPI_FILE_ERR stderr
@@ -401,6 +376,9 @@ typedef char *va_list;
401#define ACPI_FILE_OUT NULL 376#define ACPI_FILE_OUT NULL
402#define ACPI_FILE_ERR NULL 377#define ACPI_FILE_ERR NULL
403#endif /* ACPI_APPLICATION */ 378#endif /* ACPI_APPLICATION */
404#endif /* ACPI_FILE */ 379
380#ifndef ACPI_INIT_FUNCTION
381#define ACPI_INIT_FUNCTION
382#endif
405 383
406#endif /* __ACENV_H__ */ 384#endif /* __ACENV_H__ */
diff --git a/include/acpi/platform/acenvex.h b/include/acpi/platform/acenvex.h
index 4f15c1d10b61..b3171b9d6974 100644
--- a/include/acpi/platform/acenvex.h
+++ b/include/acpi/platform/acenvex.h
@@ -56,17 +56,24 @@
56#if defined(_LINUX) || defined(__linux__) 56#if defined(_LINUX) || defined(__linux__)
57#include <acpi/platform/aclinuxex.h> 57#include <acpi/platform/aclinuxex.h>
58 58
59#elif defined(WIN32) 59#elif defined(__DragonFly__)
60#include "acwinex.h" 60#include "acdragonflyex.h"
61 61
62#elif defined(_AED_EFI) 62/*
63 * EFI applications can be built with -nostdlib, in this case, it must be
64 * included after including all other host environmental definitions, in
65 * order to override the definitions.
66 */
67#elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
63#include "acefiex.h" 68#include "acefiex.h"
64 69
65#elif defined(_GNU_EFI) 70#endif
66#include "acefiex.h"
67 71
68#elif defined(__DragonFly__) 72#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
69#include "acdragonflyex.h" 73#include "acgccex.h"
74
75#elif defined(_MSC_VER)
76#include "acmsvcex.h"
70 77
71#endif 78#endif
72 79
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index c5a216c976fa..8f66aaabadf7 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -44,6 +44,12 @@
44#ifndef __ACGCC_H__ 44#ifndef __ACGCC_H__
45#define __ACGCC_H__ 45#define __ACGCC_H__
46 46
47/*
48 * Use compiler specific <stdarg.h> is a good practice for even when
49 * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
50 */
51#include <stdarg.h>
52
47#define ACPI_INLINE __inline__ 53#define ACPI_INLINE __inline__
48 54
49/* Function name is used for debug output. Non-ANSI, compiler-dependent */ 55/* Function name is used for debug output. Non-ANSI, compiler-dependent */
@@ -64,17 +70,6 @@
64 */ 70 */
65#define ACPI_UNUSED_VAR __attribute__ ((unused)) 71#define ACPI_UNUSED_VAR __attribute__ ((unused))
66 72
67/*
68 * Some versions of gcc implement strchr() with a buggy macro. So,
69 * undef it here. Prevents error messages of this form (usually from the
70 * file getopt.c):
71 *
72 * error: logical '&&' with non-zero constant will always evaluate as true
73 */
74#ifdef strchr
75#undef strchr
76#endif
77
78/* GCC supports __VA_ARGS__ in macros */ 73/* GCC supports __VA_ARGS__ in macros */
79 74
80#define COMPILER_VA_MACRO 1 75#define COMPILER_VA_MACRO 1
diff --git a/include/acpi/platform/acgccex.h b/include/acpi/platform/acgccex.h
new file mode 100644
index 000000000000..46ead2caada4
--- /dev/null
+++ b/include/acpi/platform/acgccex.h
@@ -0,0 +1,58 @@
1/******************************************************************************
2 *
3 * Name: acgccex.h - Extra GCC specific defines, etc.
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2016, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACGCCEX_H__
45#define __ACGCCEX_H__
46
47/*
48 * Some versions of gcc implement strchr() with a buggy macro. So,
49 * undef it here. Prevents error messages of this form (usually from the
50 * file getopt.c):
51 *
52 * error: logical '&&' with non-zero constant will always evaluate as true
53 */
54#ifdef strchr
55#undef strchr
56#endif
57
58#endif /* __ACGCCEX_H__ */
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 93b61b1f2beb..a5d98d171866 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -92,6 +92,8 @@
92#include <asm/acenv.h> 92#include <asm/acenv.h>
93#endif 93#endif
94 94
95#define ACPI_INIT_FUNCTION __init
96
95#ifndef CONFIG_ACPI 97#ifndef CONFIG_ACPI
96 98
97/* External globals for __KERNEL__, stubs is needed */ 99/* External globals for __KERNEL__, stubs is needed */
@@ -168,13 +170,21 @@
168#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename 170#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename
169#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory 171#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory
170 172
173#define ACPI_MSG_ERROR KERN_ERR "ACPI Error: "
174#define ACPI_MSG_EXCEPTION KERN_ERR "ACPI Exception: "
175#define ACPI_MSG_WARNING KERN_WARNING "ACPI Warning: "
176#define ACPI_MSG_INFO KERN_INFO "ACPI: "
177
178#define ACPI_MSG_BIOS_ERROR KERN_ERR "ACPI BIOS Error (bug): "
179#define ACPI_MSG_BIOS_WARNING KERN_WARNING "ACPI BIOS Warning (bug): "
180
171#else /* !__KERNEL__ */ 181#else /* !__KERNEL__ */
172 182
173#include <stdarg.h> 183#define ACPI_USE_STANDARD_HEADERS
174#include <string.h> 184
175#include <stdlib.h> 185#ifdef ACPI_USE_STANDARD_HEADERS
176#include <ctype.h>
177#include <unistd.h> 186#include <unistd.h>
187#endif
178 188
179/* Define/disable kernel-specific declarators */ 189/* Define/disable kernel-specific declarators */
180 190
@@ -205,8 +215,4 @@
205 215
206#endif /* __KERNEL__ */ 216#endif /* __KERNEL__ */
207 217
208/* Linux uses GCC */
209
210#include <acpi/platform/acgcc.h>
211
212#endif /* __ACLINUX_H__ */ 218#endif /* __ACLINUX_H__ */
diff --git a/include/acpi/platform/aclinuxex.h b/include/acpi/platform/aclinuxex.h
index f8bb0d857bff..a5509d87230a 100644
--- a/include/acpi/platform/aclinuxex.h
+++ b/include/acpi/platform/aclinuxex.h
@@ -71,7 +71,7 @@
71/* 71/*
72 * Overrides for in-kernel ACPICA 72 * Overrides for in-kernel ACPICA
73 */ 73 */
74acpi_status __init acpi_os_initialize(void); 74acpi_status ACPI_INIT_FUNCTION acpi_os_initialize(void);
75 75
76acpi_status acpi_os_terminate(void); 76acpi_status acpi_os_terminate(void);
77 77