summaryrefslogtreecommitdiff
path: root/include/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 /include/acpi
parent4dde507fc1984435f28862ddd1beb90822aa116c (diff)
downloadlinux-sh-4ac4c5fad8a320f75cb84543403fb8bae5ad2254.tar.gz
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 'include/acpi')
-rw-r--r--include/acpi/acbuffer.h4
-rw-r--r--include/acpi/acconfig.h4
-rw-r--r--include/acpi/acexcep.h4
-rw-r--r--include/acpi/acoutput.h4
-rw-r--r--include/acpi/acpiosxf.h4
-rw-r--r--include/acpi/acpixf.h4
-rw-r--r--include/acpi/acrestyp.h4
-rw-r--r--include/acpi/actbl.h4
-rw-r--r--include/acpi/actbl1.h6
-rw-r--r--include/acpi/actbl2.h6
-rw-r--r--include/acpi/actbl3.h6
-rw-r--r--include/acpi/actypes.h4
12 files changed, 45 insertions, 9 deletions
diff --git a/include/acpi/acbuffer.h b/include/acpi/acbuffer.h
index 88cb477524a6..960c76fb69a1 100644
--- a/include/acpi/acbuffer.h
+++ b/include/acpi/acbuffer.h
@@ -44,6 +44,8 @@
#ifndef __ACBUFFER_H__
#define __ACBUFFER_H__
+#pragma pack(push) /* Set default struct packing */
+
/*
* Contains buffer structures for these predefined names:
* _FDE, _GRT, _GTM, _PLD, _SRT
@@ -232,4 +234,6 @@ struct acpi_pld_info {
#define ACPI_PLD_GET_HORIZ_OFFSET(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 128+16=144, Len 16 */
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* ACBUFFER_H */
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 932a60d6ed82..d8a0ba8f88a5 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -44,6 +44,8 @@
#ifndef _ACCONFIG_H
#define _ACCONFIG_H
+#pragma pack(push) /* Set default struct packing */
+
/******************************************************************************
*
* Configuration options
@@ -229,4 +231,6 @@
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* _ACCONFIG_H */
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 8b06e4c1dd5d..f0bcb96b1598 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -44,6 +44,8 @@
#ifndef __ACEXCEP_H__
#define __ACEXCEP_H__
+#pragma pack(push) /* Set default struct packing */
+
/* This module contains all possible exception codes for acpi_status */
/*
@@ -377,4 +379,6 @@ static const struct acpi_exception_info acpi_gbl_exception_names_ctrl[] = {
#endif /* EXCEPTION_TABLE */
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACEXCEP_H__ */
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 1baae6edda89..247636fb51a5 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -44,6 +44,8 @@
#ifndef __ACOUTPUT_H__
#define __ACOUTPUT_H__
+#pragma pack(push) /* Set default struct packing */
+
/*
* Debug levels and component IDs. These are used to control the
* granularity of the output of the ACPI_DEBUG_PRINT macro -- on a
@@ -456,4 +458,6 @@
#endif /* ACPI_DEBUG_OUTPUT */
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACOUTPUT_H__ */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index f6f5f8af2112..a4a2cd39aea9 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -49,6 +49,8 @@
#include <acpi/platform/acenv.h>
#include <acpi/actypes.h>
+#pragma pack(push) /* Set default struct packing */
+
/* Types for acpi_os_execute */
typedef enum {
@@ -399,4 +401,6 @@ char *acpi_os_get_next_filename(void *dir_handle);
void acpi_os_close_directory(void *dir_handle);
#endif
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACPIOSXF_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 51cdf1bbb862..efa767ffe904 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -55,6 +55,8 @@
extern u8 acpi_gbl_permanent_mmap;
+#pragma pack(push) /* Set default struct packing */
+
/*
* Globals that are publically available
*/
@@ -580,4 +582,6 @@ acpi_debug_print_raw(u32 requested_debug_level,
u32 component_id, const char *format, ...);
#endif
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACXFACE_H__ */
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index eb760ca0b2e0..3c83a79c583f 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -44,6 +44,8 @@
#ifndef __ACRESTYP_H__
#define __ACRESTYP_H__
+#pragma pack(push) /* Set default struct packing */
+
/*
* Definitions for Resource Attributes
*/
@@ -610,4 +612,6 @@ struct acpi_pci_routing_table {
char source[4]; /* pad to 64 bits so sizeof() works in all cases */
};
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACRESTYP_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 3b30e36b53b5..b32a33f1c2df 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -44,6 +44,8 @@
#ifndef __ACTBL_H__
#define __ACTBL_H__
+#pragma pack(push) /* Set default struct packing */
+
/*******************************************************************************
*
* Fundamental ACPI tables
@@ -404,4 +406,6 @@ struct acpi_table_desc {
#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control))
#define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt))
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 212c65de75df..b7f0b0c6ff66 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -44,6 +44,8 @@
#ifndef __ACTBL1_H__
#define __ACTBL1_H__
+#pragma pack(push) /* Set default struct packing */
+
/*******************************************************************************
*
* Additional ACPI Tables (1)
@@ -972,8 +974,6 @@ struct acpi_srat_x2apic_cpu_affinity {
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
-/* Reset to default packing */
-
-#pragma pack()
+#pragma pack(pop) /* Restore original struct packing */
#endif /* __ACTBL1_H__ */
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index f3372441e3a5..89a26135745b 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -44,6 +44,8 @@
#ifndef __ACTBL2_H__
#define __ACTBL2_H__
+#pragma pack(push) /* Set default struct packing */
+
/*******************************************************************************
*
* Additional ACPI Tables (2)
@@ -1229,8 +1231,6 @@ struct acpi_table_wdrt {
u8 units;
};
-/* Reset to default packing */
-
-#pragma pack()
+#pragma pack(pop) /* Restore original struct packing */
#endif /* __ACTBL2_H__ */
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index c2295cc4a5c0..85ebeea02b81 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -44,6 +44,8 @@
#ifndef __ACTBL3_H__
#define __ACTBL3_H__
+#pragma pack(push) /* Set default struct packing */
+
/*******************************************************************************
*
* Additional ACPI Tables (3)
@@ -622,8 +624,6 @@ struct acpi_tpm2_control {
u64 response_address;
};
-/* Reset to default packing */
-
-#pragma pack()
+#pragma pack(pop) /* Restore original struct packing */
#endif /* __ACTBL3_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index e76356574374..c28573da1662 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -44,6 +44,8 @@
#ifndef __ACTYPES_H__
#define __ACTYPES_H__
+#pragma pack(push) /* Set default struct packing */
+
/* acpisrc:struct_defs -- for acpisrc conversion */
/*
@@ -1223,4 +1225,6 @@ struct acpi_memory_list {
#define ACPI_OSI_WIN_7 0x0B
#define ACPI_OSI_WIN_8 0x0C
+#pragma pack(pop) /* Restore original struct packing */
+
#endif /* __ACTYPES_H__ */