Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ac4c5fa authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki
Browse files

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: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 4dde507f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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__ */
+4 −0
Original line number Diff line number Diff line
@@ -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_ */
+3 −0
Original line number Diff line number Diff line
@@ -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__  */
+4 −0
Original line number Diff line number Diff line
@@ -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__ */
+4 −0
Original line number Diff line number Diff line
@@ -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__ */
Loading