summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-10-29 15:31:04 -0700
committerGabe Black <gabeblack@google.com>2019-10-30 22:29:23 +0000
commit607df7e656304f0a2a4ca811acd758ee21b9642e (patch)
tree915761c56cb7d6888e05157a94bd627365483c4f /src/arch
parent7adc90a2970dfdc54560305ddca46c90ce519016 (diff)
downloadgem5-607df7e656304f0a2a4ca811acd758ee21b9642e.tar.xz
arch: Make endianness a property of the OS class syscalls can consume.
That way the syscall implementations won't have to find the right endianness to use on their own, typically by referring to TheISA. Change-Id: I186b2f419d5dbee72cc9b5abce7356f3143f0c83 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22363 Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/alpha/linux/linux.hh2
-rw-r--r--src/arch/arm/freebsd/freebsd.hh9
-rw-r--r--src/arch/arm/linux/linux.hh2
-rw-r--r--src/arch/mips/linux/linux.hh2
-rw-r--r--src/arch/power/linux/linux.hh2
-rw-r--r--src/arch/riscv/linux/linux.hh10
-rw-r--r--src/arch/sparc/linux/linux.hh2
-rw-r--r--src/arch/sparc/solaris/solaris.hh2
-rw-r--r--src/arch/x86/linux/linux.hh2
9 files changed, 29 insertions, 4 deletions
diff --git a/src/arch/alpha/linux/linux.hh b/src/arch/alpha/linux/linux.hh
index 3fd65679d..01d3e282f 100644
--- a/src/arch/alpha/linux/linux.hh
+++ b/src/arch/alpha/linux/linux.hh
@@ -42,6 +42,8 @@ class AlphaLinux : public Linux
{
public:
+ static const ByteOrder byteOrder = LittleEndianByteOrder;
+
static const int TGT_SIGHUP = 0x000001;
static const int TGT_SIGINT = 0x000002;
static const int TGT_SIGQUIT = 0x000003;
diff --git a/src/arch/arm/freebsd/freebsd.hh b/src/arch/arm/freebsd/freebsd.hh
index e2c5e493c..b1360473e 100644
--- a/src/arch/arm/freebsd/freebsd.hh
+++ b/src/arch/arm/freebsd/freebsd.hh
@@ -35,10 +35,15 @@
#include "kern/freebsd/freebsd.hh"
-class ArmFreebsd32 : public FreeBSD
+class ArmFreebsd : public FreeBSD
{
public:
+ static const ByteOrder byteOrder = LittleEndianByteOrder;
+};
+class ArmFreebsd32 : public ArmFreebsd
+{
+ public:
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static SyscallFlagTransTable openFlagTable[];
@@ -192,7 +197,7 @@ class ArmFreebsd32 : public FreeBSD
};
};
-class ArmFreebsd64 : public FreeBSD
+class ArmFreebsd64 : public ArmFreebsd
{
public:
diff --git a/src/arch/arm/linux/linux.hh b/src/arch/arm/linux/linux.hh
index cff1e47fd..1ae88df4a 100644
--- a/src/arch/arm/linux/linux.hh
+++ b/src/arch/arm/linux/linux.hh
@@ -51,6 +51,8 @@
class ArmLinux : public Linux
{
public:
+ static const ByteOrder byteOrder = LittleEndianByteOrder;
+
static void
archClone(uint64_t flags,
Process *pp, Process *cp,
diff --git a/src/arch/mips/linux/linux.hh b/src/arch/mips/linux/linux.hh
index 38e6abcd1..84ab55363 100644
--- a/src/arch/mips/linux/linux.hh
+++ b/src/arch/mips/linux/linux.hh
@@ -37,6 +37,8 @@ class MipsLinux : public Linux
{
public:
+ static const ByteOrder byteOrder = LittleEndianByteOrder;
+
static const int TGT_SIGHUP = 0x000001;
static const int TGT_SIGINT = 0x000002;
static const int TGT_SIGQUIT = 0x000003;
diff --git a/src/arch/power/linux/linux.hh b/src/arch/power/linux/linux.hh
index de149a1a6..a57c2ab97 100644
--- a/src/arch/power/linux/linux.hh
+++ b/src/arch/power/linux/linux.hh
@@ -42,6 +42,8 @@ class PowerLinux : public Linux
{
public:
+ static const ByteOrder byteOrder = BigEndianByteOrder;
+
typedef int32_t time_t;
typedef struct {
diff --git a/src/arch/riscv/linux/linux.hh b/src/arch/riscv/linux/linux.hh
index 441550a50..c3adaeeef 100644
--- a/src/arch/riscv/linux/linux.hh
+++ b/src/arch/riscv/linux/linux.hh
@@ -34,7 +34,13 @@
#include "arch/riscv/utility.hh"
#include "kern/linux/linux.hh"
-class RiscvLinux64 : public Linux
+class RiscvLinux : public Linux
+{
+ public:
+ static const ByteOrder byteOrder = LittleEndianByteOrder;
+};
+
+class RiscvLinux64 : public RiscvLinux
{
public:
static const int TGT_SIGHUP = 1;
@@ -203,7 +209,7 @@ class RiscvLinux64 : public Linux
}
};
-class RiscvLinux32 : public Linux
+class RiscvLinux32 : public RiscvLinux
{
public:
static const int TGT_SIGHUP = 1;
diff --git a/src/arch/sparc/linux/linux.hh b/src/arch/sparc/linux/linux.hh
index 1de949d10..1dba4fa1f 100644
--- a/src/arch/sparc/linux/linux.hh
+++ b/src/arch/sparc/linux/linux.hh
@@ -38,6 +38,8 @@ class SparcLinux : public Linux
{
public:
+ static const ByteOrder byteOrder = BigEndianByteOrder;
+
typedef struct {
uint32_t st_dev;
char __pad1[4];
diff --git a/src/arch/sparc/solaris/solaris.hh b/src/arch/sparc/solaris/solaris.hh
index 1e814bc53..459cedb8d 100644
--- a/src/arch/sparc/solaris/solaris.hh
+++ b/src/arch/sparc/solaris/solaris.hh
@@ -37,6 +37,8 @@ class SparcSolaris : public Solaris
{
public:
+ static const ByteOrder byteOrder = BigEndianByteOrder;
+
static SyscallFlagTransTable openFlagTable[];
static const int TGT_O_RDONLY = 0x00000000; //!< O_RDONLY
diff --git a/src/arch/x86/linux/linux.hh b/src/arch/x86/linux/linux.hh
index 91498043c..2192e5064 100644
--- a/src/arch/x86/linux/linux.hh
+++ b/src/arch/x86/linux/linux.hh
@@ -46,6 +46,8 @@
class X86Linux : public Linux
{
public:
+ static const ByteOrder byteOrder = LittleEndianByteOrder;
+
static void
archClone(uint64_t flags,
Process *pp, Process *cp,