From 6a00113de8b9060a7227bcfa79b3786e3e592a33 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 13 Jul 2017 02:20:27 +0200 Subject: Rename __attribute__((packed)) --> __packed Also unify __attribute__ ((..)) to __attribute__((..)) and handle ((__packed__)) like ((packed)) Change-Id: Ie60a51c3fa92b5009724a5b7c2932e361bf3490c Signed-off-by: Stefan Reinauer Reviewed-on: https://review.coreboot.org/15921 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/drivers/intel/fsp1_0/fsp_util.c | 2 +- src/drivers/intel/fsp1_0/fsp_util.h | 3 +- src/drivers/intel/fsp1_1/fsp_util.c | 3 +- src/drivers/intel/fsp1_1/include/fsp/gma.h | 19 +++++------ src/drivers/intel/fsp2_0/graphics.c | 3 +- src/drivers/intel/fsp2_0/hob_display.c | 3 +- src/drivers/intel/fsp2_0/include/fsp/upd.h | 6 ++-- src/drivers/intel/fsp2_0/include/fsp/util.h | 5 +-- src/drivers/intel/fsp2_0/memory_init.c | 5 +-- src/drivers/intel/gma/intel_bios.h | 50 +++++++++++++++-------------- src/drivers/intel/gma/opregion.h | 21 ++++++------ src/drivers/intel/mipi_camera/chip.h | 5 +-- src/drivers/intel/wifi/wifi.c | 3 +- 13 files changed, 71 insertions(+), 57 deletions(-) (limited to 'src/drivers/intel') diff --git a/src/drivers/intel/fsp1_0/fsp_util.c b/src/drivers/intel/fsp1_0/fsp_util.c index b43f0df100..fc1bd51161 100644 --- a/src/drivers/intel/fsp1_0/fsp_util.c +++ b/src/drivers/intel/fsp1_0/fsp_util.c @@ -66,7 +66,7 @@ void FspNotify (u32 Phase) * Call the FSP to do memory init. The FSP doesn't return to this function. * The FSP returns to the romstage_main_continue(). */ -void __attribute__ ((noreturn)) fsp_early_init (FSP_INFO_HEADER *fsp_ptr) +void __attribute__((noreturn)) fsp_early_init (FSP_INFO_HEADER *fsp_ptr) { FSP_FSP_INIT FspInitApi; FSP_INIT_PARAMS FspInitParams; diff --git a/src/drivers/intel/fsp1_0/fsp_util.h b/src/drivers/intel/fsp1_0/fsp_util.h index bbdd4de148..badd254f80 100644 --- a/src/drivers/intel/fsp1_0/fsp_util.h +++ b/src/drivers/intel/fsp1_0/fsp_util.h @@ -16,6 +16,7 @@ #ifndef FSP_UTIL_H #define FSP_UTIL_H +#include #include #include "fsp_values.h" @@ -71,7 +72,7 @@ struct mrc_data_container { u32 mrc_checksum; // IP style checksum u32 reserved; // For header alignment u8 mrc_data[0]; // Variable size, platform/run time dependent. -} __attribute__ ((packed)); +} __packed; struct mrc_data_container *find_current_mrc_cache(void); diff --git a/src/drivers/intel/fsp1_1/fsp_util.c b/src/drivers/intel/fsp1_1/fsp_util.c index 8b23c4a388..34d6e4881d 100644 --- a/src/drivers/intel/fsp1_1/fsp_util.c +++ b/src/drivers/intel/fsp1_1/fsp_util.c @@ -14,6 +14,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -185,7 +186,7 @@ BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, struct fsp_runtime { uint32_t fih; uint32_t hob_list; -} __attribute__((packed)); +} __packed; void fsp_set_runtime(FSP_INFO_HEADER *fih, void *hob_list) diff --git a/src/drivers/intel/fsp1_1/include/fsp/gma.h b/src/drivers/intel/fsp1_1/include/fsp/gma.h index b0a2e7ac67..55b09dcb59 100644 --- a/src/drivers/intel/fsp1_1/include/fsp/gma.h +++ b/src/drivers/intel/fsp1_1/include/fsp/gma.h @@ -18,6 +18,7 @@ #define _GMA_H_ #include +#include /* IGD PCI Configuration register */ #define ASLS 0xfc /* OpRegion Base */ @@ -35,7 +36,7 @@ typedef struct { u8 driver_version[16]; u32 mailboxes; u8 reserved[164]; -} __attribute__((packed)) opregion_header_t; +} __packed opregion_header_t; #define IGD_OPREGION_SIGNATURE "IntelGraphicsMem" #define IGD_OPREGION_VERSION 2 @@ -72,7 +73,7 @@ typedef struct { u32 cnot; u32 nrdy; u8 reserved2[60]; -} __attribute__((packed)) opregion_mailbox1_t; +} __packed opregion_mailbox1_t; /* mailbox 2: software sci interface */ typedef struct { @@ -80,7 +81,7 @@ typedef struct { u32 parm; u32 dslp; u8 reserved[244]; -} __attribute__((packed)) opregion_mailbox2_t; +} __packed opregion_mailbox2_t; /* mailbox 3: power conservation */ typedef struct { @@ -99,7 +100,7 @@ typedef struct { u32 ccdv; u32 pcft; u8 reserved[94]; -} __attribute__((packed)) opregion_mailbox3_t; +} __packed opregion_mailbox3_t; #define IGD_BACKLIGHT_BRIGHTNESS 0xff #define IGD_INITIAL_BRIGHTNESS 0x64 @@ -111,7 +112,7 @@ typedef struct { /* mailbox 4: vbt */ typedef struct { u8 gvd1[7168]; -} __attribute__((packed)) opregion_vbt_t; +} __packed opregion_vbt_t; /* IGD OpRegion */ typedef struct { @@ -120,7 +121,7 @@ typedef struct { opregion_mailbox2_t mailbox2; opregion_mailbox3_t mailbox3; opregion_vbt_t vbt; -} __attribute__((packed)) igd_opregion_t; +} __packed igd_opregion_t; /* Intel Video BIOS (Option ROM) */ typedef struct { @@ -129,7 +130,7 @@ typedef struct { u8 reserved[21]; u16 pcir_offset; u16 vbt_offset; -} __attribute__((packed)) optionrom_header_t; +} __packed optionrom_header_t; #define OPROM_SIGNATURE 0xaa55 @@ -146,7 +147,7 @@ typedef struct { u8 codetype; u8 indicator; u16 reserved2; -} __attribute__((packed)) optionrom_pcir_t; +} __packed optionrom_pcir_t; typedef struct { u8 hdr_signature[20]; @@ -170,7 +171,7 @@ typedef struct { u8 coreblock_integratedhw; u8 coreblock_biosbuild[4]; u8 coreblock_biossignon[155]; -} __attribute__((packed)) optionrom_vbt_t; +} __packed optionrom_vbt_t; #define VBT_SIGNATURE 0x54425624 diff --git a/src/drivers/intel/fsp2_0/graphics.c b/src/drivers/intel/fsp2_0/graphics.c index cfd3d16428..3207e1d5b5 100644 --- a/src/drivers/intel/fsp2_0/graphics.c +++ b/src/drivers/intel/fsp2_0/graphics.c @@ -10,6 +10,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -37,7 +38,7 @@ struct hob_graphics_info { uint32_t blue_mask; uint32_t reserved_mask; uint32_t pixels_per_scanline; -} __attribute__((packed)); +} __packed; struct pixel { uint8_t pos; diff --git a/src/drivers/intel/fsp2_0/hob_display.c b/src/drivers/intel/fsp2_0/hob_display.c index 7257aec7c5..67e79b48b1 100644 --- a/src/drivers/intel/fsp2_0/hob_display.c +++ b/src/drivers/intel/fsp2_0/hob_display.c @@ -9,13 +9,14 @@ * (at your option) any later version. */ +#include #include #include struct hob_type_name { uint16_t type; const char *name; -} __attribute__((packed)); +} __packed; static const struct hob_type_name hob_type_names[] = { { HOB_TYPE_HANDOFF, "HOB_TYPE_HANDOFF" }, diff --git a/src/drivers/intel/fsp2_0/include/fsp/upd.h b/src/drivers/intel/fsp2_0/include/fsp/upd.h index 651170f477..580257bd8e 100644 --- a/src/drivers/intel/fsp2_0/include/fsp/upd.h +++ b/src/drivers/intel/fsp2_0/include/fsp/upd.h @@ -12,6 +12,8 @@ #ifndef _FSP2_0_UPD_H_ #define _FSP2_0_UPD_H_ +#include + struct FSP_UPD_HEADER { /// /// UPD Region Signature. This signature will be @@ -26,7 +28,7 @@ struct FSP_UPD_HEADER { /// uint8_t Revision; uint8_t Reserved[23]; -} __attribute__((packed)); +} __packed; struct FSPM_ARCH_UPD { /// @@ -59,6 +61,6 @@ struct FSPM_ARCH_UPD { /// uint32_t BootMode; uint8_t Reserved1[8]; -} __attribute__((packed)); +} __packed; #endif /* _FSP2_0_UPD_H_ */ diff --git a/src/drivers/intel/fsp2_0/include/fsp/util.h b/src/drivers/intel/fsp2_0/include/fsp/util.h index 86e637cec2..402d48b273 100644 --- a/src/drivers/intel/fsp2_0/include/fsp/util.h +++ b/src/drivers/intel/fsp2_0/include/fsp/util.h @@ -13,6 +13,7 @@ #ifndef _FSP2_0_UTIL_H_ #define _FSP2_0_UTIL_H_ +#include #include #include #include @@ -23,7 +24,7 @@ struct hob_header { uint16_t type; uint16_t length; -} __attribute__((packed)); +} __packed; struct fsp_notify_params { enum fsp_notify_phase phase; @@ -35,7 +36,7 @@ struct hob_resource { uint32_t attribute_type; uint64_t addr; uint64_t length; -} __attribute__((packed)); +} __packed; enum resource_type { EFI_RESOURCE_SYSTEM_MEMORY = 0, diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index 424a325958..43888c1bad 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -11,6 +11,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -281,13 +282,13 @@ static enum cb_err fsp_fill_common_arch_params(FSPM_ARCH_UPD *arch_upd, return CB_SUCCESS; } -__attribute__ ((weak)) +__attribute__((weak)) uint8_t fsp_memory_mainboard_version(void) { return 0; } -__attribute__ ((weak)) +__attribute__((weak)) uint8_t fsp_memory_soc_version(void) { return 0; diff --git a/src/drivers/intel/gma/intel_bios.h b/src/drivers/intel/gma/intel_bios.h index 2e1211b9d1..048985d50b 100644 --- a/src/drivers/intel/gma/intel_bios.h +++ b/src/drivers/intel/gma/intel_bios.h @@ -28,6 +28,8 @@ #ifndef _I830_BIOS_H_ #define _I830_BIOS_H_ +#include + struct vbt_header { u8 signature[20]; /**< Always starts with 'VBT$' */ u16 version; /**< decimal */ @@ -37,7 +39,7 @@ struct vbt_header { u8 reserved0; u32 bdb_offset; /**< from beginning of VBT */ u32 aim_offset[4]; /**< from beginning of VBT */ -} __attribute__((packed)); +} __packed; struct bdb_header { u8 signature[16]; /**< Always 'BIOS_DATA_BLOCK' */ @@ -63,7 +65,7 @@ struct vbios_data { u8 rsvd4; /* popup memory size */ u8 resize_pci_bios; u8 rsvd5; /* is crt already on ddc2 */ -} __attribute__((packed)); +} __packed; /* * There are several types of BIOS data blocks (BDBs), each block has @@ -140,7 +142,7 @@ struct bdb_general_features { u8 dp_ssc_enb:1; /* PCH attached eDP supports SSC */ u8 dp_ssc_freq:1; /* SSC freq for PCH attached eDP */ u8 rsvd11:3; /* finish byte */ -} __attribute__((packed)); +} __packed; /* pre-915 */ #define GPIO_PIN_DVI_LVDS 0x03 /* "DVI/LVDS DDC GPIO pins" */ @@ -223,7 +225,7 @@ struct old_child_dev_config { u8 dvo2_wiring; u16 extended_type; u8 dvo_function; -} __attribute__((packed)); +} __packed; /* This one contains field offsets that are known to be common for all BDB * versions. Notice that the meaning of the contents contents may still change, @@ -236,7 +238,7 @@ struct common_child_dev_config { u8 not_common2[2]; u8 ddc_pin; u16 edid_ptr; -} __attribute__((packed)); +} __packed; /* This field changes depending on the BDB version, so the most reliable way to * read it is by checking the BDB version and reading the raw pointer. */ @@ -277,7 +279,7 @@ struct bdb_general_definitions { * sizeof(child_device_config); */ union child_device_config devices[0]; -} __attribute__((packed)); +} __packed; struct bdb_lvds_options { u8 panel_type; @@ -291,7 +293,7 @@ struct bdb_lvds_options { u8 lvds_edid:1; u8 rsvd2:1; u8 rsvd4; -} __attribute__((packed)); +} __packed; /* LFP pointer table contains entries to the struct below */ struct bdb_lvds_lfp_data_ptr { @@ -301,12 +303,12 @@ struct bdb_lvds_lfp_data_ptr { u8 dvo_table_size; u16 panel_pnp_id_offset; u8 pnp_table_size; -} __attribute__((packed)); +} __packed; struct bdb_lvds_lfp_data_ptrs { u8 lvds_entries; /* followed by one or more lvds_data_ptr structs */ struct bdb_lvds_lfp_data_ptr ptr[16]; -} __attribute__((packed)); +} __packed; /* LFP data has 3 blocks per entry */ struct lvds_fp_timing { @@ -323,7 +325,7 @@ struct lvds_fp_timing { u32 pfit_reg; u32 pfit_reg_val; u16 terminator; -} __attribute__((packed)); +} __packed; struct lvds_dvo_timing { u16 clock; /**< In 10khz */ @@ -351,7 +353,7 @@ struct lvds_dvo_timing { u8 vsync_positive:1; u8 hsync_positive:1; u8 rsvd2:1; -} __attribute__((packed)); +} __packed; struct lvds_pnp_id { u16 mfg_name; @@ -359,17 +361,17 @@ struct lvds_pnp_id { u32 serial; u8 mfg_week; u8 mfg_year; -} __attribute__((packed)); +} __packed; struct bdb_lvds_lfp_data_entry { struct lvds_fp_timing fp_timing; struct lvds_dvo_timing dvo_timing; struct lvds_pnp_id pnp_id; -} __attribute__((packed)); +} __packed; struct bdb_lvds_lfp_data { struct bdb_lvds_lfp_data_entry data[16]; -} __attribute__((packed)); +} __packed; struct aimdb_header { char signature[16]; @@ -377,12 +379,12 @@ struct aimdb_header { u16 aimdb_version; u16 aimdb_header_size; u16 aimdb_size; -} __attribute__((packed)); +} __packed; struct aimdb_block { u8 aimdb_id; u16 aimdb_size; -} __attribute__((packed)); +} __packed; struct vch_panel_data { u16 fp_timing_offset; @@ -393,12 +395,12 @@ struct vch_panel_data { u8 text_fitting_size; u16 graphics_fitting_offset; u8 graphics_fitting_size; -} __attribute__((packed)); +} __packed; struct vch_bdb_22 { struct aimdb_block aimdb_block; struct vch_panel_data panels[16]; -} __attribute__((packed)); +} __packed; struct bdb_sdvo_lvds_options { u8 panel_backlight; @@ -414,7 +416,7 @@ struct bdb_sdvo_lvds_options { u8 panel_misc_bits_2; u8 panel_misc_bits_3; u8 panel_misc_bits_4; -} __attribute__((packed)); +} __packed; #define BDB_DRIVER_FEATURE_NO_LVDS 0 @@ -460,7 +462,7 @@ struct bdb_driver_features { u8 hdmi_termination; u8 custom_vbt_version; -} __attribute__((packed)); +} __packed; #define EDP_18BPP 0 #define EDP_24BPP 1 @@ -485,14 +487,14 @@ struct edp_power_seq { u16 t9; u16 t10; u16 t11_t12; -} __attribute__ ((packed)); +} __packed; struct edp_link_params { u8 rate:4; u8 lanes:4; u8 preemphasis:4; u8 vswing:4; -} __attribute__ ((packed)); +} __packed; struct bdb_edp { struct edp_power_seq power_seqs[16]; @@ -503,7 +505,7 @@ struct bdb_edp { /* ith bit indicates enabled/disabled for (i+1)th panel */ u16 edp_s3d_feature; u16 edp_t3_optimization; -} __attribute__ ((packed)); +} __packed; /* * Driver<->VBIOS interaction occurs through scratch bits in @@ -728,7 +730,7 @@ struct bdb_mipi { u32 hl_switch_cnt; u32 lp_byte_clk; u32 clk_lane_switch_cnt; -} __attribute__((packed)); +} __packed; #define VBT_SIGNATURE 0x54425624 diff --git a/src/drivers/intel/gma/opregion.h b/src/drivers/intel/gma/opregion.h index 7c7107a8e7..10c1691774 100644 --- a/src/drivers/intel/gma/opregion.h +++ b/src/drivers/intel/gma/opregion.h @@ -19,6 +19,7 @@ #define _COMMON_GMA_H_ #include +#include #include /* IGD PCI Configuration register */ @@ -40,7 +41,7 @@ typedef struct { u32 pcon; /* Offset 96 Platform Capabilities */ u16 dver[16]; /* Offset 100 GOP Version */ u8 reserved[124]; /* Offset 132 Reserved */ -} __attribute__((packed)) opregion_header_t; +} __packed opregion_header_t; #define IGD_OPREGION_SIGNATURE "IntelGraphicsMem" #define IGD_OPREGION_VERSION 2 @@ -121,7 +122,7 @@ typedef struct { u32 cp14; /* Offset 244 Extended Currently present device 6 */ u32 cp15; /* Offset 248 Extended Currently present device 7 */ u8 reserved2[4]; /* Offset 252 Reserved 4 bytes */ -} __attribute__((packed)) opregion_mailbox1_t; +} __packed opregion_mailbox1_t; /* mailbox 2: software sci interface */ typedef struct { @@ -129,7 +130,7 @@ typedef struct { u32 parm; /* Offset 4 Software SCI function number parameters */ u32 dslp; /* Offset 8 Driver sleep timeout */ u8 reserved[244]; /* Offset 12 Reserved */ -} __attribute__((packed)) opregion_mailbox2_t; +} __packed opregion_mailbox2_t; /* mailbox 3: power conservation */ typedef struct { @@ -163,7 +164,7 @@ typedef struct { * Size of Raw VBT data */ u8 reserved[58]; /* Offset 198 Reserved */ -} __attribute__((packed)) opregion_mailbox3_t; +} __packed opregion_mailbox3_t; #define IGD_BACKLIGHT_BRIGHTNESS 0xff #define IGD_INITIAL_BRIGHTNESS 0x64 @@ -175,14 +176,14 @@ typedef struct { /* mailbox 4: vbt */ typedef struct { u8 gvd1[6*KiB]; -} __attribute__((packed)) opregion_vbt_t; +} __packed opregion_vbt_t; /* Mailbox 5: BIOS to Driver Notification Extension */ typedef struct { u32 phed; /* Offset 7168 Panel Header */ u8 bddc[256]; /* Offset 7172 Panel EDID */ u8 reserved[764]; /* Offset 7428 764 bytes */ -} __attribute__((packed)) opregion_mailbox5_t; +} __packed opregion_mailbox5_t; /* IGD OpRegion */ typedef struct { @@ -193,7 +194,7 @@ typedef struct { opregion_vbt_t vbt; opregion_mailbox5_t mailbox5; -} __attribute__((packed)) igd_opregion_t; +} __packed igd_opregion_t; /* Intel Video BIOS (Option ROM) */ typedef struct { @@ -202,7 +203,7 @@ typedef struct { u8 reserved[21]; u16 pcir_offset; u16 vbt_offset; -} __attribute__((packed)) optionrom_header_t; +} __packed optionrom_header_t; #define OPROM_SIGNATURE 0xaa55 @@ -219,7 +220,7 @@ typedef struct { u8 codetype; u8 indicator; u16 reserved2; -} __attribute__((packed)) optionrom_pcir_t; +} __packed optionrom_pcir_t; typedef struct { u8 hdr_signature[20]; @@ -243,7 +244,7 @@ typedef struct { u8 coreblock_integratedhw; u8 coreblock_biosbuild[4]; u8 coreblock_biossignon[155]; -} __attribute__((packed)) optionrom_vbt_t; +} __packed optionrom_vbt_t; void intel_gma_opregion_register(uintptr_t opregion); void intel_gma_restore_opregion(void); diff --git a/src/drivers/intel/mipi_camera/chip.h b/src/drivers/intel/mipi_camera/chip.h index d4b8c02818..a66b8ac212 100644 --- a/src/drivers/intel/mipi_camera/chip.h +++ b/src/drivers/intel/mipi_camera/chip.h @@ -17,6 +17,7 @@ #define __INTEL_MIPI_CAMERA_CHIP_H__ #include +#include #define MAX_PWDB_ENTRIES 12 @@ -83,7 +84,7 @@ struct intel_ssdb { uint8_t mipi_data_format; /* MIPI data format */ uint8_t silicon_version; /* Silicon version */ uint8_t customer_id; /* Customer ID */ -} __attribute__((packed)); +} __packed; struct intel_pwdb { char name[32]; /* Name of the resource required by the power @@ -92,7 +93,7 @@ struct intel_pwdb { uint32_t entry_type; /* The type of the current power action */ uint32_t delay_usec; /* The delay time after which power action is performed and this is in unit of usec */ -} __attribute__((packed)); +} __packed; struct drivers_intel_mipi_camera_config { struct intel_ssdb ssdb; diff --git a/src/drivers/intel/wifi/wifi.c b/src/drivers/intel/wifi/wifi.c index a71f014ced..91c21fecff 100644 --- a/src/drivers/intel/wifi/wifi.c +++ b/src/drivers/intel/wifi/wifi.c @@ -14,6 +14,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -36,7 +37,7 @@ static int smbios_write_wifi(struct device *dev, int *handle, u16 handle; u8 str; char eos[2]; - } __attribute__((packed)); + } __packed; struct smbios_type_intel_wifi *t = (struct smbios_type_intel_wifi *)*current; -- cgit v1.2.3