syscall_emul: rename OpenFlagTransTable struct

The structure definition only had the open system call flag set in mind when
it was named, so we rename it here with the intention of using it to define
additional tables to translate flags for other system calls in the future.
This commit is contained in:
Brandon Potter 2016-03-17 10:22:39 -07:00
parent 75d6910607
commit b8688346a5
19 changed files with 27 additions and 27 deletions

View file

@ -33,7 +33,7 @@
#include "arch/alpha/linux/linux.hh"
// open(2) flags translation table
OpenFlagTransTable AlphaLinux::openFlagTable[] = {
SyscallFlagTransTable AlphaLinux::openFlagTable[] = {
#ifdef _MSC_VER
{ AlphaLinux::TGT_O_RDONLY, _O_RDONLY },
{ AlphaLinux::TGT_O_WRONLY, _O_WRONLY },

View file

@ -43,7 +43,7 @@ class AlphaLinux : public Linux
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
/// Number of entries in openFlagTable[].
static const int NUM_OPEN_FLAGS;

View file

@ -31,7 +31,7 @@
#include "arch/alpha/tru64/tru64.hh"
// open(2) flags translation table
OpenFlagTransTable AlphaTru64::openFlagTable[] = {
SyscallFlagTransTable AlphaTru64::openFlagTable[] = {
#ifdef _MSC_VER
{ AlphaTru64::TGT_O_RDONLY, _O_RDONLY },
{ AlphaTru64::TGT_O_WRONLY, _O_WRONLY },

View file

@ -38,7 +38,7 @@ class AlphaTru64 : public Tru64
public:
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
/// Number of entries in openFlagTable[].
static const int NUM_OPEN_FLAGS;

View file

@ -35,7 +35,7 @@
#include <fcntl.h>
// open(2) flags translation table
OpenFlagTransTable ArmFreebsd32::openFlagTable[] = {
SyscallFlagTransTable ArmFreebsd32::openFlagTable[] = {
{ ArmFreebsd32::TGT_O_RDONLY, O_RDONLY },
{ ArmFreebsd32::TGT_O_WRONLY, O_WRONLY },
{ ArmFreebsd32::TGT_O_RDWR, O_RDWR },
@ -58,7 +58,7 @@ const int ArmFreebsd32::NUM_OPEN_FLAGS = sizeof(ArmFreebsd32::openFlagTable) /
sizeof(ArmFreebsd32::openFlagTable[0]);
// open(2) flags translation table
OpenFlagTransTable ArmFreebsd64::openFlagTable[] = {
SyscallFlagTransTable ArmFreebsd64::openFlagTable[] = {
{ ArmFreebsd64::TGT_O_RDONLY, O_RDONLY },
{ ArmFreebsd64::TGT_O_WRONLY, O_WRONLY },
{ ArmFreebsd64::TGT_O_RDWR, O_RDWR },

View file

@ -41,7 +41,7 @@ class ArmFreebsd32 : public FreeBSD
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
/// Number of entries in openFlagTable[].
static const int NUM_OPEN_FLAGS;
@ -196,7 +196,7 @@ class ArmFreebsd64 : public FreeBSD
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
/// Number of entries in openFlagTable[].
static const int NUM_OPEN_FLAGS;

View file

@ -46,7 +46,7 @@
#include "arch/arm/linux/linux.hh"
// open(2) flags translation table
OpenFlagTransTable ArmLinux32::openFlagTable[] = {
SyscallFlagTransTable ArmLinux32::openFlagTable[] = {
#ifdef _MSC_VER
{ ArmLinux32::TGT_O_RDONLY, _O_RDONLY },
{ ArmLinux32::TGT_O_WRONLY, _O_WRONLY },
@ -99,7 +99,7 @@ const int ArmLinux32::NUM_OPEN_FLAGS = sizeof(ArmLinux32::openFlagTable) /
sizeof(ArmLinux32::openFlagTable[0]);
// open(2) flags translation table
OpenFlagTransTable ArmLinux64::openFlagTable[] = {
SyscallFlagTransTable ArmLinux64::openFlagTable[] = {
#ifdef _MSC_VER
{ ArmLinux64::TGT_O_RDONLY, _O_RDONLY },
{ ArmLinux64::TGT_O_WRONLY, _O_WRONLY },

View file

@ -53,7 +53,7 @@ class ArmLinux32 : public Linux
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
/// Number of entries in openFlagTable[].
static const int NUM_OPEN_FLAGS;
@ -213,7 +213,7 @@ class ArmLinux64 : public Linux
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
/// Number of entries in openFlagTable[].
static const int NUM_OPEN_FLAGS;

View file

@ -33,7 +33,7 @@
#include "arch/mips/linux/linux.hh"
// open(2) flags translation table
OpenFlagTransTable MipsLinux::openFlagTable[] = {
SyscallFlagTransTable MipsLinux::openFlagTable[] = {
#ifdef _MSC_VER
{ MipsLinux::TGT_O_RDONLY, _O_RDONLY },
{ MipsLinux::TGT_O_WRONLY, _O_WRONLY },

View file

@ -39,7 +39,7 @@ class MipsLinux : public Linux
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
/// Number of entries in openFlagTable[].
static const int NUM_OPEN_FLAGS;

View file

@ -34,7 +34,7 @@
#include "arch/power/linux/linux.hh"
// open(2) flags translation table
OpenFlagTransTable PowerLinux::openFlagTable[] = {
SyscallFlagTransTable PowerLinux::openFlagTable[] = {
#ifdef _MSC_VER
{ PowerLinux::TGT_O_RDONLY, _O_RDONLY },
{ PowerLinux::TGT_O_WRONLY, _O_WRONLY },

View file

@ -100,7 +100,7 @@ class PowerLinux : public Linux
/// This table maps the target open() flags to the corresponding
/// host open() flags.
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
/// Number of entries in openFlagTable[].
static const int NUM_OPEN_FLAGS;

View file

@ -33,7 +33,7 @@
#include "arch/sparc/linux/linux.hh"
// open(2) flags translation table
OpenFlagTransTable SparcLinux::openFlagTable[] = {
SyscallFlagTransTable SparcLinux::openFlagTable[] = {
#ifdef _MSC_VER
{ SparcLinux::TGT_O_RDONLY, _O_RDONLY },
{ SparcLinux::TGT_O_WRONLY, _O_WRONLY },

View file

@ -56,7 +56,7 @@ class SparcLinux : public Linux
uint64_t __unused4[2];
} tgt_stat;
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
static const int TGT_O_RDONLY = 0x00000000; //!< O_RDONLY
static const int TGT_O_WRONLY = 0x00000001; //!< O_WRONLY

View file

@ -33,7 +33,7 @@
#include "arch/sparc/solaris/solaris.hh"
// open(2) flags translation table
OpenFlagTransTable SparcSolaris::openFlagTable[] = {
SyscallFlagTransTable SparcSolaris::openFlagTable[] = {
#ifdef _MSC_VER
{ SparcSolaris::TGT_O_RDONLY, _O_RDONLY },
{ SparcSolaris::TGT_O_WRONLY, _O_WRONLY },

View file

@ -37,7 +37,7 @@ class SparcSolaris : public Solaris
{
public:
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
static const int TGT_O_RDONLY = 0x00000000; //!< O_RDONLY
static const int TGT_O_WRONLY = 0x00000001; //!< O_WRONLY

View file

@ -42,7 +42,7 @@
#include "arch/x86/linux/linux.hh"
// open(2) flags translation table
OpenFlagTransTable X86Linux64::openFlagTable[] = {
SyscallFlagTransTable X86Linux64::openFlagTable[] = {
#ifdef _MSC_VER
{ TGT_O_RDONLY, _O_RDONLY },
{ TGT_O_WRONLY, _O_WRONLY },
@ -81,7 +81,7 @@ const int X86Linux64::NUM_OPEN_FLAGS =
sizeof(X86Linux64::openFlagTable[0]);
// open(2) flags translation table
OpenFlagTransTable X86Linux32::openFlagTable[] = {
SyscallFlagTransTable X86Linux32::openFlagTable[] = {
#ifdef _MSC_VER
{ TGT_O_RDONLY, _O_RDONLY },
{ TGT_O_WRONLY, _O_WRONLY },

View file

@ -67,7 +67,7 @@ class X86Linux64 : public Linux
int64_t unused0[3];
} tgt_stat64;
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
static const int TGT_O_RDONLY = 00000000; //!< O_RDONLY
static const int TGT_O_WRONLY = 00000001; //!< O_WRONLY
@ -140,7 +140,7 @@ class X86Linux32 : public Linux
uint64_t st_ino;
} __attribute__((__packed__)) tgt_stat64;
static OpenFlagTransTable openFlagTable[];
static SyscallFlagTransTable openFlagTable[];
static const int TGT_O_RDONLY = 00000000; //!< O_RDONLY
static const int TGT_O_WRONLY = 00000001; //!< O_WRONLY

View file

@ -38,9 +38,9 @@
class LiveProcess;
class ThreadContext;
/// This struct is used to build an target-OS-dependent table that
/// maps the target's open() flags to the host open() flags.
struct OpenFlagTransTable {
/// This struct is used to build target-OS-dependent tables that
/// map the target's flags to the host's flags.
struct SyscallFlagTransTable {
int tgtFlag; //!< Target system flag value.
int hostFlag; //!< Corresponding host system flag value.
};