summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2014-02-26 10:28:32 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-27 00:45:59 +0100
commit4ac4c5fad8a320f75cb84543403fb8bae5ad2254 (patch)
tree93b6c6a9dbc086412a1c2603cd5b47cc4d322e1f /drivers/acpi
parent4dde507fc1984435f28862ddd1beb90822aa116c (diff)
ACPICA: Headers: Deploy #pragma pack (push) and (pop).
Use push and pop to both guarantee that the correct alignment is used, and to restore the alignment to whatever it was before the header was included. It is reported that the #pragma pack(push/pop) directives are not supported by the specific GCCs, but this patch still doesn't affect kernel build as there are already #pragma pack([1]) directives used in the old ACPICA headers, which means there shouldn't be GCCs that are currently used to compile the ACPI kernels do not support #pragma pack() directives. References: https://bugs.acpica.org/show_bug.cgi?id=1058 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpica/acdebug.h4
-rw-r--r--drivers/acpi/acpica/acdispat.h4
-rw-r--r--drivers/acpi/acpica/acevents.h3
-rw-r--r--drivers/acpi/acpica/acglobal.h4
-rw-r--r--drivers/acpi/acpica/achware.h4
-rw-r--r--drivers/acpi/acpica/acinterp.h4
-rw-r--r--drivers/acpi/acpica/aclocal.h4
-rw-r--r--drivers/acpi/acpica/acmacros.h4
-rw-r--r--drivers/acpi/acpica/acnamesp.h4
-rw-r--r--drivers/acpi/acpica/acobject.h4
-rw-r--r--drivers/acpi/acpica/acparser.h4
-rw-r--r--drivers/acpi/acpica/acpredef.h4
-rw-r--r--drivers/acpi/acpica/acresrc.h4
-rw-r--r--drivers/acpi/acpica/acstruct.h4
-rw-r--r--drivers/acpi/acpica/actables.h4
-rw-r--r--drivers/acpi/acpica/acutils.h4
-rw-r--r--drivers/acpi/acpica/amlcode.h4
-rw-r--r--drivers/acpi/acpica/amlresrc.h4
18 files changed, 70 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 68a91eb0fa48..e9ab514a96c8 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -44,6 +44,8 @@
#ifndef __ACDEBUG_H__
#define __ACDEBUG_H__
+#pragma pack(push) /* Set default struct packing */
+
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
struct acpi_db_command_info {
@@ -282,4 +284,6 @@ struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name);
void acpi_db_uint32_to_hex_string(u32 value, char *buffer);
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACDEBUG_H__ */
diff --git a/drivers/acpi/acpica/acdispat.h b/drivers/acpi/acpica/acdispat.h
index 5b472c43c31d..53b6dd679ffa 100644
--- a/drivers/acpi/acpica/acdispat.h
+++ b/drivers/acpi/acpica/acdispat.h
@@ -44,6 +44,8 @@
#ifndef _ACDISPAT_H_
#define _ACDISPAT_H_
+#pragma pack(push) /* Set default struct packing */
+
#define NAMEOF_LOCAL_NTE "__L0"
#define NAMEOF_ARG_NTE "__A0"
@@ -351,4 +353,6 @@ acpi_status
acpi_ds_result_push(union acpi_operand_object *object,
struct acpi_walk_state *walk_state);
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* _ACDISPAT_H_ */
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index 68ec61fff188..75f25eda3a6a 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -44,6 +44,8 @@
#ifndef __ACEVENTS_H__
#define __ACEVENTS_H__
+#pragma pack(push) /* Set default struct packing */
+
/*
* evevent
*/
@@ -251,4 +253,5 @@ u32 acpi_ev_install_sci_handler(void);
acpi_status acpi_ev_remove_all_sci_handlers(void);
ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void))
+#pragma pack(pop) /* Restore original struct packing */
#endif /* __ACEVENTS_H__ */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index b88771b13779..203b2dc5ea28 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -44,6 +44,8 @@
#ifndef __ACGLOBAL_H__
#define __ACGLOBAL_H__
+#pragma pack(push) /* Set default struct packing */
+
/*
* Ensure that the globals are actually defined and initialized only once.
*
@@ -520,4 +522,6 @@ ACPI_FILE ACPI_INIT_GLOBAL(acpi_gbl_debug_file, NULL);
extern const struct ah_predefined_name asl_predefined_info[];
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACGLOBAL_H__ */
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h
index 2ad2351a9833..4a0e63457881 100644
--- a/drivers/acpi/acpica/achware.h
+++ b/drivers/acpi/acpica/achware.h
@@ -44,6 +44,8 @@
#ifndef __ACHWARE_H__
#define __ACHWARE_H__
+#pragma pack(push) /* Set default struct packing */
+
/* Values for the _SST predefined method */
#define ACPI_SST_INDICATOR_OFF 0
@@ -147,4 +149,6 @@ acpi_status
acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
acpi_handle root_pci_device, acpi_handle pci_region);
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACHWARE_H__ */
diff --git a/drivers/acpi/acpica/acinterp.h b/drivers/acpi/acpica/acinterp.h
index 948a6800ab09..277f4d03c080 100644
--- a/drivers/acpi/acpica/acinterp.h
+++ b/drivers/acpi/acpica/acinterp.h
@@ -44,6 +44,8 @@
#ifndef __ACINTERP_H__
#define __ACINTERP_H__
+#pragma pack(push) /* Set default struct packing */
+
#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
/* Macros for tables used for debug output */
@@ -531,4 +533,6 @@ acpi_ex_data_table_space_handler(u32 function,
u64 *value,
void *handler_context, void *region_context);
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __INTERP_H__ */
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 52a21dafb540..fee53b50399b 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -44,6 +44,8 @@
#ifndef __ACLOCAL_H__
#define __ACLOCAL_H__
+#pragma pack(push) /* Set default struct packing */
+
/* acpisrc:struct_defs -- for acpisrc conversion */
#define ACPI_SERIALIZED 0xFF
@@ -1147,4 +1149,6 @@ struct ah_predefined_name {
#endif
};
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACLOCAL_H__ */
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 4bceb11c7380..9b0ce226bf5d 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -44,6 +44,8 @@
#ifndef __ACMACROS_H__
#define __ACMACROS_H__
+#pragma pack(push) /* Set default struct packing */
+
/*
* Extract data using a pointer. Any more than a byte and we
* get into potential aligment issues -- see the STORE macros below.
@@ -427,4 +429,6 @@
#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7'))
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* ACMACROS_H */
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index ee1c040f321c..751083dd7793 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -44,6 +44,8 @@
#ifndef __ACNAMESP_H__
#define __ACNAMESP_H__
+#pragma pack(push) /* Set default struct packing */
+
/* To search the entire name space, pass this as search_base */
#define ACPI_NS_ALL ((acpi_handle)0)
@@ -404,4 +406,6 @@ struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle);
void acpi_ns_terminate(void);
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACNAMESP_H__ */
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
index 1a4d61805ebc..7ce7e9f1a040 100644
--- a/drivers/acpi/acpica/acobject.h
+++ b/drivers/acpi/acpica/acobject.h
@@ -44,6 +44,8 @@
#ifndef _ACOBJECT_H
#define _ACOBJECT_H
+#pragma pack(push) /* Set default struct packing */
+
/* acpisrc:struct_defs -- for acpisrc conversion */
/*
@@ -456,6 +458,6 @@ union acpi_descriptor {
union acpi_parse_object op;
};
-#pragma pack()
+#pragma pack(pop) /* Restore original struct packing */
#endif /* _ACOBJECT_H */
diff --git a/drivers/acpi/acpica/acparser.h b/drivers/acpi/acpica/acparser.h
index 6168b85463ed..3d828be9dc20 100644
--- a/drivers/acpi/acpica/acparser.h
+++ b/drivers/acpi/acpica/acparser.h
@@ -44,6 +44,8 @@
#ifndef __ACPARSER_H__
#define __ACPARSER_H__
+#pragma pack(push) /* Set default struct packing */
+
#define OP_HAS_RETURN_VALUE 1
/* Variable number of arguments. This field must be 32 bits */
@@ -251,4 +253,6 @@ acpi_ps_sprint_op(char *buffer_start,
void acpi_ps_show(union acpi_parse_object *op);
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACPARSER_H__ */
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index 9c73d6c5ead2..01b9eaaa982d 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -44,6 +44,8 @@
#ifndef __ACPREDEF_H__
#define __ACPREDEF_H__
+#pragma pack(push) /* Set default struct packing */
+
/******************************************************************************
*
* Return Package types
@@ -1080,4 +1082,6 @@ static const union acpi_predefined_info acpi_gbl_scope_names[] = {
extern const union acpi_predefined_info acpi_gbl_resource_names[];
#endif
+#pragma pack(pop) /* Restore original struct packing */
+
#endif
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h
index 4b008e8884a1..be16da2d9f3d 100644
--- a/drivers/acpi/acpica/acresrc.h
+++ b/drivers/acpi/acpica/acresrc.h
@@ -48,6 +48,8 @@
#include "amlresrc.h"
+#pragma pack(push) /* Set default struct packing */
+
/*
* If possible, pack the following structures to byte alignment, since we
* don't care about performance for debug output. Two cases where we cannot
@@ -378,4 +380,6 @@ extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[];
extern struct acpi_rsdump_info acpi_rs_dump_general_flags[];
#endif
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACRESRC_H__ */
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h
index 5d2989a1b68c..5a3fa0ddc1bc 100644
--- a/drivers/acpi/acpica/acstruct.h
+++ b/drivers/acpi/acpica/acstruct.h
@@ -44,6 +44,8 @@
#ifndef __ACSTRUCT_H__
#define __ACSTRUCT_H__
+#pragma pack(push) /* Set default struct packing */
+
/* acpisrc:struct_defs -- for acpisrc conversion */
/*****************************************************************************
@@ -241,4 +243,6 @@ struct acpi_walk_info {
#define ACPI_DISPLAY_SHORT (u8) 2
+#pragma pack(pop) /* Restore original struct packing */
+
#endif
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index 5fa4b2027697..9b0f9846e014 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -44,6 +44,8 @@
#ifndef __ACTABLES_H__
#define __ACTABLES_H__
+#pragma pack(push) /* Set default struct packing */
+
acpi_status acpi_allocate_root_table(u32 initial_table_count);
/*
@@ -129,4 +131,6 @@ acpi_tb_install_table(acpi_physical_address address,
acpi_status acpi_tb_parse_root_table(acpi_physical_address rsdp_address);
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACTABLES_H__ */
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index ceeec0b7ccb1..df970ffb7356 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -44,6 +44,8 @@
#ifndef _ACUTILS_H
#define _ACUTILS_H
+#pragma pack(push) /* Set default struct packing */
+
extern const u8 acpi_gbl_resource_aml_sizes[];
extern const u8 acpi_gbl_resource_aml_serial_bus_sizes[];
@@ -737,4 +739,6 @@ acpi_ut_method_error(const char *module_name,
struct acpi_namespace_node *node,
const char *path, acpi_status lookup_status);
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* _ACUTILS_H */
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h
index 5908ccec6aea..2db27109d70e 100644
--- a/drivers/acpi/acpica/amlcode.h
+++ b/drivers/acpi/acpica/amlcode.h
@@ -46,6 +46,8 @@
#ifndef __AMLCODE_H__
#define __AMLCODE_H__
+#pragma pack(push) /* Set default struct packing */
+
/* primary opcodes */
#define AML_NULL_CHAR (u16) 0x00
@@ -484,4 +486,6 @@ typedef enum {
#define AML_METHOD_SERIALIZED 0x08
#define AML_METHOD_SYNC_LEVEL 0xF0
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __AMLCODE_H__ */
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h
index f3f834408441..334fbeee80d2 100644
--- a/drivers/acpi/acpica/amlresrc.h
+++ b/drivers/acpi/acpica/amlresrc.h
@@ -46,6 +46,8 @@
#ifndef __AMLRESRC_H
#define __AMLRESRC_H
+#pragma pack(push) /* Set default struct packing */
+
/*
* Resource descriptor tags, as defined in the ACPI specification.
* Used to symbolically reference fields within a descriptor.
@@ -449,4 +451,6 @@ union aml_resource {
u8 byte_item;
};
+#pragma pack(pop) /* Restore original struct packing */
+
#endif