misc: Replace M5_ATTR_PACKED with GEM5_PACKED.

Change-Id: Ie59071ca1fc81a76267a54ddd2d35dfc4477995d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45234
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
Gabe Black
2021-05-08 20:35:12 -07:00
parent 11fe13c311
commit ce6b5e7e33
15 changed files with 42 additions and 40 deletions

View File

@@ -66,7 +66,7 @@ class RemoteGDB : public BaseRemoteGDB
{
using BaseGdbRegCache::BaseGdbRegCache;
private:
struct M5_ATTR_PACKED
struct GEM5_PACKED
{
uint32_t gpr[16];
uint32_t cpsr;
@@ -89,7 +89,7 @@ class RemoteGDB : public BaseRemoteGDB
{
using BaseGdbRegCache::BaseGdbRegCache;
private:
struct M5_ATTR_PACKED
struct GEM5_PACKED
{
uint64_t x[31];
uint64_t spx;

View File

@@ -95,7 +95,7 @@ class RSDP : public SimObject
static const char signature[];
struct M5_ATTR_PACKED MemR0
struct GEM5_PACKED MemR0
{
// src: https://wiki.osdev.org/RSDP
char signature[8] = {};
@@ -107,7 +107,7 @@ class RSDP : public SimObject
static_assert(std::is_trivially_copyable<MemR0>::value,
"Type not suitable for memcpy.");
struct M5_ATTR_PACKED Mem : public MemR0
struct GEM5_PACKED Mem : public MemR0
{
// since version 2
uint32_t length = 0;
@@ -132,7 +132,7 @@ class SysDescTable : public SimObject
protected:
PARAMS(X86ACPISysDescTable);
struct M5_ATTR_PACKED Mem
struct GEM5_PACKED Mem
{
// src: https://wiki.osdev.org/RSDT
char signature[4] = {};
@@ -207,7 +207,7 @@ class Record : public SimObject
protected:
PARAMS(X86ACPIMadtRecord);
struct M5_ATTR_PACKED Mem
struct GEM5_PACKED Mem
{
uint8_t type = 0;
uint8_t length = 0;
@@ -236,7 +236,7 @@ class LAPIC : public Record
protected:
PARAMS(X86ACPIMadtLAPIC);
struct M5_ATTR_PACKED Mem : public Record::Mem
struct GEM5_PACKED Mem : public Record::Mem
{
uint8_t acpiProcessorId = 0;
uint8_t apicId = 0;
@@ -256,7 +256,7 @@ class IOAPIC : public Record
protected:
PARAMS(X86ACPIMadtIOAPIC);
struct M5_ATTR_PACKED Mem : public Record::Mem
struct GEM5_PACKED Mem : public Record::Mem
{
uint8_t ioApicId = 0;
uint8_t _reserved = 0;
@@ -277,7 +277,7 @@ class IntSourceOverride : public Record
protected:
PARAMS(X86ACPIMadtIntSourceOverride);
struct M5_ATTR_PACKED Mem : public Record::Mem
struct GEM5_PACKED Mem : public Record::Mem
{
uint8_t busSource = 0;
uint8_t irqSource = 0;
@@ -298,7 +298,7 @@ class NMI : public Record
protected:
PARAMS(X86ACPIMadtNMI);
struct M5_ATTR_PACKED Mem : public Record::Mem
struct GEM5_PACKED Mem : public Record::Mem
{
uint8_t acpiProcessorId = 0;
uint16_t flags = 0;
@@ -318,7 +318,7 @@ class LAPICOverride : public Record
protected:
PARAMS(X86ACPIMadtLAPICOverride);
struct M5_ATTR_PACKED Mem : public Record::Mem
struct GEM5_PACKED Mem : public Record::Mem
{
uint16_t _reserved = 0;
uint64_t localAPICAddress = 0;
@@ -337,7 +337,7 @@ class MADT : public SysDescTable
protected:
PARAMS(X86ACPIMadt);
struct M5_ATTR_PACKED Mem : public SysDescTable::Mem
struct GEM5_PACKED Mem : public SysDescTable::Mem
{
uint32_t localAPICAddress = 0;
uint32_t flags = 0;

View File

@@ -247,7 +247,7 @@ class X86Linux64 : public X86Linux
class X86Linux32 : public X86Linux
{
public:
typedef struct M5_ATTR_PACKED
typedef struct GEM5_PACKED
{
uint64_t st_dev;
uint8_t __pad0[4];

View File

@@ -94,7 +94,7 @@ class RemoteGDB : public BaseRemoteGDB
{
using BaseGdbRegCache::BaseGdbRegCache;
private:
struct M5_ATTR_PACKED
struct GEM5_PACKED
{
uint64_t rax;
uint64_t rbx;

View File

@@ -75,7 +75,7 @@ class BmpWriter : public ImgWriter
void write(std::ostream &bmp) const override;
private:
struct M5_ATTR_PACKED FileHeader
struct GEM5_PACKED FileHeader
{
unsigned char magic_number[2];
uint32_t size;
@@ -84,7 +84,9 @@ class BmpWriter : public ImgWriter
uint32_t offset;
};
struct M5_ATTR_PACKED InfoHeaderV1 { /* Aka DIB header */
struct GEM5_PACKED InfoHeaderV1
{
/* Aka DIB header */
uint32_t Size;
uint32_t Width;
uint32_t Height;
@@ -98,13 +100,13 @@ class BmpWriter : public ImgWriter
uint32_t ClrImportant;
};
struct M5_ATTR_PACKED CompleteV1Header
struct GEM5_PACKED CompleteV1Header
{
FileHeader file;
InfoHeaderV1 info;
};
struct M5_ATTR_PACKED BmpPixel32
struct GEM5_PACKED BmpPixel32
{
BmpPixel32 &operator=(const Pixel &rhs) {
red = rhs.red;

View File

@@ -565,14 +565,14 @@ struct ip6_opt_routing_type2
};
#define HOME_ADDRESS_OPTION 0xC9
struct M5_ATTR_PACKED ip6_opt_dstopts
struct GEM5_PACKED ip6_opt_dstopts
{
uint8_t type;
uint8_t length;
ip6_addr_t addr;
};
struct M5_ATTR_PACKED ip6_opt_hdr
struct GEM5_PACKED ip6_opt_hdr
{
uint8_t ext_nxt;
uint8_t ext_len;

View File

@@ -76,7 +76,7 @@ class PngWriter : public ImgWriter
void write(std::ostream &png) const override;
private:
/** Png Pixel type: not containing padding */
struct M5_ATTR_PACKED PngPixel24
struct GEM5_PACKED PngPixel24
{
PngPixel24 &operator=(const Pixel &rhs) {
red = rhs.red;

View File

@@ -97,7 +97,7 @@ class VncInput : public SimObject
ClientCutText = 6
};
struct M5_ATTR_PACKED PixelFormat
struct GEM5_PACKED PixelFormat
{
uint8_t bpp;
uint8_t depth;
@@ -112,21 +112,21 @@ class VncInput : public SimObject
uint8_t padding[3];
};
struct M5_ATTR_PACKED PixelFormatMessage
struct GEM5_PACKED PixelFormatMessage
{
uint8_t type;
uint8_t padding[3];
PixelFormat px;
};
struct M5_ATTR_PACKED PixelEncodingsMessage
struct GEM5_PACKED PixelEncodingsMessage
{
uint8_t type;
uint8_t padding;
uint16_t num_encodings;
};
struct M5_ATTR_PACKED FrameBufferUpdateReq
struct GEM5_PACKED FrameBufferUpdateReq
{
uint8_t type;
uint8_t incremental;
@@ -136,7 +136,7 @@ class VncInput : public SimObject
uint16_t height;
};
struct M5_ATTR_PACKED KeyEventMessage
struct GEM5_PACKED KeyEventMessage
{
uint8_t type;
uint8_t down_flag;
@@ -144,7 +144,7 @@ class VncInput : public SimObject
uint32_t key;
};
struct M5_ATTR_PACKED PointerEventMessage
struct GEM5_PACKED PointerEventMessage
{
uint8_t type;
uint8_t button_mask;
@@ -152,7 +152,7 @@ class VncInput : public SimObject
uint16_t y;
};
struct M5_ATTR_PACKED ClientCutTextMessage
struct GEM5_PACKED ClientCutTextMessage
{
uint8_t type;
uint8_t padding[3];

View File

@@ -110,7 +110,7 @@ class VncServer : public VncInput
NormalPhase
};
struct M5_ATTR_PACKED ServerInitMsg
struct GEM5_PACKED ServerInitMsg
{
uint16_t fbWidth;
uint16_t fbHeight;
@@ -119,14 +119,14 @@ class VncServer : public VncInput
char name[2]; // just to put M5 in here
};
struct M5_ATTR_PACKED FrameBufferUpdate
struct GEM5_PACKED FrameBufferUpdate
{
uint8_t type;
uint8_t padding;
uint16_t num_rects;
};
struct M5_ATTR_PACKED FrameBufferRect
struct GEM5_PACKED FrameBufferRect
{
uint16_t x;
uint16_t y;
@@ -135,7 +135,7 @@ class VncServer : public VncInput
int32_t encoding;
};
struct M5_ATTR_PACKED ServerCutText
struct GEM5_PACKED ServerCutText
{
uint8_t type;
uint8_t padding[3];

View File

@@ -67,7 +67,7 @@ using namespace X86ISA;
// data) is used to indicate that a segment has been accessed.
#define SEG_TYPE_BIT_ACCESSED 1
struct M5_ATTR_PACKED FXSave
struct GEM5_PACKED FXSave
{
uint16_t fcw;
uint16_t fsw;

View File

@@ -466,7 +466,7 @@ class VirtQueue : public Serializable
typedef uint16_t Flags;
typedef uint16_t Index;
struct M5_ATTR_PACKED Header
struct GEM5_PACKED Header
{
Flags flags;
Index index;

View File

@@ -81,7 +81,7 @@ class VirtIOBlock : public VirtIODeviceBase
* @note This needs to be changed if the supported feature set
* changes!
*/
struct M5_ATTR_PACKED Config
struct GEM5_PACKED Config
{
uint64_t capacity;
};
@@ -123,7 +123,7 @@ class VirtIOBlock : public VirtIODeviceBase
/** @} */
/** VirtIO block device request as sent by guest */
struct M5_ATTR_PACKED BlkRequest
struct GEM5_PACKED BlkRequest
{
RequestType type;
uint32_t reserved;

View File

@@ -77,7 +77,7 @@ class VirtIOConsole : public VirtIODeviceBase
* @note This needs to be changed if the multiport feature is
* announced!
*/
struct M5_ATTR_PACKED Config
struct GEM5_PACKED Config
{
uint16_t cols;
uint16_t rows;

View File

@@ -50,7 +50,7 @@ struct VirtIO9PBaseParams;
typedef uint8_t P9MsgType;
typedef uint16_t P9Tag;
struct M5_ATTR_PACKED P9MsgHeader
struct GEM5_PACKED P9MsgHeader
{
/** Length including header */
uint32_t len;
@@ -121,7 +121,7 @@ class VirtIO9PBase : public VirtIODeviceBase
* @note The fields in this structure depend on the features
* exposed to the guest.
*/
struct M5_ATTR_PACKED Config
struct GEM5_PACKED Config
{
uint16_t len;
char tag[];

View File

@@ -43,7 +43,7 @@
#include "sim/byteswap.hh"
#include "sim/system.hh"
struct M5_ATTR_PACKED DmesgEntry
struct GEM5_PACKED DmesgEntry
{
uint64_t ts_nsec;
uint16_t len;