Use new macro QEMU_PACKED for packed structures

Most changes were made using these commands:

git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/'
git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/'

Whitespace in linux-user/syscall_defs.h was fixed manually
to avoid warnings from scripts/checkpatch.pl.

Manual changes were also applied to hw/pc.c.

I did not fix indentation with tabs in block/vvfat.c.
The patch will show 4 errors with scripts/checkpatch.pl.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Stefan Weil
2011-09-03 10:45:59 +00:00
committed by Blue Swirl
parent 0f7fdd3475
commit 541dc0d47f
36 changed files with 259 additions and 259 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ struct external_lineno {
#define E_FILNMLEN 14 /* # characters in a file name */
#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
struct __attribute__((packed)) external_syment
struct QEMU_PACKED external_syment
{
union {
char e_name[E_SYMNMLEN];
+1 -1
View File
@@ -1327,7 +1327,7 @@ struct partition {
uint8_t end_cyl; /* end cylinder */
uint32_t start_sect; /* starting sector counting from 0 */
uint32_t nr_sects; /* nr of sectors in partition */
} __attribute__((packed));
} QEMU_PACKED;
/* try to guess the disk logical geometry from the MSDOS partition table. Return 0 if OK, -1 if could not guess */
static int guess_disk_lchs(BlockDriverState *bs,
+1 -1
View File
@@ -43,7 +43,7 @@ struct parallels_header {
uint32_t catalog_entries;
uint32_t nb_sectors;
char padding[24];
} __attribute__((packed));
} QEMU_PACKED;
typedef struct BDRVParallelsState {
+1 -1
View File
@@ -26,7 +26,7 @@
#include "block_int.h"
#include "block/qcow2.h"
typedef struct __attribute__((packed)) QCowSnapshotHeader {
typedef struct QEMU_PACKED QCowSnapshotHeader {
/* header is 8 byte aligned */
uint64_t l1_table_offset;
+1 -1
View File
@@ -56,7 +56,7 @@ typedef struct {
int64_t grain_offset;
char filler[1];
char check_bytes[4];
} __attribute__((packed)) VMDK4Header;
} QEMU_PACKED VMDK4Header;
#define L2_CACHE_SIZE 16
+7 -7
View File
@@ -200,7 +200,7 @@ static int array_index(array_t* array, void* pointer)
}
/* These structures are used to fake a disk and the VFAT filesystem.
* For this reason we need to use __attribute__((packed)). */
* For this reason we need to use QEMU_PACKED. */
typedef struct bootsector_t {
uint8_t jump[3];
@@ -224,7 +224,7 @@ typedef struct bootsector_t {
uint8_t signature;
uint32_t id;
uint8_t volume_label[11];
} __attribute__((packed)) fat16;
} QEMU_PACKED fat16;
struct {
uint32_t sectors_per_fat;
uint16_t flags;
@@ -233,12 +233,12 @@ typedef struct bootsector_t {
uint16_t info_sector;
uint16_t backup_boot_sector;
uint16_t ignored;
} __attribute__((packed)) fat32;
} QEMU_PACKED fat32;
} u;
uint8_t fat_type[8];
uint8_t ignored[0x1c0];
uint8_t magic[2];
} __attribute__((packed)) bootsector_t;
} QEMU_PACKED bootsector_t;
typedef struct {
uint8_t head;
@@ -253,7 +253,7 @@ typedef struct partition_t {
mbr_chs_t end_CHS;
uint32_t start_sector_long;
uint32_t length_sector_long;
} __attribute__((packed)) partition_t;
} QEMU_PACKED partition_t;
typedef struct mbr_t {
uint8_t ignored[0x1b8];
@@ -261,7 +261,7 @@ typedef struct mbr_t {
uint8_t ignored2[2];
partition_t partition[4];
uint8_t magic[2];
} __attribute__((packed)) mbr_t;
} QEMU_PACKED mbr_t;
typedef struct direntry_t {
uint8_t name[8];
@@ -276,7 +276,7 @@ typedef struct direntry_t {
uint16_t mdate;
uint16_t begin;
uint32_t size;
} __attribute__((packed)) direntry_t;
} QEMU_PACKED direntry_t;
/* this structure are used to transparently access the files */
+1 -1
View File
@@ -314,7 +314,7 @@ struct virtio_9p_config
uint16_t tag_len;
/* Variable size tag name */
uint8_t tag[0];
} __attribute__((packed));
} QEMU_PACKED;
typedef struct V9fsMkState {
V9fsPDU *pdu;
+1 -1
View File
@@ -32,7 +32,7 @@ struct acpi_table_header {
uint32_t oem_revision; /* OEM revision number */
char asl_compiler_id[4]; /* ASL compiler vendor ID */
uint32_t asl_compiler_revision; /* ASL compiler revision number */
} __attribute__((packed));
} QEMU_PACKED;
#define ACPI_TABLE_HDR_SIZE sizeof(struct acpi_table_header)
#define ACPI_TABLE_PFX_SIZE sizeof(uint16_t) /* size of the extra prefix */
+166 -166
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -59,13 +59,13 @@ struct hpet_fw_entry
uint64_t address;
uint16_t min_tick;
uint8_t page_prot;
} __attribute__ ((packed));
} QEMU_PACKED;
struct hpet_fw_config
{
uint8_t count;
struct hpet_fw_entry hpet[8];
} __attribute__ ((packed));
} QEMU_PACKED;
extern struct hpet_fw_config hpet_cfg;
#endif
+3 -3
View File
@@ -244,13 +244,13 @@ typedef struct AHCICmdHdr {
uint32_t status;
uint64_t tbl_addr;
uint32_t reserved[4];
} __attribute__ ((packed)) AHCICmdHdr;
} QEMU_PACKED AHCICmdHdr;
typedef struct AHCI_SG {
uint64_t addr;
uint32_t reserved;
uint32_t flags_size;
} __attribute__ ((packed)) AHCI_SG;
} QEMU_PACKED AHCI_SG;
typedef struct AHCIDevice AHCIDevice;
@@ -321,7 +321,7 @@ typedef struct NCQFrame {
uint8_t reserved8;
uint8_t reserved9;
uint8_t reserved10;
} __attribute__ ((packed)) NCQFrame;
} QEMU_PACKED NCQFrame;
void ahci_init(AHCIState *s, DeviceState *qdev, int ports);
void ahci_uninit(AHCIState *s);
+2 -2
View File
@@ -557,13 +557,13 @@ static void cmd_get_event_status_notification(IDEState *s,
uint8_t reserved3[2];
uint16_t len;
uint8_t control;
} __attribute__((packed)) *gesn_cdb;
} QEMU_PACKED *gesn_cdb;
struct {
uint16_t len;
uint8_t notification_class;
uint8_t supported_events;
} __attribute((packed)) *gesn_event_header;
} QEMU_PACKED *gesn_event_header;
enum notification_class_request_type {
NCR_RESERVED1 = 1 << 0,
+1 -1
View File
@@ -73,7 +73,7 @@ enum {
struct vertex {
int x;
int y;
} __attribute__((packed));
} QEMU_PACKED;
struct MilkymistTMU2State {
SysBusDevice busdev;
+2 -2
View File
@@ -78,12 +78,12 @@ struct e820_entry {
uint64_t address;
uint64_t length;
uint32_t type;
} __attribute((__packed__, __aligned__(4)));
} QEMU_PACKED __attribute((__aligned__(4)));
struct e820_table {
uint32_t count;
struct e820_entry entry[E820_NR_ENTRIES];
} __attribute((__packed__, __aligned__(4)));
} QEMU_PACKED __attribute((__aligned__(4)));
static struct e820_table e820_table;
struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
+1 -1
View File
@@ -70,7 +70,7 @@ struct PXA2xxLCDState {
int orientation;
};
typedef struct __attribute__ ((__packed__)) {
typedef struct QEMU_PACKED {
uint32_t fdaddr;
uint32_t fsaddr;
uint32_t fidr;
+1 -1
View File
@@ -209,7 +209,7 @@ static void main_cpu_reset(void *opaque)
env->pc = s->vector;
}
static struct __attribute__((__packed__))
static struct QEMU_PACKED
{
int mount_root_rdonly;
int ramdisk_flags;
+1 -1
View File
@@ -50,7 +50,7 @@ do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } whi
typedef struct dma_pagetable_entry {
int32_t frame;
int32_t owner;
} __attribute__((packed)) dma_pagetable_entry;
} QEMU_PACKED dma_pagetable_entry;
#define DMA_PAGESIZE 4096
#define DMA_REG_ENABLE 1
+3 -3
View File
@@ -21,19 +21,19 @@
struct smbios_header {
uint16_t length;
uint8_t type;
} __attribute__((__packed__));
} QEMU_PACKED;
struct smbios_field {
struct smbios_header header;
uint8_t type;
uint16_t offset;
uint8_t data[];
} __attribute__((__packed__));
} QEMU_PACKED;
struct smbios_table {
struct smbios_header header;
uint8_t data[];
} __attribute__((__packed__));
} QEMU_PACKED;
#define SMBIOS_FIELD_ENTRY 0
#define SMBIOS_TABLE_ENTRY 1
+11 -11
View File
@@ -26,7 +26,7 @@ struct smbios_structure_header {
uint8_t type;
uint8_t length;
uint16_t handle;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 0 - BIOS Information */
struct smbios_type_0 {
@@ -42,7 +42,7 @@ struct smbios_type_0 {
uint8_t system_bios_minor_release;
uint8_t embedded_controller_major_release;
uint8_t embedded_controller_minor_release;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 1 - System Information */
struct smbios_type_1 {
@@ -55,7 +55,7 @@ struct smbios_type_1 {
uint8_t wake_up_type;
uint8_t sku_number_str;
uint8_t family_str;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 3 - System Enclosure (v2.3) */
struct smbios_type_3 {
@@ -74,7 +74,7 @@ struct smbios_type_3 {
uint8_t number_of_power_cords;
uint8_t contained_element_count;
// contained elements follow
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 4 - Processor Information (v2.0) */
struct smbios_type_4 {
@@ -94,7 +94,7 @@ struct smbios_type_4 {
uint16_t l1_cache_handle;
uint16_t l2_cache_handle;
uint16_t l3_cache_handle;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 16 - Physical Memory Array
* Associated with one type 17 (Memory Device).
@@ -107,7 +107,7 @@ struct smbios_type_16 {
uint32_t maximum_capacity;
uint16_t memory_error_information_handle;
uint16_t number_of_memory_devices;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 17 - Memory Device
* Associated with one type 19
*/
@@ -124,7 +124,7 @@ struct smbios_type_17 {
uint8_t bank_locator_str;
uint8_t memory_type;
uint16_t type_detail;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 19 - Memory Array Mapped Address */
struct smbios_type_19 {
@@ -133,7 +133,7 @@ struct smbios_type_19 {
uint32_t ending_address;
uint16_t memory_array_handle;
uint8_t partition_width;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 20 - Memory Device Mapped Address */
struct smbios_type_20 {
@@ -145,18 +145,18 @@ struct smbios_type_20 {
uint8_t partition_row_position;
uint8_t interleave_position;
uint8_t interleaved_data_depth;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 32 - System Boot Information */
struct smbios_type_32 {
struct smbios_structure_header header;
uint8_t reserved[6];
uint8_t boot_status;
} __attribute__((__packed__));
} QEMU_PACKED;
/* SMBIOS type 127 -- End-of-table */
struct smbios_type_127 {
struct smbios_structure_header header;
} __attribute__((__packed__));
} QEMU_PACKED;
#endif /*QEMU_SMBIOS_H */
+5 -5
View File
@@ -106,7 +106,7 @@ struct srp_indirect_buf {
struct srp_direct_buf table_desc;
uint32_t len;
struct srp_direct_buf desc_list[0];
} __attribute__((packed));
} QEMU_PACKED;
enum {
SRP_MULTICHAN_SINGLE = 0,
@@ -141,7 +141,7 @@ struct srp_login_rsp {
uint16_t buf_fmt;
uint8_t rsp_flags;
uint8_t reserved2[25];
} __attribute__((packed));
} QEMU_PACKED;
struct srp_login_rej {
uint8_t opcode;
@@ -177,7 +177,7 @@ struct srp_tsk_mgmt {
uint8_t reserved1[6];
uint64_t tag;
uint8_t reserved2[4];
uint64_t lun __attribute__((packed));
uint64_t lun QEMU_PACKED;
uint8_t reserved3[2];
uint8_t tsk_mgmt_func;
uint8_t reserved4;
@@ -198,7 +198,7 @@ struct srp_cmd {
uint8_t data_in_desc_cnt;
uint64_t tag;
uint8_t reserved2[4];
uint64_t lun __attribute__((packed));
uint64_t lun QEMU_PACKED;
uint8_t reserved3;
uint8_t task_attr;
uint8_t reserved4;
@@ -235,6 +235,6 @@ struct srp_rsp {
uint32_t sense_data_len;
uint32_t resp_data_len;
uint8_t data[0];
} __attribute__((packed));
} QEMU_PACKED;
#endif /* SCSI_SRP_H */

Some files were not shown because too many files have changed in this diff Show More