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>
This commit is contained in:
Gabe Black
2019-10-29 15:31:04 -07:00
parent 7adc90a297
commit 607df7e656
9 changed files with 29 additions and 4 deletions

View File

@@ -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;

View File

@@ -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:

View File

@@ -51,6 +51,8 @@
class ArmLinux : public Linux
{
public:
static const ByteOrder byteOrder = LittleEndianByteOrder;
static void
archClone(uint64_t flags,
Process *pp, Process *cp,

View File

@@ -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;

View File

@@ -42,6 +42,8 @@ class PowerLinux : public Linux
{
public:
static const ByteOrder byteOrder = BigEndianByteOrder;
typedef int32_t time_t;
typedef struct {

View File

@@ -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;

View File

@@ -38,6 +38,8 @@ class SparcLinux : public Linux
{
public:
static const ByteOrder byteOrder = BigEndianByteOrder;
typedef struct {
uint32_t st_dev;
char __pad1[4];

View File

@@ -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

View File

@@ -46,6 +46,8 @@
class X86Linux : public Linux
{
public:
static const ByteOrder byteOrder = LittleEndianByteOrder;
static void
archClone(uint64_t flags,
Process *pp, Process *cp,