aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2007-02-02 11:48:23 -0500
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:29 -0500
commit7c9626bade13de3f160f0926455328650045d6cd (patch)
treead1c472ce9584bc58fb5d07a029f0608f6a5e612 /include
parent8876016bb384044a59c1e2ddcad4cf41b06344b9 (diff)
ACPICA: Ensure that all structures in acobject.h are aligned, via #pragma.
Thus, even if the default compiler setting is non-aligned, the header is compiled correctly. Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acobject.h17
-rw-r--r--include/acpi/actypes.h4
2 files changed, 19 insertions, 2 deletions
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 8fdee31119f3..b81e9234472b 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -52,7 +52,15 @@
52 * to the interpreter, and to keep track of the various handlers such as 52 * to the interpreter, and to keep track of the various handlers such as
53 * address space handlers and notify handlers. The object is a constant 53 * address space handlers and notify handlers. The object is a constant
54 * size in order to allow it to be cached and reused. 54 * size in order to allow it to be cached and reused.
55 *
56 * Note: The object is optimized to be aligned and will not work if it is
57 * byte-packed.
55 */ 58 */
59#if ACPI_MACHINE_WIDTH == 64
60#pragma pack(8)
61#else
62#pragma pack(4)
63#endif
56 64
57/******************************************************************************* 65/*******************************************************************************
58 * 66 *
@@ -101,7 +109,8 @@ struct acpi_object_common {
101ACPI_OBJECT_COMMON_HEADER}; 109ACPI_OBJECT_COMMON_HEADER};
102 110
103struct acpi_object_integer { 111struct acpi_object_integer {
104 ACPI_OBJECT_COMMON_HEADER acpi_integer value; 112 ACPI_OBJECT_COMMON_HEADER u8 fill[3]; /* Prevent warning on some compilers */
113 acpi_integer value;
105}; 114};
106 115
107/* 116/*
@@ -203,7 +212,9 @@ struct acpi_object_power_resource {
203}; 212};
204 213
205struct acpi_object_processor { 214struct acpi_object_processor {
206 ACPI_OBJECT_COMMON_HEADER u8 proc_id; 215 ACPI_OBJECT_COMMON_HEADER
216 /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
217 u8 proc_id;
207 u8 length; 218 u8 length;
208 ACPI_COMMON_NOTIFY_INFO acpi_io_address address; 219 ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
209}; 220};
@@ -406,4 +417,6 @@ union acpi_descriptor {
406 union acpi_parse_object op; 417 union acpi_parse_object op;
407}; 418};
408 419
420#pragma pack()
421
409#endif /* _ACOBJECT_H */ 422#endif /* _ACOBJECT_H */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 6fa3f2a13db5..d213f9782154 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -156,6 +156,7 @@ typedef u64 acpi_physical_address;
156#define ACPI_MAX_PTR ACPI_UINT64_MAX 156#define ACPI_MAX_PTR ACPI_UINT64_MAX
157#define ACPI_SIZE_MAX ACPI_UINT64_MAX 157#define ACPI_SIZE_MAX ACPI_UINT64_MAX
158 158
159#define ACPI_NATIVE_BOUNDARY 8
159#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ 160#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
160 161
161/* 162/*
@@ -196,6 +197,8 @@ typedef u32 acpi_physical_address;
196#define ACPI_MAX_PTR ACPI_UINT32_MAX 197#define ACPI_MAX_PTR ACPI_UINT32_MAX
197#define ACPI_SIZE_MAX ACPI_UINT32_MAX 198#define ACPI_SIZE_MAX ACPI_UINT32_MAX
198 199
200#define ACPI_NATIVE_BOUNDARY 4
201
199/******************************************************************************* 202/*******************************************************************************
200 * 203 *
201 * Types specific to 16-bit targets 204 * Types specific to 16-bit targets
@@ -222,6 +225,7 @@ typedef char *acpi_physical_address;
222#define ACPI_MAX_PTR ACPI_UINT16_MAX 225#define ACPI_MAX_PTR ACPI_UINT16_MAX
223#define ACPI_SIZE_MAX ACPI_UINT16_MAX 226#define ACPI_SIZE_MAX ACPI_UINT16_MAX
224 227
228#define ACPI_NATIVE_BOUNDARY 2
225#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ 229#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
226 230
227/* 64-bit integers cannot be supported */ 231/* 64-bit integers cannot be supported */