From d58b4f004ee9598540303d9908cd29a26fbeaed4 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 28 May 2021 21:03:47 -0700 Subject: [PATCH] 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46199 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- src/arch/arm/freebsd/freebsd.hh | 16 +++++----- src/arch/arm/linux/linux.hh | 24 +++++++-------- src/arch/mips/linux/linux.hh | 4 +-- src/arch/power/linux/linux.hh | 8 ++--- src/arch/riscv/linux/linux.hh | 32 ++++++++++---------- src/arch/riscv/pmp.hh | 5 +-- src/arch/sparc/linux/linux.hh | 12 ++++---- src/arch/x86/linux/linux.hh | 28 ++++++++--------- src/dev/arm/gic_v3.hh | 12 ++++---- src/dev/arm/gic_v3_cpu_interface.hh | 4 +-- src/dev/hsa/hsa_packet.hh | 20 ++++++------ src/dev/hsa/hsa_packet_processor.hh | 15 +++++---- src/dev/hsa/hsa_queue.hh | 16 +++++----- src/dev/storage/ide_disk.hh | 24 +++++++-------- src/kern/linux/linux.hh | 8 ++--- src/kern/operatingsystem.hh | 20 ++++++------ src/kern/solaris/solaris.hh | 12 ++++---- src/mem/cache/compressors/base_delta.hh | 4 +-- src/mem/cache/compressors/cpack.hh | 4 +-- src/mem/cache/compressors/fpc.hh | 4 +-- src/mem/cache/compressors/fpcd.hh | 4 +-- src/mem/cache/compressors/repeated_qwords.hh | 4 +-- src/mem/cache/compressors/zero.hh | 4 +-- 23 files changed, 142 insertions(+), 142 deletions(-) diff --git a/src/arch/arm/freebsd/freebsd.hh b/src/arch/arm/freebsd/freebsd.hh index f47fb4ec57..cc2ffb8277 100644 --- a/src/arch/arm/freebsd/freebsd.hh +++ b/src/arch/arm/freebsd/freebsd.hh @@ -126,7 +126,7 @@ class ArmFreebsd32 : public ArmFreebsd * sizeof st_lspare 4 */ - typedef struct + struct tgt_stat { uint32_t st_dev; uint32_t st_ino; @@ -149,9 +149,9 @@ class ArmFreebsd32 : public ArmFreebsd 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; @@ -174,7 +174,7 @@ class ArmFreebsd32 : public ArmFreebsd uint32_t st_lspare; uint64_t st_birthtimX; uint64_t st_birthtim; - } tgt_stat64; + }; /// For getrusage(). struct rusage @@ -296,7 +296,7 @@ class ArmFreebsd64 : public ArmFreebsd uint64_t iov_len; }; - typedef struct + struct tgt_stat { uint32_t st_dev; uint32_t st_ino; @@ -319,9 +319,9 @@ class ArmFreebsd64 : public ArmFreebsd 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; @@ -344,7 +344,7 @@ class ArmFreebsd64 : public ArmFreebsd 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 15faede10c..e795165ece 100644 --- a/src/arch/arm/linux/linux.hh +++ b/src/arch/arm/linux/linux.hh @@ -193,7 +193,7 @@ class ArmLinux32 : public ArmLinux }; - typedef struct + struct tgt_stat { uint32_t st_dev; uint32_t st_ino; @@ -213,9 +213,9 @@ class ArmLinux32 : public ArmLinux 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]; @@ -236,9 +236,9 @@ class ArmLinux32 : public ArmLinux 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 */ @@ -252,7 +252,7 @@ class ArmLinux32 : public ArmLinux 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 @@ -457,7 +457,7 @@ class ArmLinux64 : public ArmLinux uint64_t iov_len; }; - typedef struct + struct tgt_stat { uint64_t st_dev; uint64_t st_ino; @@ -476,9 +476,9 @@ class ArmLinux64 : public ArmLinux 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; @@ -497,9 +497,9 @@ class ArmLinux64 : public ArmLinux 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 */ @@ -514,7 +514,7 @@ class ArmLinux64 : public ArmLinux 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 180f0a8cf7..86d49a319d 100644 --- a/src/arch/mips/linux/linux.hh +++ b/src/arch/mips/linux/linux.hh @@ -179,7 +179,7 @@ class MipsLinux : public Linux /// 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 */ @@ -193,7 +193,7 @@ class MipsLinux : public Linux 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 646d64271a..effdf150b9 100644 --- a/src/arch/power/linux/linux.hh +++ b/src/arch/power/linux/linux.hh @@ -52,7 +52,7 @@ class PowerLinux : public Linux typedef int32_t time_t; - typedef struct + struct tgt_stat { uint64_t st_dev; uint32_t __pad1; @@ -74,9 +74,9 @@ class PowerLinux : public Linux 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; @@ -98,7 +98,7 @@ class PowerLinux : public Linux 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 0e38df3d6c..30d6dcc6a8 100644 --- a/src/arch/riscv/linux/linux.hh +++ b/src/arch/riscv/linux/linux.hh @@ -138,7 +138,7 @@ class RiscvLinux64 : public RiscvLinux int64_t tv_nsec; }; - typedef struct + struct tgt_stat64 { dev_t st_dev; ino_t st_ino; @@ -158,14 +158,14 @@ class RiscvLinux64 : public RiscvLinux 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; @@ -179,9 +179,9 @@ class RiscvLinux64 : public RiscvLinux 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]; @@ -196,7 +196,7 @@ class RiscvLinux64 : public RiscvLinux uint64_t totalhigh; uint64_t freehigh; uint32_t mem_unit; - } tgt_sysinfo; + }; static void archClone(uint64_t flags, @@ -309,12 +309,12 @@ class RiscvLinux32 : public RiscvLinux 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; @@ -336,9 +336,9 @@ class RiscvLinux32 : public RiscvLinux 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; @@ -352,9 +352,9 @@ class RiscvLinux32 : public RiscvLinux 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]; @@ -369,7 +369,7 @@ class RiscvLinux32 : public RiscvLinux 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 33d4976fbd..637c48c0ce 100644 --- a/src/arch/riscv/pmp.hh +++ b/src/arch/riscv/pmp.hh @@ -68,12 +68,13 @@ class PMP : public SimObject * 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 134a8e52be..3a709850ea 100644 --- a/src/arch/sparc/linux/linux.hh +++ b/src/arch/sparc/linux/linux.hh @@ -169,7 +169,7 @@ class SparcLinux : public Linux 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 */ @@ -183,7 +183,7 @@ class SparcLinux : public Linux 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. @@ -247,7 +247,7 @@ class Sparc32Linux : public SparcLinux { public: - typedef struct + struct tgt_stat64 { uint64_t st_dev; uint64_t st_ino; @@ -269,9 +269,9 @@ class Sparc32Linux : public SparcLinux 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 */ @@ -285,7 +285,7 @@ class Sparc32Linux : public SparcLinux 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 9d1563a883..29422a3180 100644 --- a/src/arch/x86/linux/linux.hh +++ b/src/arch/x86/linux/linux.hh @@ -99,7 +99,7 @@ class X86Linux64 : public X86Linux { public: - typedef struct + struct tgt_stat64 { uint64_t st_dev; uint64_t st_ino; @@ -119,14 +119,14 @@ class X86Linux64 : public X86Linux 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; @@ -139,7 +139,7 @@ class X86Linux64 : public X86Linux long f_namelen; long f_frsize; long f_spare[5]; - } tgt_statfs; + }; static const int TGT_SIGHUP = 0x000001; static const int TGT_SIGINT = 0x000002; @@ -223,13 +223,13 @@ class X86Linux64 : public X86Linux 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 */ @@ -243,14 +243,14 @@ class X86Linux64 : public X86Linux 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]; @@ -271,7 +271,7 @@ class X86Linux32 : public X86Linux 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; @@ -357,7 +357,7 @@ class X86Linux32 : public X86Linux 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 */ @@ -371,7 +371,7 @@ class X86Linux32 : public X86Linux 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; + }; }; } // namespace gem5 diff --git a/src/dev/arm/gic_v3.hh b/src/dev/arm/gic_v3.hh index ab8543c1d6..f4aaea5d51 100644 --- a/src/dev/arm/gic_v3.hh +++ b/src/dev/arm/gic_v3.hh @@ -81,27 +81,27 @@ class Gicv3 : public BaseGic 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 09db7b5a94..9f60d84d20 100644 --- a/src/dev/arm/gic_v3_cpu_interface.hh +++ b/src/dev/arm/gic_v3_cpu_interface.hh @@ -154,12 +154,12 @@ class Gicv3CPUInterface : public ArmISA::BaseISADevice, public Serializable 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 31e7636cc5..d4874c3d13 100644 --- a/src/dev/hsa/hsa_packet.hh +++ b/src/dev/hsa/hsa_packet.hh @@ -41,7 +41,7 @@ namespace gem5 { -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; @@ -49,10 +49,10 @@ typedef struct hsa_packet_header_s 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; @@ -69,9 +69,9 @@ typedef struct _hsa_dispatch_packet_s 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; @@ -80,9 +80,9 @@ typedef struct _hsa_agent_dispatch_packet_s 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; @@ -90,9 +90,9 @@ typedef struct _hsa_barrier_and_packet_s 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; @@ -100,7 +100,7 @@ typedef struct _hsa_barrier_or_packet_s uint64_t dep_signal[5]; uint64_t reserved2; uint64_t completion_signal; -} _hsa_barrier_or_packet_t; +}; } // namespace gem5 diff --git a/src/dev/hsa/hsa_packet_processor.hh b/src/dev/hsa/hsa_packet_processor.hh index 0d7ae048b5..83e5525bcb 100644 --- a/src/dev/hsa/hsa_packet_processor.hh +++ b/src/dev/hsa/hsa_packet_processor.hh @@ -58,7 +58,7 @@ namespace gem5 // 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. @@ -67,7 +67,7 @@ typedef enum BLOCKED_BPKT, // Queue blocked by barrier packet. // Can submit packet packets after // barrier packet completes. -} Q_STATE; +}; class GPUCommandProcessor; class HWScheduler; @@ -209,18 +209,17 @@ class AQLRingBuffer uint64_t compltnPending() { return (_dispIdx - _rdIdx); } }; -typedef struct QueueContext +struct QCntxt { HSAQueueDescriptor* qDesc; AQLRingBuffer* aqlBuf; // used for HSA packets that enforce synchronization with barrier bit bool barrierBit; - QueueContext(HSAQueueDescriptor* q_desc, - AQLRingBuffer* aql_buf) - : qDesc(q_desc), aqlBuf(aql_buf), barrierBit(false) + QCntxt(HSAQueueDescriptor* q_desc, AQLRingBuffer* aql_buf) : + qDesc(q_desc), aqlBuf(aql_buf), barrierBit(false) {} - QueueContext() : qDesc(NULL), aqlBuf(NULL), barrierBit(false) {} -} QCntxt; + QCntxt() : qDesc(NULL), aqlBuf(NULL), barrierBit(false) {} +}; class HSAPacketProcessor: public DmaDevice { diff --git a/src/dev/hsa/hsa_queue.hh b/src/dev/hsa/hsa_queue.hh index 19a678c7fc..4aa1c3b850 100644 --- a/src/dev/hsa/hsa_queue.hh +++ b/src/dev/hsa/hsa_queue.hh @@ -39,18 +39,18 @@ namespace gem5 { -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; @@ -59,11 +59,11 @@ typedef struct _hsa_queue_s 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]; @@ -88,7 +88,7 @@ typedef struct _amd_queue_s uint32_t reserved3[2]; _hsa_signal_t queue_inactive_signal; uint32_t reserved4[14]; -} _amd_queue_t; +}; } // namespace gem5 diff --git a/src/dev/storage/ide_disk.hh b/src/dev/storage/ide_disk.hh index bfe9f9b2f8..95eec24ac8 100644 --- a/src/dev/storage/ide_disk.hh +++ b/src/dev/storage/ide_disk.hh @@ -69,12 +69,12 @@ class ChunkGenerator; #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 { @@ -126,7 +126,7 @@ class PrdTableEntry #define DEV0 (0) #define DEV1 (1) -typedef struct CommandReg +struct CommandReg_t { uint16_t data; uint8_t error; @@ -140,9 +140,9 @@ typedef struct CommandReg uint8_t head; }; uint8_t command; -} CommandReg_t; +}; -typedef enum Events +enum Events_t { None = 0, Transfer, @@ -151,9 +151,9 @@ typedef enum Events PrdRead, DmaRead, DmaWrite -} Events_t; +}; -typedef enum DevAction +enum DevAction_t { ACT_NONE = 0, ACT_CMD_WRITE, @@ -170,9 +170,9 @@ typedef enum DevAction ACT_DMA_DONE, ACT_SRST_SET, ACT_SRST_CLEAR -} DevAction_t; +}; -typedef enum DevState +enum DevState_t { // Device idle Device_Idle_S = 0, @@ -199,14 +199,14 @@ typedef enum DevState 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 7e1df58c15..6232f619cc 100644 --- a/src/kern/linux/linux.hh +++ b/src/kern/linux/linux.hh @@ -64,7 +64,7 @@ class Linux : public OperatingSystem /// 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 @@ -82,10 +82,10 @@ class Linux : public OperatingSystem 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; @@ -107,7 +107,7 @@ class Linux : public OperatingSystem 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 014397e26f..fbbad1f8e4 100644 --- a/src/kern/operatingsystem.hh +++ b/src/kern/operatingsystem.hh @@ -61,39 +61,39 @@ class OperatingSystem 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 @@ -111,7 +111,7 @@ class OperatingSystem 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 6944bc566e..0e6b72aed4 100644 --- a/src/kern/solaris/solaris.hh +++ b/src/kern/solaris/solaris.hh @@ -67,7 +67,7 @@ class Solaris : public OperatingSystem /// 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 @@ -84,10 +84,10 @@ class Solaris : public OperatingSystem 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 @@ -104,20 +104,20 @@ class Solaris : public OperatingSystem 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 93539dad7b..81f2c4b546 100644 --- a/src/mem/cache/compressors/base_delta.hh +++ b/src/mem/cache/compressors/base_delta.hh @@ -85,10 +85,10 @@ class BaseDelta : public DictionaryCompressor * 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 ecfcb25f4e..51f5ce17bc 100644 --- a/src/mem/cache/compressors/cpack.hh +++ b/src/mem/cache/compressors/cpack.hh @@ -69,10 +69,10 @@ class CPack : public DictionaryCompressor * 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 bfe50898c1..9dd40fbd2a 100644 --- a/src/mem/cache/compressors/fpc.hh +++ b/src/mem/cache/compressors/fpc.hh @@ -80,13 +80,13 @@ class FPC : public DictionaryCompressor * 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 b424befd12..d1ee015957 100644 --- a/src/mem/cache/compressors/fpcd.hh +++ b/src/mem/cache/compressors/fpcd.hh @@ -97,12 +97,12 @@ class FPCD : public DictionaryCompressor * 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 5f2ec30eed..3e900a1655 100644 --- a/src/mem/cache/compressors/repeated_qwords.hh +++ b/src/mem/cache/compressors/repeated_qwords.hh @@ -65,10 +65,10 @@ class RepeatedQwords : public DictionaryCompressor * 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 d6996eae3c..6e8ce34b2a 100644 --- a/src/mem/cache/compressors/zero.hh +++ b/src/mem/cache/compressors/zero.hh @@ -65,10 +65,10 @@ class Zero : public DictionaryCompressor * 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