summaryrefslogtreecommitdiffstats
path: root/include/acpi/acobject.h
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2007-02-02 19:48:23 +0300
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:29 -0500
commit7c9626bade13de3f160f0926455328650045d6cd (patch)
treead1c472ce9584bc58fb5d07a029f0608f6a5e612 /include/acpi/acobject.h
parent8876016bb384044a59c1e2ddcad4cf41b06344b9 (diff)
downloadlinux-7c9626bade13de3f160f0926455328650045d6cd.tar.gz
linux-7c9626bade13de3f160f0926455328650045d6cd.tar.bz2
linux-7c9626bade13de3f160f0926455328650045d6cd.zip
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/acpi/acobject.h')
-rw-r--r--include/acpi/acobject.h17
1 files changed, 15 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 @@
* to the interpreter, and to keep track of the various handlers such as
* address space handlers and notify handlers. The object is a constant
* size in order to allow it to be cached and reused.
+ *
+ * Note: The object is optimized to be aligned and will not work if it is
+ * byte-packed.
*/
+#if ACPI_MACHINE_WIDTH == 64
+#pragma pack(8)
+#else
+#pragma pack(4)
+#endif
/*******************************************************************************
*
@@ -101,7 +109,8 @@ struct acpi_object_common {
ACPI_OBJECT_COMMON_HEADER};
struct acpi_object_integer {
- ACPI_OBJECT_COMMON_HEADER acpi_integer value;
+ ACPI_OBJECT_COMMON_HEADER u8 fill[3]; /* Prevent warning on some compilers */
+ acpi_integer value;
};
/*
@@ -203,7 +212,9 @@ struct acpi_object_power_resource {
};
struct acpi_object_processor {
- ACPI_OBJECT_COMMON_HEADER u8 proc_id;
+ ACPI_OBJECT_COMMON_HEADER
+ /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
+ u8 proc_id;
u8 length;
ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
};
@@ -406,4 +417,6 @@ union acpi_descriptor {
union acpi_parse_object op;
};
+#pragma pack()
+
#endif /* _ACOBJECT_H */