Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/46199 )
Change subject: misc: Remove typedef (struct|enum) Foo in cpp files.
......................................................................
misc: Remove typedef (struct|enum) Foo in cpp files.
In C, to refer to a type without a struct or enum tag on the type, you
need to typedef it like this:
typedef struct
{
} Foo;
Foo foo;
In C++, this is unnecessary:
struct Foo
{
};
Foo foo;
Remove all of the first form in C++ files and replace them with the
second form.
Change-Id: I37cc0d63b2777466dc6cc51eb5a3201de2e2cf43
---
M src/arch/arm/freebsd/freebsd.hh
M src/arch/arm/linux/linux.hh
M src/arch/mips/linux/linux.hh
M src/arch/power/linux/linux.hh
M src/arch/riscv/linux/linux.hh
M src/arch/riscv/pmp.hh
M src/arch/sparc/linux/linux.hh
M src/arch/x86/linux/linux.hh
M src/dev/arm/gic_v3.hh
M src/dev/arm/gic_v3_cpu_interface.hh
M src/dev/hsa/hsa_packet.hh
M src/dev/hsa/hsa_packet_processor.hh
M src/dev/hsa/hsa_queue.hh
M src/dev/storage/ide_disk.hh
M src/kern/linux/linux.hh
M src/kern/operatingsystem.hh
M src/kern/solaris/solaris.hh
M src/mem/cache/compressors/base_delta.hh
M src/mem/cache/compressors/cpack.hh
M src/mem/cache/compressors/fpc.hh
M src/mem/cache/compressors/fpcd.hh
M src/mem/cache/compressors/repeated_qwords.hh
M src/mem/cache/compressors/zero.hh
23 files changed, 139 insertions(+), 138 deletions(-)
diff --git a/src/arch/arm/freebsd/freebsd.hh
b/src/arch/arm/freebsd/freebsd.hh
index 465b6fa..d3a0275 100644
--- a/src/arch/arm/freebsd/freebsd.hh
+++ b/src/arch/arm/freebsd/freebsd.hh
@@ -123,7 +123,7 @@
* sizeof st_lspare 4
*/
- typedef struct
+ struct tgt_stat
{
uint32_t st_dev;
uint32_t st_ino;
@@ -146,9 +146,9 @@
uint32_t st_lspare;
uint64_t st_birthtimX;
uint64_t st_birthtim;
- } tgt_stat;
+ };
- typedef struct
+ struct tgt_stat64
{
uint32_t st_dev;
uint32_t st_ino;
@@ -171,7 +171,7 @@
uint32_t st_lspare;
uint64_t st_birthtimX;
uint64_t st_birthtim;
- } tgt_stat64;
+ };
/// For getrusage().
struct rusage
@@ -293,7 +293,7 @@
uint64_t iov_len;
};
- typedef struct
+ struct tgt_stat
{
uint32_t st_dev;
uint32_t st_ino;
@@ -316,9 +316,9 @@
uint32_t st_lspare;
uint64_t st_birthtimX;
uint64_t st_birthtim;
- } tgt_stat;
+ };
- typedef struct
+ struct tgt_stat64
{
uint32_t st_dev;
uint32_t st_ino;
@@ -341,7 +341,7 @@
uint32_t st_lspare;
uint64_t st_birthtimX;
uint64_t st_birthtim;
- } tgt_stat64;
+ };
/// For getrusage().
struct rusage
diff --git a/src/arch/arm/linux/linux.hh b/src/arch/arm/linux/linux.hh
index 6947d2d..bdfc3b8 100644
--- a/src/arch/arm/linux/linux.hh
+++ b/src/arch/arm/linux/linux.hh
@@ -190,7 +190,7 @@
};
- typedef struct
+ struct tgt_stat
{
uint32_t st_dev;
uint32_t st_ino;
@@ -210,9 +210,9 @@
uint32_t st_mtime_nsec;
uint32_t st_ctimeX;
uint32_t st_ctime_nsec;
- } tgt_stat;
+ };
- typedef struct
+ struct tgt_stat64
{
uint64_t st_dev;
uint8_t __pad0[4];
@@ -233,9 +233,9 @@
uint32_t st_ctimeX;
uint32_t st_ctime_nsec;
uint64_t st_ino;
- } tgt_stat64;
+ };
- typedef struct
+ struct tgt_sysinfo
{
int32_t uptime; /* Seconds since boot */
uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -249,7 +249,7 @@
uint32_t totalhigh; /* Total high memory size */
uint32_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
- } tgt_sysinfo;
+ };
/// For getrusage().
struct rusage
@@ -454,7 +454,7 @@
uint64_t iov_len;
};
- typedef struct
+ struct tgt_stat
{
uint64_t st_dev;
uint64_t st_ino;
@@ -473,9 +473,9 @@
uint64_t st_mtime_nsec;
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
- } tgt_stat;
+ };
- typedef struct
+ struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -494,9 +494,9 @@
uint64_t st_mtime_nsec;
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
- } tgt_stat64;
+ };
- typedef struct
+ struct tgt_sysinfo
{
int64_t uptime; /* Seconds since boot */
uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -511,7 +511,7 @@
uint64_t totalhigh; /* Total high memory size */
uint64_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
- } tgt_sysinfo;
+ };
/// For getrusage().
struct rusage
diff --git a/src/arch/mips/linux/linux.hh b/src/arch/mips/linux/linux.hh
index 73ccf5e..2dc2d53 100644
--- a/src/arch/mips/linux/linux.hh
+++ b/src/arch/mips/linux/linux.hh
@@ -176,7 +176,7 @@
/// the root users.
static const int NUM_ROOT_PROCS = 2;
- typedef struct
+ struct tgt_sysinfo
{
int32_t uptime; /* Seconds since boot */
uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -190,7 +190,7 @@
uint32_t totalhigh; /* Total high memory size */
uint32_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
- } tgt_sysinfo;
+ };
};
diff --git a/src/arch/power/linux/linux.hh b/src/arch/power/linux/linux.hh
index 5279c67..067b111 100644
--- a/src/arch/power/linux/linux.hh
+++ b/src/arch/power/linux/linux.hh
@@ -46,7 +46,7 @@
typedef int32_t time_t;
- typedef struct
+ struct tgt_stat
{
uint64_t st_dev;
uint32_t __pad1;
@@ -68,9 +68,9 @@
uint32_t st_ctime_nsec;
uint32_t __unused4;
uint32_t __unused5;
- } tgt_stat;
+ };
- typedef struct
+ struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -92,7 +92,7 @@
uint32_t st_ctime_nsec;
uint32_t __unused4;
uint32_t __unused5;
- } tgt_stat64;
+ };
/// For times().
struct tms
diff --git a/src/arch/riscv/linux/linux.hh b/src/arch/riscv/linux/linux.hh
index 801dd8f..681874b 100644
--- a/src/arch/riscv/linux/linux.hh
+++ b/src/arch/riscv/linux/linux.hh
@@ -135,7 +135,7 @@
int64_t tv_nsec;
};
- typedef struct
+ struct tgt_stat64
{
dev_t st_dev;
ino_t st_ino;
@@ -155,14 +155,14 @@
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
int32_t ___glibc_reserved[2];
- } tgt_stat64;
+ };
- typedef struct
+ struct tgt_fsid_t
{
int32_t val[2];
- } tgt_fsid_t;
+ };
- typedef struct
+ struct tgt_statfs
{
uint64_t f_type;
uint64_t f_bsize;
@@ -176,9 +176,9 @@
uint64_t f_frsize;
uint64_t f_flags;
uint64_t f_spare[4];
- } tgt_statfs;
+ };
- typedef struct
+ struct tgt_sysinfo
{
int64_t uptime;
uint64_t loads[3];
@@ -193,7 +193,7 @@
uint64_t totalhigh;
uint64_t freehigh;
uint32_t mem_unit;
- } tgt_sysinfo;
+ };
static void
archClone(uint64_t flags,
@@ -306,12 +306,12 @@
int32_t tv_nsec;
};
- typedef struct
+ struct tgt_fsid_t
{
int32_t val[2];
- } tgt_fsid_t;
+ };
- typedef struct
+ struct tgt_stat
{
uint64_t st_dev;
uint64_t st_ino;
@@ -333,9 +333,9 @@
int32_t st_ctime_nsec;
int32_t __unused4;
int32_t __unused5;
- } tgt_stat;
+ };
- typedef struct
+ struct tgt_statfs
{
uint32_t f_type;
uint32_t f_bsize;
@@ -349,9 +349,9 @@
uint32_t f_frsize;
uint32_t f_flags;
uint32_t f_spare[4];
- } tgt_statfs;
+ };
- typedef struct
+ struct tgt_sysinfo
{
int32_t uptime;
uint32_t loads[3];
@@ -366,7 +366,7 @@
uint32_t totalhigh;
uint32_t freehigh;
uint32_t mem_unit;
- } tgt_sysinfo;
+ };
static void
archClone(uint64_t flags,
diff --git a/src/arch/riscv/pmp.hh b/src/arch/riscv/pmp.hh
index 3051a6a..a70e18d 100644
--- a/src/arch/riscv/pmp.hh
+++ b/src/arch/riscv/pmp.hh
@@ -65,12 +65,13 @@
* PMP_NA4 = naturally aligned four byte region
* PMP_NAPOT = naturally aligned power of two region, >= 8 bytes
*/
- typedef enum {
+ enum pmpAmatch
+ {
PMP_OFF,
PMP_TOR,
PMP_NA4,
PMP_NAPOT
- } pmpAmatch;
+ };
/** pmpcfg address range read permission mask */
const uint8_t PMP_READ = 1 << 0;
diff --git a/src/arch/sparc/linux/linux.hh b/src/arch/sparc/linux/linux.hh
index 184226c..3510d8a 100644
--- a/src/arch/sparc/linux/linux.hh
+++ b/src/arch/sparc/linux/linux.hh
@@ -166,7 +166,7 @@
static const unsigned TGT_MAP_FIXED = 0x00010;
static const unsigned TGT_MAP_INHERIT = 0x00080;
- typedef struct
+ struct tgt_sysinfo
{
int64_t uptime; /* Seconds since boot */
uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -180,7 +180,7 @@
uint64_t totalhigh; /* Total high memory size */
uint64_t freehigh; /* Available high memory size */
uint64_t mem_unit; /* Memory unit size in bytes */
- } tgt_sysinfo;
+ };
//@{
/// ioctl() command codes.
@@ -244,7 +244,7 @@
{
public:
- typedef struct
+ struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -266,9 +266,9 @@
uint64_t st_ctime_nsec;
uint32_t __unused4;
uint32_t __unused5;
- } tgt_stat64;
+ };
- typedef struct
+ struct tgt_sysinfo
{
int32_t uptime; /* Seconds since boot */
uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -282,7 +282,7 @@
uint32_t totalhigh; /* Total high memory size */
uint32_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
- } tgt_sysinfo;
+ };
/// Resource constants for getrlimit() (overide some generics).
static const unsigned TGT_RLIMIT_NPROC = 7;
diff --git a/src/arch/x86/linux/linux.hh b/src/arch/x86/linux/linux.hh
index 391e418..17fafcc 100644
--- a/src/arch/x86/linux/linux.hh
+++ b/src/arch/x86/linux/linux.hh
@@ -96,7 +96,7 @@
{
public:
- typedef struct
+ struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -116,14 +116,14 @@
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
int64_t unused0[3];
- } tgt_stat64;
+ };
- typedef struct
+ struct tgt_fsid
{
long val[2];
- } tgt_fsid;
+ };
- typedef struct
+ struct tgt_statfs
{
long f_type;
long f_bsize;
@@ -136,7 +136,7 @@
long f_namelen;
long f_frsize;
long f_spare[5];
- } tgt_statfs;
+ };
static const int TGT_SIGHUP = 0x000001;
static const int TGT_SIGINT = 0x000002;
@@ -220,13 +220,13 @@
static const unsigned TGT_MAP_ANONYMOUS = 0x00020;
static const unsigned TGT_MAP_FIXED = 0x00010;
- typedef struct
+ struct tgt_iovec
{
uint64_t iov_base; // void *
uint64_t iov_len; // size_t
- } tgt_iovec;
+ };
- typedef struct
+ struct tgt_sysinfo
{
int64_t uptime; /* Seconds since boot */
uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -240,14 +240,14 @@
uint64_t totalhigh; /* Total high memory size */
uint64_t freehigh; /* Available high memory size */
uint64_t mem_unit; /* Memory unit size in bytes */
- } tgt_sysinfo;
+ };
};
class X86Linux32 : public X86Linux
{
public:
- typedef struct GEM5_PACKED
+ struct GEM5_PACKED tgt_stat64
{
uint64_t st_dev;
uint8_t __pad0[4];
@@ -268,7 +268,7 @@
uint32_t st_ctimeX;
uint32_t st_ctime_nsec;
uint64_t st_ino;
- } tgt_stat64;
+ };
static const int TGT_SIGHUP = 0x000001;
static const int TGT_SIGINT = 0x000002;
@@ -354,7 +354,7 @@
static const unsigned TGT_MAP_ANONYMOUS = 0x00020;
static const unsigned TGT_MAP_FIXED = 0x00010;
- typedef struct
+ struct tgt_sysinfo
{
int32_t uptime; /* Seconds since boot */
uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -368,7 +368,7 @@
uint32_t totalhigh; /* Total high memory size */
uint32_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
- } tgt_sysinfo;
+ };
};
#endif
diff --git a/src/dev/arm/gic_v3.hh b/src/dev/arm/gic_v3.hh
index 5e05034..586f29f 100644
--- a/src/dev/arm/gic_v3.hh
+++ b/src/dev/arm/gic_v3.hh
@@ -78,27 +78,27 @@
static const int PPI_MAX = 16;
// Interrupt states for PPIs, SGIs and SPIs, as per SPEC 4.1.2 section
- typedef enum
+ enum IntStatus
{
INT_INACTIVE,
INT_PENDING,
INT_ACTIVE,
INT_ACTIVE_PENDING,
- } IntStatus;
+ };
// Interrupt groups, as per SPEC section 4.6
- typedef enum
+ enum GroupId
{
G0S,
G1S,
G1NS,
- } GroupId;
+ };
- typedef enum
+ enum IntTriggerType
{
INT_LEVEL_SENSITIVE,
INT_EDGE_TRIGGERED,
- } IntTriggerType;
+ };
protected:
diff --git a/src/dev/arm/gic_v3_cpu_interface.hh
b/src/dev/arm/gic_v3_cpu_interface.hh
index 721be79..5771994 100644
--- a/src/dev/arm/gic_v3_cpu_interface.hh
+++ b/src/dev/arm/gic_v3_cpu_interface.hh
@@ -151,12 +151,12 @@
static const uint8_t GIC_MIN_VBPR = 7 - VIRTUAL_PREEMPTION_BITS;
- typedef struct
+ struct hppi_t
{
uint32_t intid;
uint8_t prio;
Gicv3::GroupId group;
- } hppi_t;
+ };
hppi_t hppi;
diff --git a/src/dev/hsa/hsa_packet.hh b/src/dev/hsa/hsa_packet.hh
index 036e061..eec38d7 100644
--- a/src/dev/hsa/hsa_packet.hh
+++ b/src/dev/hsa/hsa_packet.hh
@@ -38,7 +38,7 @@
#include <cstdint>
-typedef struct hsa_packet_header_s
+struct hsa_packet_header_bitfield_t
{
// TODO: replace with more portable impl based on offset, length
uint16_t type:8;
@@ -46,10 +46,10 @@
uint16_t acquire_fence_scope:2;
uint16_t release_fence_scope:2;
uint16_t reserved:3;
-} hsa_packet_header_bitfield_t;
+};
//TODO: put an _ in front of these guys to avoud prob with hsa.h for now
-typedef struct _hsa_dispatch_packet_s
+struct _hsa_dispatch_packet_t
{
uint16_t header;
uint16_t setup;
@@ -66,9 +66,9 @@
uint64_t kernarg_address;
uint64_t reserved1;
uint64_t completion_signal;
-} _hsa_dispatch_packet_t;
+};
-typedef struct _hsa_agent_dispatch_packet_s
+struct _hsa_agent_dispatch_packet_t
{
uint16_t header;
uint16_t type;
@@ -77,9 +77,9 @@
uint64_t arg[4];
uint64_t reserved2;
uint64_t completion_signal;
-} _hsa_agent_dispatch_packet_t;
+};
-typedef struct _hsa_barrier_and_packet_s
+struct _hsa_barrier_and_packet_t
{
uint16_t header;
uint16_t reserved0;
@@ -87,9 +87,9 @@
uint64_t dep_signal[5];
uint64_t reserved2;
uint64_t completion_signal;
-} _hsa_barrier_and_packet_t;
+};
-typedef struct _hsa_barrier_or_packet_s
+struct _hsa_barrier_or_packet_t
{
uint16_t header;
uint16_t reserved0;
@@ -97,6 +97,6 @@
uint64_t dep_signal[5];
uint64_t reserved2;
uint64_t completion_signal;
-} _hsa_barrier_or_packet_t;
+};
#endif // __DEV_HSA_HSA_PACKET_HH__
diff --git a/src/dev/hsa/hsa_packet_processor.hh
b/src/dev/hsa/hsa_packet_processor.hh
index fe71612..19ac17c 100644
--- a/src/dev/hsa/hsa_packet_processor.hh
+++ b/src/dev/hsa/hsa_packet_processor.hh
@@ -55,7 +55,7 @@
// Ideally, each queue should store this status and
// the processPkt() should make decisions based on that
// status variable.
-typedef enum
+enum Q_STATE
{
UNBLOCKED = 0, // Unblocked queue, can submit packets.
BLOCKED_BBIT, // Queue blocked by barrier bit.
@@ -64,7 +64,7 @@
BLOCKED_BPKT, // Queue blocked by barrier packet.
// Can submit packet packets after
// barrier packet completes.
-} Q_STATE;
+};
class GPUCommandProcessor;
class HWScheduler;
@@ -206,7 +206,7 @@
uint64_t compltnPending() { return (_dispIdx - _rdIdx); }
};
-typedef struct QueueContext
+struct QCntxt
{
HSAQueueDescriptor* qDesc;
AQLRingBuffer* aqlBuf;
@@ -217,7 +217,7 @@
: qDesc(q_desc), aqlBuf(aql_buf), barrierBit(false)
{}
QueueContext() : qDesc(NULL), aqlBuf(NULL), barrierBit(false) {}
-} QCntxt;
+};
class HSAPacketProcessor: public DmaDevice
{
diff --git a/src/dev/hsa/hsa_queue.hh b/src/dev/hsa/hsa_queue.hh
index 2c9c585..d7b047a 100644
--- a/src/dev/hsa/hsa_queue.hh
+++ b/src/dev/hsa/hsa_queue.hh
@@ -36,18 +36,18 @@
#include <cstdint>
-typedef enum
+enum _hsa_queue_type_t
{
_HSA_QUEUE_TYPE_MULTI = 0,
_HSA_QUEUE_TYPE_SINGLE = 1
-} _hsa_queue_type_t;
+};
-typedef struct _hsa_signal_s
+struct _hsa_signal_t
{
uint64_t handle;
-} _hsa_signal_t;
+};
-typedef struct _hsa_queue_s
+struct _hsa_queue_t
{
_hsa_queue_type_t type;
uint32_t features;
@@ -56,11 +56,11 @@
uint32_t size;
uint32_t reserved1;
uint64_t id;
-} _hsa_queue_t;
+};
typedef uint32_t _amd_queue_properties32_t;
-typedef struct _amd_queue_s
+struct _amd_queue_t
{
_hsa_queue_t hsa_queue;
uint32_t reserved1[4];
@@ -85,6 +85,6 @@
uint32_t reserved3[2];
_hsa_signal_t queue_inactive_signal;
uint32_t reserved4[14];
-} _amd_queue_t;
+};
#endif // __DEV_HSA_HSA_QUEUE_HH__
diff --git a/src/dev/storage/ide_disk.hh b/src/dev/storage/ide_disk.hh
index 4ece54e..327e125 100644
--- a/src/dev/storage/ide_disk.hh
+++ b/src/dev/storage/ide_disk.hh
@@ -66,12 +66,12 @@
#define PRD_COUNT_MASK 0xfffe
#define PRD_EOT_MASK 0x8000
-typedef struct PrdEntry
+struct PrdEntry_t
{
uint32_t baseAddr;
uint16_t byteCount;
uint16_t endOfTable;
-} PrdEntry_t;
+};
class PrdTableEntry
{
@@ -123,7 +123,7 @@
#define DEV0 (0)
#define DEV1 (1)
-typedef struct CommandReg
+struct CommandReg_t
{
uint16_t data;
uint8_t error;
@@ -137,9 +137,9 @@
uint8_t head;
};
uint8_t command;
-} CommandReg_t;
+};
-typedef enum Events
+enum Events_t
{
None = 0,
Transfer,
@@ -148,9 +148,9 @@
PrdRead,
DmaRead,
DmaWrite
-} Events_t;
+};
-typedef enum DevAction
+enum DevAction_t
{
ACT_NONE = 0,
ACT_CMD_WRITE,
@@ -167,9 +167,9 @@
ACT_DMA_DONE,
ACT_SRST_SET,
ACT_SRST_CLEAR
-} DevAction_t;
+};
-typedef enum DevState
+enum DevState_t
{
// Device idle
Device_Idle_S = 0,
@@ -196,14 +196,14 @@
Prepare_Data_Dma,
Transfer_Data_Dma,
Device_Dma_Abort
-} DevState_t;
+};
-typedef enum DmaState
+enum DmaState_t
{
Dma_Idle = 0,
Dma_Start,
Dma_Transfer
-} DmaState_t;
+};
class IdeController;
diff --git a/src/kern/linux/linux.hh b/src/kern/linux/linux.hh
index ef5f72a..68dff50 100644
--- a/src/kern/linux/linux.hh
+++ b/src/kern/linux/linux.hh
@@ -61,7 +61,7 @@
/// Stat buffer. Note that we can't call it 'stat' since that
/// gets #defined to something else on some systems. This type
/// can be specialized by architecture specific "Linux" classes
- typedef struct
+ struct tgt_stat
{
uint32_t st_dev; //!< device
uint32_t st_ino; //!< inode
@@ -79,10 +79,10 @@
int32_t st_blocks; //!< number of blocks allocated
uint32_t st_flags; //!< flags
uint32_t st_gen; //!< unknown
- } tgt_stat;
+ };
// same for stat64
- typedef struct
+ struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -104,7 +104,7 @@
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
int64_t ___unused[3];
- } tgt_stat64;
+ };
/// Length of strings in struct utsname (plus 1 for null char).
static const int _SYS_NMLN = 65;
diff --git a/src/kern/operatingsystem.hh b/src/kern/operatingsystem.hh
index 084eceb..1d7330e 100644
--- a/src/kern/operatingsystem.hh
+++ b/src/kern/operatingsystem.hh
@@ -58,39 +58,39 @@
static const int _SYS_NMLN = 65;
/// Interface struct for uname().
- typedef struct
+ struct utsname
{
char sysname[_SYS_NMLN]; //!< System name.
char nodename[_SYS_NMLN]; //!< Node name.
char release[_SYS_NMLN]; //!< OS release.
char version[_SYS_NMLN]; //!< OS version.
char machine[_SYS_NMLN]; //!< Machine type.
- } utsname;
+ };
/// Limit struct for getrlimit/setrlimit.
- typedef struct
+ struct rlimit
{
uint64_t rlim_cur; //!< soft limit
uint64_t rlim_max; //!< hard limit
- } rlimit;
+ };
/// For gettimeofday().
- typedef struct
+ struct timeval
{
int64_t tv_sec; //!< seconds
int64_t tv_usec; //!< microseconds
- } timeval;
+ };
// For writev/readv
- typedef struct
+ struct tgt_iovec
{
uint64_t iov_base; // void *
uint64_t iov_len;
- } tgt_iovec;
+ };
/// For getrusage().
- typedef struct
+ struct rusage
{
timeval ru_utime; //!< user time used
timeval ru_stime; //!< system time used
@@ -108,7 +108,7 @@
int64_t ru_nsignals; //!< signals received
int64_t ru_nvcsw; //!< voluntary context switches
int64_t ru_nivcsw; //!< involuntary "
- } rusage;
+ };
static int openSpecialFile(std::string path, Process *process,
ThreadContext *tc);
diff --git a/src/kern/solaris/solaris.hh b/src/kern/solaris/solaris.hh
index b891a7d..683c49c 100644
--- a/src/kern/solaris/solaris.hh
+++ b/src/kern/solaris/solaris.hh
@@ -64,7 +64,7 @@
/// Stat buffer. Note that we can't call it 'stat' since that
/// gets #defined to something else on some systems.
- typedef struct
+ struct tgt_stat
{
uint64_t st_dev; //!< device
uint64_t st_ino; //!< inode
@@ -81,10 +81,10 @@
int32_t st_blksize; //!< optimal I/O block size
int64_t st_blocks; //!< number of blocks allocated
char st_fstype[16];
- } tgt_stat;
+ };
// same for stat64
- typedef struct
+ struct tgt_stat64
{
uint64_t st_dev; //!< device
uint64_t st_ino; //!< inode
@@ -101,20 +101,20 @@
int32_t st_blksize; //!< optimal I/O block size
int64_t st_blocks; //!< number of blocks allocated
char st_fstype[16];
- } tgt_stat64;
+ };
/// Length of strings in struct utsname (plus 1 for null char).
static const int _SYS_NMLN = 257;
/// Interface struct for uname().
- typedef struct utsname
+ struct utsname
{
char sysname[_SYS_NMLN]; //!< System name.
char nodename[_SYS_NMLN]; //!< Node name.
char release[_SYS_NMLN]; //!< OS release.
char version[_SYS_NMLN]; //!< OS version.
char machine[_SYS_NMLN]; //!< Machine type.
- } utsname;
+ };
// for *at syscalls
static const int TGT_AT_FDCWD = -100;
diff --git a/src/mem/cache/compressors/base_delta.hh
b/src/mem/cache/compressors/base_delta.hh
index e323c55..acb1b3b 100644
--- a/src/mem/cache/compressors/base_delta.hh
+++ b/src/mem/cache/compressors/base_delta.hh
@@ -82,10 +82,10 @@
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
- typedef enum
+ enum PatternNumber
{
X, M, NUM_PATTERNS
- } PatternNumber;
+ };
uint64_t getNumPatterns() const override { return NUM_PATTERNS; }
diff --git a/src/mem/cache/compressors/cpack.hh
b/src/mem/cache/compressors/cpack.hh
index 6382d4d..1abac74 100644
--- a/src/mem/cache/compressors/cpack.hh
+++ b/src/mem/cache/compressors/cpack.hh
@@ -66,10 +66,10 @@
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
- typedef enum
+ enum PatternNumber
{
ZZZZ, XXXX, MMMM, MMXX, ZZZX, MMMX, NUM_PATTERNS
- } PatternNumber;
+ };
/**
* Convenience factory declaration. The templates must be organized by
diff --git a/src/mem/cache/compressors/fpc.hh
b/src/mem/cache/compressors/fpc.hh
index 6f26f29..9768897 100644
--- a/src/mem/cache/compressors/fpc.hh
+++ b/src/mem/cache/compressors/fpc.hh
@@ -77,13 +77,13 @@
* The possible patterns. If a new pattern is added, it must be done
* before NUM_PATTERNS.
*/
- typedef enum
+ enum PatternNumber
{
ZERO_RUN, SIGN_EXTENDED_4_BITS, SIGN_EXTENDED_1_BYTE,
SIGN_EXTENDED_HALFWORD, ZERO_PADDED_HALFWORD,
SIGN_EXTENDED_TWO_HALFWORDS, REP_BYTES, UNCOMPRESSED,
NUM_PATTERNS
- } PatternNumber;
+ };
/**
* Number of bits of the zero run size bitfield. If the size of the
diff --git a/src/mem/cache/compressors/fpcd.hh
b/src/mem/cache/compressors/fpcd.hh
index a21619d..6210704 100644
--- a/src/mem/cache/compressors/fpcd.hh
+++ b/src/mem/cache/compressors/fpcd.hh
@@ -94,12 +94,12 @@
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
- typedef enum
+ enum PatternNumber
{
ZZZZ, FFFF, MMMMPenultimate, MMMMPrevious, ZZZX, XZZZ, RRRR,
MMMXPenultimate, MMMXPrevious, ZZXX, ZXZX, FFXX, XXZZ,
MMXXPenultimate, MMXXPrevious, XXXX, NUM_PATTERNS
- } PatternNumber;
+ };
/**
* Convenience factory declaration. The templates must be organized by
diff --git a/src/mem/cache/compressors/repeated_qwords.hh
b/src/mem/cache/compressors/repeated_qwords.hh
index b0f33ad..13cbbe5 100644
--- a/src/mem/cache/compressors/repeated_qwords.hh
+++ b/src/mem/cache/compressors/repeated_qwords.hh
@@ -62,10 +62,10 @@
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
- typedef enum
+ enum PatternNumber
{
X, M, NUM_PATTERNS
- } PatternNumber;
+ };
/**
* Convenience factory declaration. The templates must be organized by
diff --git a/src/mem/cache/compressors/zero.hh
b/src/mem/cache/compressors/zero.hh
index 255518c..a19debd 100644
--- a/src/mem/cache/compressors/zero.hh
+++ b/src/mem/cache/compressors/zero.hh
@@ -62,10 +62,10 @@
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
- typedef enum
+ enum PatternNumber
{
X, Z, NUM_PATTERNS
- } PatternNumber;
+ };
/**
* Convenience factory declaration. The templates must be organized by
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/46199
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I37cc0d63b2777466dc6cc51eb5a3201de2e2cf43
Gerrit-Change-Number: 46199
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s