misc: Fix coding style for struct's opening braces

The systemc dir was not included in this fix.

First it was identified that there were only occurrences
at 0, 1, 2 and 3 levels of indentation (and a single
occurrence of 2 and 3 spaces), using:

    grep -nrE --exclude-dir=systemc \
        "^ *struct [A-Za-z].* {$" src/

Then the following commands were run to replace:

<indent level>struct X ... {

by:

<indent level>struct X ...
<indent level>{

Level 0:
    grep -nrl --exclude-dir=systemc
        "^struct [A-Za-z].* {$" src/ | \
        xargs sed -Ei \
        's/^struct ([A-Za-z].*) \{$/struct \1\n\{/g'

Level 1:
    grep -nrl --exclude-dir=systemc \
        "^    struct [A-Za-z].* {$" src/ | \
        xargs sed -Ei \
        's/^    struct ([A-Za-z].*) \{$/    struct \1\n    \{/g'

and so on.

Change-Id: I362ef58c86912dabdd272c7debb8d25d587cd455
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39017
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2021-01-09 12:28:03 -03:00
committed by Daniel Carvalho
parent f96de41fcf
commit 2922f763e1
109 changed files with 584 additions and 292 deletions

View File

@@ -86,19 +86,22 @@ class ArmFreebsd32 : public ArmFreebsd
static const unsigned TGT_MAP_FIXED = 0x0010;
/// Limit struct for getrlimit/setrlimit.
struct rlimit {
struct rlimit
{
uint32_t rlim_cur; //!< soft limit
uint32_t rlim_max; //!< hard limit
};
/// For gettimeofday().
struct timeval {
struct timeval
{
int32_t tv_sec; //!< seconds
int32_t tv_usec; //!< microseconds
};
// For writev/readv
struct tgt_iovec {
struct tgt_iovec
{
uint32_t iov_base; // void *
uint32_t iov_len;
};
@@ -170,7 +173,8 @@ class ArmFreebsd32 : public ArmFreebsd
} tgt_stat64;
/// For getrusage().
struct rusage {
struct rusage
{
struct timeval ru_utime; //!< user time used
struct timeval ru_stime; //!< system time used
int32_t ru_maxrss; //!< max rss
@@ -190,7 +194,8 @@ class ArmFreebsd32 : public ArmFreebsd
};
/// For times().
struct tms {
struct tms
{
int32_t tms_utime; //!< user time
int32_t tms_stime; //!< system time
int32_t tms_cutime; //!< user time of children
@@ -269,19 +274,22 @@ class ArmFreebsd64 : public ArmFreebsd
};
/// Limit struct for getrlimit/setrlimit.
struct rlimit {
struct rlimit
{
uint64_t rlim_cur; //!< soft limit
uint64_t rlim_max; //!< hard limit
};
/// For gettimeofday().
struct timeval {
struct timeval
{
int64_t tv_sec; //!< seconds
int64_t tv_usec; //!< microseconds
};
// For writev/readv
struct tgt_iovec {
struct tgt_iovec
{
uint64_t iov_base; // void *
uint64_t iov_len;
};
@@ -335,7 +343,8 @@ class ArmFreebsd64 : public ArmFreebsd
} tgt_stat64;
/// For getrusage().
struct rusage {
struct rusage
{
struct timeval ru_utime; //!< user time used
struct timeval ru_stime; //!< system time used
int64_t ru_maxrss; //!< max rss
@@ -355,7 +364,8 @@ class ArmFreebsd64 : public ArmFreebsd
};
/// For times().
struct tms {
struct tms
{
int64_t tms_utime; //!< user time
int64_t tms_stime; //!< system time
int64_t tms_cutime; //!< user time of children

View File

@@ -47,7 +47,8 @@ namespace ArmISA
typedef uint64_t XReg;
/// 128-bit NEON vector register.
struct VReg {
struct VReg
{
XReg hi;
XReg lo;
};

View File

@@ -112,7 +112,8 @@ namespace ArmISA
SelfDebug * selfDebug;
/** MiscReg metadata **/
struct MiscRegLUTEntry {
struct MiscRegLUTEntry
{
uint32_t lower; // Lower half mapped to this register
uint32_t upper; // Upper half mapped to this register
uint64_t _reset; // value taken on reset (i.e. initialization)

View File

@@ -67,7 +67,8 @@ class ArmKvmCPU : public BaseKvmCPU
void dump();
protected:
struct KvmIntRegInfo {
struct KvmIntRegInfo
{
/** KVM ID */
const uint64_t id;
/** gem5 index */
@@ -76,7 +77,8 @@ class ArmKvmCPU : public BaseKvmCPU
const char *name;
};
struct KvmCoreMiscRegInfo {
struct KvmCoreMiscRegInfo
{
/** KVM ID */
const uint64_t id;
/** gem5 index */

View File

@@ -92,7 +92,8 @@ class ArmV8KvmCPU : public BaseArmKvmCPU
protected:
/** Mapping between integer registers in gem5 and KVM */
struct IntRegInfo {
struct IntRegInfo
{
IntRegInfo(uint64_t _kvm, ArmISA::IntRegIndex _idx, const char *_name)
: kvm(_kvm), idx(_idx), name(_name) {}
@@ -105,7 +106,8 @@ class ArmV8KvmCPU : public BaseArmKvmCPU
};
/** Mapping between misc registers in gem5 and registers in KVM */
struct MiscRegInfo {
struct MiscRegInfo
{
MiscRegInfo(uint64_t _kvm, ArmISA::MiscRegIndex _idx,
const char *_name, bool _is_device = false)
: kvm(_kvm), idx(_idx), name(_name), is_device(_is_device) {}

View File

@@ -195,23 +195,27 @@ class AtagNone : public AtagHeader
#define ATAG_CMDLINE 0x54410009
// structures for each atag
struct atag_header {
struct atag_header
{
u32 size; // length of tag in words including this header
u32 tag; // tag type
};
struct atag_core {
struct atag_core
{
u32 flags;
u32 pagesize;
u32 rootdev;
};
struct atag_mem {
struct atag_mem
{
u32 size;
u32 start;
};
struct atag_videotext {
struct atag_videotext
{
u8 x;
u8 y;
u16 video_page;
@@ -223,27 +227,32 @@ struct atag_videotext {
u16 video_points;
};
struct atag_ramdisk {
struct atag_ramdisk
{
u32 flags;
u32 size;
u32 start;
};
struct atag_initrd2 {
struct atag_initrd2
{
u32 start;
u32 size;
};
struct atag_serialnr {
struct atag_serialnr
{
u32 low;
u32 high;
};
struct atag_revision {
struct atag_revision
{
u32 rev;
};
struct atag_videolfb {
struct atag_videolfb
{
u16 lfb_width;
u16 lfb_height;
u16 lfb_depth;
@@ -260,11 +269,13 @@ struct atag_videolfb {
u8 rsvd_pos;
};
struct atag_cmdline {
struct atag_cmdline
{
char cmdline[1];
};
struct atag {
struct atag
{
struct atag_header hdr;
union {
struct atag_core core;

View File

@@ -166,24 +166,28 @@ class ArmLinux32 : public ArmLinux
static const int TBL_SYSINFO = 12;
/// Limit struct for getrlimit/setrlimit.
struct rlimit {
struct rlimit
{
uint32_t rlim_cur; //!< soft limit
uint32_t rlim_max; //!< hard limit
};
/// For gettimeofday().
struct timeval {
struct timeval
{
int32_t tv_sec; //!< seconds
int32_t tv_usec; //!< microseconds
};
struct timespec {
struct timespec
{
int32_t tv_sec; //!< seconds
int32_t tv_nsec; //!< nanoseconds
};
// For writev/readv
struct tgt_iovec {
struct tgt_iovec
{
uint32_t iov_base; // void *
uint32_t iov_len;
};
@@ -248,7 +252,8 @@ class ArmLinux32 : public ArmLinux
} tgt_sysinfo;
/// For getrusage().
struct rusage {
struct rusage
{
struct timeval ru_utime; //!< user time used
struct timeval ru_stime; //!< system time used
int32_t ru_maxrss; //!< max rss
@@ -268,7 +273,8 @@ class ArmLinux32 : public ArmLinux
};
/// For times().
struct tms {
struct tms
{
int32_t tms_utime; //!< user time
int32_t tms_stime; //!< system time
int32_t tms_cutime; //!< user time of children
@@ -426,24 +432,28 @@ class ArmLinux64 : public ArmLinux
};
/// Limit struct for getrlimit/setrlimit.
struct rlimit {
struct rlimit
{
uint64_t rlim_cur; //!< soft limit
uint64_t rlim_max; //!< hard limit
};
/// For gettimeofday().
struct timeval {
struct timeval
{
int64_t tv_sec; //!< seconds
int64_t tv_usec; //!< microseconds
};
struct timespec {
struct timespec
{
int64_t tv_sec; //!< seconds
int64_t tv_nsec; //!< nanoseconds
};
// For writev/readv
struct tgt_iovec {
struct tgt_iovec
{
uint64_t iov_base; // void *
uint64_t iov_len;
};
@@ -505,7 +515,8 @@ class ArmLinux64 : public ArmLinux
} tgt_sysinfo;
/// For getrusage().
struct rusage {
struct rusage
{
struct timeval ru_utime; //!< user time used
struct timeval ru_stime; //!< system time used
int64_t ru_maxrss; //!< max rss
@@ -525,7 +536,8 @@ class ArmLinux64 : public ArmLinux
};
/// For times().
struct tms {
struct tms
{
int64_t tms_utime; //!< user time
int64_t tms_stime; //!< system time
int64_t tms_cutime; //!< user time of children

View File

@@ -70,7 +70,8 @@ class ArmNativeTrace : public NativeTrace
};
protected:
struct ThreadState {
struct ThreadState
{
bool changed[STATE_NUMVALS];
uint64_t state[2][STATE_NUMVALS];
uint64_t *newState;

View File

@@ -290,7 +290,8 @@ class PMU : public SimObject, public ArmISA::BaseISADevice
/**
* Event definition base class
*/
struct PMUEvent {
struct PMUEvent
{
PMUEvent() {}
@@ -341,7 +342,8 @@ class PMU : public SimObject, public ArmISA::BaseISADevice
std::set<PMU::CounterState*> userCounters;
};
struct RegularEvent : public PMUEvent {
struct RegularEvent : public PMUEvent
{
typedef std::pair<SimObject*, std::string> EventTypeEntry;
void addMicroarchitectureProbe(SimObject* object,
@@ -407,7 +409,8 @@ class PMU : public SimObject, public ArmISA::BaseISADevice
PMUEvent* getEvent(uint64_t eventId);
/** State of a counter within the PMU. **/
struct CounterState : public Serializable {
struct CounterState : public Serializable
{
CounterState(PMU &pmuReference, uint64_t counter_id)
: eventId(0), filter(0), enabled(false),
overflow64(false), sourceEvent(nullptr),

View File

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

View File

@@ -1011,7 +1011,8 @@ TableWalker::processWalkAArch64()
// (grain_size + N*stride), for N = {1, 2, 3}.
// A value of 64 will never succeed and a value of 0 will always succeed.
if (start_lookup_level == MAX_LOOKUP_LEVELS) {
struct GrainMap {
struct GrainMap
{
GrainSize grain_size;
unsigned lookup_level_cutoff[MAX_LOOKUP_LEVELS];
};

View File

@@ -894,7 +894,8 @@ class TableWalker : public ClockedObject
bool _haveLargeAsid64;
/** Statistics */
struct TableWalkerStats : public Stats::Group {
struct TableWalkerStats : public Stats::Group
{
TableWalkerStats(Stats::Group *parent);
Stats::Scalar walks;
Stats::Scalar walksShortDescriptor;

View File

@@ -1351,7 +1351,8 @@ namespace Gcn3ISA
GPUStaticInst* decode_invalid(MachInst);
};
struct InFmt_DS {
struct InFmt_DS
{
unsigned int OFFSET0 : 8;
unsigned int OFFSET1 : 8;
unsigned int GDS : 1;
@@ -1360,14 +1361,16 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_DS_1 {
struct InFmt_DS_1
{
unsigned int ADDR : 8;
unsigned int DATA0 : 8;
unsigned int DATA1 : 8;
unsigned int VDST : 8;
};
struct InFmt_EXP {
struct InFmt_EXP
{
unsigned int EN : 4;
unsigned int TGT : 6;
unsigned int COMPR : 1;
@@ -1377,14 +1380,16 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_EXP_1 {
struct InFmt_EXP_1
{
unsigned int VSRC0 : 8;
unsigned int VSRC1 : 8;
unsigned int VSRC2 : 8;
unsigned int VSRC3 : 8;
};
struct InFmt_FLAT {
struct InFmt_FLAT
{
unsigned int pad_0_15 : 16;
unsigned int GLC : 1;
unsigned int SLC : 1;
@@ -1393,7 +1398,8 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_FLAT_1 {
struct InFmt_FLAT_1
{
unsigned int ADDR : 8;
unsigned int DATA : 8;
unsigned int pad_16_22 : 7;
@@ -1401,11 +1407,13 @@ namespace Gcn3ISA
unsigned int VDST : 8;
};
struct InFmt_INST {
struct InFmt_INST
{
unsigned int ENCODING : 32;
};
struct InFmt_MIMG {
struct InFmt_MIMG
{
unsigned int pad_0_7 : 8;
unsigned int DMASK : 4;
unsigned int UNORM : 1;
@@ -1419,7 +1427,8 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_MIMG_1 {
struct InFmt_MIMG_1
{
unsigned int VADDR : 8;
unsigned int VDATA : 8;
unsigned int SRSRC : 5;
@@ -1428,7 +1437,8 @@ namespace Gcn3ISA
unsigned int D16 : 1;
};
struct InFmt_MTBUF {
struct InFmt_MTBUF
{
unsigned int OFFSET : 12;
unsigned int OFFEN : 1;
unsigned int IDXEN : 1;
@@ -1439,7 +1449,8 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_MTBUF_1 {
struct InFmt_MTBUF_1
{
unsigned int VADDR : 8;
unsigned int VDATA : 8;
unsigned int SRSRC : 5;
@@ -1449,7 +1460,8 @@ namespace Gcn3ISA
unsigned int SOFFSET : 8;
};
struct InFmt_MUBUF {
struct InFmt_MUBUF
{
unsigned int OFFSET : 12;
unsigned int OFFEN : 1;
unsigned int IDXEN : 1;
@@ -1462,7 +1474,8 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_MUBUF_1 {
struct InFmt_MUBUF_1
{
unsigned int VADDR : 8;
unsigned int VDATA : 8;
unsigned int SRSRC : 5;
@@ -1471,7 +1484,8 @@ namespace Gcn3ISA
unsigned int SOFFSET : 8;
};
struct InFmt_SMEM {
struct InFmt_SMEM
{
unsigned int SBASE : 6;
unsigned int SDATA : 7;
unsigned int pad_13_15 : 3;
@@ -1481,18 +1495,21 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_SMEM_1 {
struct InFmt_SMEM_1
{
unsigned int OFFSET : 20;
};
struct InFmt_SOP1 {
struct InFmt_SOP1
{
unsigned int SSRC0 : 8;
unsigned int OP : 8;
unsigned int SDST : 7;
unsigned int ENCODING : 9;
};
struct InFmt_SOP2 {
struct InFmt_SOP2
{
unsigned int SSRC0 : 8;
unsigned int SSRC1 : 8;
unsigned int SDST : 7;
@@ -1500,27 +1517,31 @@ namespace Gcn3ISA
unsigned int ENCODING : 2;
};
struct InFmt_SOPC {
struct InFmt_SOPC
{
unsigned int SSRC0 : 8;
unsigned int SSRC1 : 8;
unsigned int OP : 7;
unsigned int ENCODING : 9;
};
struct InFmt_SOPK {
struct InFmt_SOPK
{
unsigned int SIMM16 : 16;
unsigned int SDST : 7;
unsigned int OP : 5;
unsigned int ENCODING : 4;
};
struct InFmt_SOPP {
struct InFmt_SOPP
{
unsigned int SIMM16 : 16;
unsigned int OP : 7;
unsigned int ENCODING : 9;
};
struct InFmt_VINTRP {
struct InFmt_VINTRP
{
unsigned int VSRC : 8;
unsigned int ATTRCHAN : 2;
unsigned int ATTR : 6;
@@ -1529,14 +1550,16 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_VOP1 {
struct InFmt_VOP1
{
unsigned int SRC0 : 9;
unsigned int OP : 8;
unsigned int VDST : 8;
unsigned int ENCODING : 7;
};
struct InFmt_VOP2 {
struct InFmt_VOP2
{
unsigned int SRC0 : 9;
unsigned int VSRC1 : 8;
unsigned int VDST : 8;
@@ -1544,7 +1567,8 @@ namespace Gcn3ISA
unsigned int ENCODING : 1;
};
struct InFmt_VOP3 {
struct InFmt_VOP3
{
unsigned int VDST : 8;
unsigned int ABS : 3;
unsigned int pad_11_14 : 4;
@@ -1553,7 +1577,8 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_VOP3_1 {
struct InFmt_VOP3_1
{
unsigned int SRC0 : 9;
unsigned int SRC1 : 9;
unsigned int SRC2 : 9;
@@ -1561,7 +1586,8 @@ namespace Gcn3ISA
unsigned int NEG : 3;
};
struct InFmt_VOP3_SDST_ENC {
struct InFmt_VOP3_SDST_ENC
{
unsigned int VDST : 8;
unsigned int SDST : 7;
unsigned int CLAMP : 1;
@@ -1569,14 +1595,16 @@ namespace Gcn3ISA
unsigned int ENCODING : 6;
};
struct InFmt_VOPC {
struct InFmt_VOPC
{
unsigned int SRC0 : 9;
unsigned int VSRC1 : 8;
unsigned int OP : 8;
unsigned int ENCODING : 7;
};
struct InFmt_VOP_DPP {
struct InFmt_VOP_DPP
{
unsigned int SRC0 : 8;
unsigned int DPP_CTRL : 9;
unsigned int pad_17_18 : 2;
@@ -1589,7 +1617,8 @@ namespace Gcn3ISA
unsigned int ROW_MASK : 4;
};
struct InFmt_VOP_SDWA {
struct InFmt_VOP_SDWA
{
unsigned int SRC0 : 8;
unsigned int DST_SEL : 3;
unsigned int DST_UNUSED : 2;

View File

@@ -28,7 +28,8 @@
#include "arch/mips/linux/aligned.hh"
namespace Linux {
struct pcb_struct {
struct pcb_struct
{
uint64_ta rpb_ksp;
uint64_ta rpb_usp;
uint64_ta rpb_ptbr;

View File

@@ -32,7 +32,8 @@
#include "arch/mips/linux/hwrpb.hh"
namespace Linux {
struct thread_info {
struct thread_info
{
struct pcb_struct pcb;
Addr_a task;
};

View File

@@ -72,7 +72,8 @@ enum RoundMode{
RND_NEAREST
};
struct CoreSpecific {
struct CoreSpecific
{
CoreSpecific()
: CP0_IntCtl_IPTI(0), CP0_IntCtl_IPPCI(0), CP0_SrsCtl_HSS(0),
CP0_PRId_CompanyOptions(0), CP0_PRId_CompanyID(0),

View File

@@ -91,7 +91,8 @@ class PowerLinux : public Linux
} tgt_stat64;
/// For times().
struct tms {
struct tms
{
int32_t tms_utime; //!< user time
int32_t tms_stime; //!< system time
int32_t tms_cutime; //!< user time of children

View File

@@ -89,7 +89,8 @@ typedef GenericISA::SimplePCState<MachInst> PCState;
namespace std {
template<>
struct hash<PowerISA::ExtMachInst> : public hash<uint32_t> {
struct hash<PowerISA::ExtMachInst> : public hash<uint32_t>
{
size_t operator()(const PowerISA::ExtMachInst &emi) const {
return hash<uint32_t>::operator()((uint32_t)emi);
};

View File

@@ -132,7 +132,8 @@ class RiscvLinux64 : public RiscvLinux
typedef uint64_t blksize_t;
typedef uint64_t blkcnt_t;
struct timespec {
struct timespec
{
time_t tv_sec;
int64_t tv_nsec;
};
@@ -297,12 +298,14 @@ class RiscvLinux32 : public RiscvLinux
typedef int64_t time_t;
/// Limit struct for getrlimit/setrlimit.
struct rlimit {
struct rlimit
{
uint32_t rlim_cur; //!< soft limit
uint32_t rlim_max; //!< hard limit
};
struct timespec {
struct timespec
{
time_t tv_sec;
int32_t tv_nsec;
};

View File

@@ -51,7 +51,8 @@ BitUnion32(UserDescFlags)
Bitfield<6> useable;
EndBitUnion(UserDescFlags)
struct UserDesc32 {
struct UserDesc32
{
uint32_t entry_number;
uint32_t base_addr;
uint32_t limit;

View File

@@ -44,7 +44,8 @@ class X86NativeTrace : public NativeTrace
uint64_t oldRcxVal, oldR11Val;
uint64_t oldRealRcxVal, oldRealR11Val;
struct ThreadState {
struct ThreadState
{
uint64_t rax;
uint64_t rcx;
uint64_t rdx;

View File

@@ -279,7 +279,8 @@ X86_64Process::initState()
TSShigh TSSDescHigh = 0;
TSSDescHigh.base = bits(TSSVirtAddr, 63, 32);
struct TSSDesc {
struct TSSDesc
{
uint64_t low;
uint64_t high;
} tssDescVal = {TSSDescLow, TSSDescHigh};

View File

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

View File

@@ -101,7 +101,8 @@ namespace X86ISA
AddrRange m5opRange;
struct TlbStats : public Stats::Group {
struct TlbStats : public Stats::Group
{
TlbStats(Stats::Group *parent);
Stats::Scalar rdAccesses;