clean up class vs. struct
This commit is contained in:
@ -224,23 +224,28 @@ struct vm_info {
|
||||
uint64_t ptbase;
|
||||
};
|
||||
|
||||
struct trap_load_access_fault : public trap_access {
|
||||
class trap_load_access_fault : public trap_access {
|
||||
public:
|
||||
trap_load_access_fault(uint64_t badaddr)
|
||||
: trap_access(5 << 16, badaddr) {}
|
||||
};
|
||||
struct illegal_instruction_fault : public trap_access {
|
||||
class illegal_instruction_fault : public trap_access {
|
||||
public:
|
||||
illegal_instruction_fault(uint64_t badaddr)
|
||||
: trap_access(2 << 16, badaddr) {}
|
||||
};
|
||||
struct trap_instruction_page_fault : public trap_access {
|
||||
class trap_instruction_page_fault : public trap_access {
|
||||
public:
|
||||
trap_instruction_page_fault(uint64_t badaddr)
|
||||
: trap_access(12 << 16, badaddr) {}
|
||||
};
|
||||
struct trap_load_page_fault : public trap_access {
|
||||
class trap_load_page_fault : public trap_access {
|
||||
public:
|
||||
trap_load_page_fault(uint64_t badaddr)
|
||||
: trap_access(13 << 16, badaddr) {}
|
||||
};
|
||||
struct trap_store_page_fault : public trap_access {
|
||||
class trap_store_page_fault : public trap_access {
|
||||
public:
|
||||
trap_store_page_fault(uint64_t badaddr)
|
||||
: trap_access(15 << 16, badaddr) {}
|
||||
};
|
||||
@ -262,7 +267,8 @@ public:
|
||||
template<class T, class Enable = void> struct hart_state { };
|
||||
// specialization 32bit
|
||||
template <typename T>
|
||||
struct hart_state<T, typename std::enable_if<std::is_same<T, uint32_t>::value>::type> {
|
||||
class hart_state<T, typename std::enable_if<std::is_same<T, uint32_t>::value>::type> {
|
||||
public:
|
||||
BEGIN_BF_DECL(mstatus_t, T);
|
||||
// SD bit is read-only and is set when either the FS or XS bits encode a Dirty state (i.e., SD=((FS==11) OR XS==11)))
|
||||
BF_FIELD(SD, 31, 1);
|
||||
@ -328,7 +334,8 @@ public:
|
||||
};
|
||||
// specialization 64bit
|
||||
template <typename T>
|
||||
struct hart_state<T, typename std::enable_if<std::is_same<T, uint64_t>::value>::type> {
|
||||
class hart_state<T, typename std::enable_if<std::is_same<T, uint64_t>::value>::type> {
|
||||
public:
|
||||
BEGIN_BF_DECL(mstatus_t, T);
|
||||
// SD bit is read-only and is set when either the FS or XS bits encode a Dirty state (i.e., SD=((FS==11) OR XS==11)))
|
||||
BF_FIELD(SD, 63, 1);
|
||||
|
@ -43,10 +43,10 @@
|
||||
namespace iss {
|
||||
namespace arch {
|
||||
|
||||
struct rv32imac;
|
||||
|
||||
template <> struct traits<rv32imac> {
|
||||
class rv32imac;
|
||||
|
||||
template <> class traits<rv32imac> {
|
||||
public:
|
||||
enum constants {
|
||||
XLEN = 32,
|
||||
XLEN2 = 64,
|
||||
@ -132,8 +132,8 @@ template <> struct traits<rv32imac> {
|
||||
enum mem_type_e { MEM, CSR, FENCE, RES };
|
||||
};
|
||||
|
||||
struct rv32imac : public arch_if {
|
||||
|
||||
class rv32imac : public arch_if {
|
||||
public:
|
||||
using virt_addr_t = typename traits<rv32imac>::virt_addr_t;
|
||||
using phys_addr_t = typename traits<rv32imac>::phys_addr_t;
|
||||
using reg_t = typename traits<rv32imac>::reg_t;
|
||||
|
@ -43,10 +43,10 @@
|
||||
namespace iss {
|
||||
namespace arch {
|
||||
|
||||
struct rv64ia;
|
||||
|
||||
template <> struct traits<rv64ia> {
|
||||
class rv64ia;
|
||||
|
||||
template <> class traits<rv64ia> {
|
||||
public:
|
||||
enum constants {
|
||||
XLEN = 64,
|
||||
XLEN2 = 128,
|
||||
@ -131,8 +131,8 @@ template <> struct traits<rv64ia> {
|
||||
enum mem_type_e { MEM, CSR, FENCE, RES };
|
||||
};
|
||||
|
||||
struct rv64ia : public arch_if {
|
||||
|
||||
class rv64ia : public arch_if {
|
||||
public:
|
||||
using virt_addr_t = typename traits<rv64ia>::virt_addr_t;
|
||||
using phys_addr_t = typename traits<rv64ia>::phys_addr_t;
|
||||
using reg_t = typename traits<rv64ia>::reg_t;
|
||||
|
@ -21,8 +21,8 @@ namespace debugger {
|
||||
using namespace iss::arch;
|
||||
using namespace iss::debugger;
|
||||
|
||||
template <typename ARCH> struct riscv_target_adapter : public target_adapter_base {
|
||||
|
||||
template <typename ARCH> class riscv_target_adapter : public target_adapter_base {
|
||||
public:
|
||||
riscv_target_adapter(server_if *srv, iss::arch_if *core)
|
||||
: target_adapter_base(srv)
|
||||
, core(core) {}
|
||||
|
@ -52,7 +52,8 @@ using namespace iss::arch;
|
||||
using namespace llvm;
|
||||
using namespace iss::debugger;
|
||||
|
||||
template <typename ARCH> struct vm_impl : public vm::vm_base<ARCH> {
|
||||
template <typename ARCH> class vm_impl : public vm::vm_base<ARCH> {
|
||||
public:
|
||||
using super = typename vm::vm_base<ARCH>;
|
||||
using virt_addr_t = typename super::virt_addr_t;
|
||||
using phys_addr_t = typename super::phys_addr_t;
|
||||
|
@ -52,7 +52,8 @@ using namespace iss::arch;
|
||||
using namespace llvm;
|
||||
using namespace iss::debugger;
|
||||
|
||||
template <typename ARCH> struct vm_impl : public vm::vm_base<ARCH> {
|
||||
template <typename ARCH> class vm_impl : public vm::vm_base<ARCH> {
|
||||
public:
|
||||
using super = typename vm::vm_base<ARCH>;
|
||||
using virt_addr_t = typename super::virt_addr_t;
|
||||
using phys_addr_t = typename super::phys_addr_t;
|
||||
|
@ -52,7 +52,8 @@ using namespace iss::arch;
|
||||
using namespace llvm;
|
||||
using namespace iss::debugger;
|
||||
|
||||
template <typename ARCH> struct vm_impl : public vm::vm_base<ARCH> {
|
||||
template <typename ARCH> class vm_impl : public vm::vm_base<ARCH> {
|
||||
public:
|
||||
using super = typename vm::vm_base<ARCH>;
|
||||
using virt_addr_t = typename super::virt_addr_t;
|
||||
using phys_addr_t = typename super::phys_addr_t;
|
||||
|
Reference in New Issue
Block a user