summaryrefslogtreecommitdiff
path: root/src/arch/power
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/power')
-rw-r--r--src/arch/power/linux/linux.cc99
1 files changed, 2 insertions, 97 deletions
diff --git a/src/arch/power/linux/linux.cc b/src/arch/power/linux/linux.cc
index 6382ca72a..d569ec279 100644
--- a/src/arch/power/linux/linux.cc
+++ b/src/arch/power/linux/linux.cc
@@ -34,100 +34,5 @@
#include <fcntl.h>
#include <sys/mman.h>
-// open(2) flags translation table
-SyscallFlagTransTable PowerLinux::openFlagTable[] = {
-#ifdef _MSC_VER
- { PowerLinux::TGT_O_RDONLY, _O_RDONLY },
- { PowerLinux::TGT_O_WRONLY, _O_WRONLY },
- { PowerLinux::TGT_O_RDWR, _O_RDWR },
- { PowerLinux::TGT_O_CREAT, _O_CREAT },
- { PowerLinux::TGT_O_EXCL, _O_EXCL },
-#ifdef _O_NOCTTY
- { PowerLinux::TGT_O_NOCTTY, _O_NOCTTY },
-#endif
- { PowerLinux::TGT_O_TRUNC, _O_TRUNC },
- { PowerLinux::TGT_O_APPEND, _O_APPEND },
-#ifdef _O_NONBLOCK
- { PowerLinux::TGT_O_NONBLOCK, _O_NONBLOCK },
-#endif
-#ifdef _O_DSYNC
- { PowerLinux::TGT_O_DSYNC, _O_DSYNC },
-#endif
- { PowerLinux::TGT_FASYNC, _O_ASYNC },
- { PowerLinux::TGT_O_DIRECT, _O_DIRECT },
-#ifdef _O_LARGEFILE
- { PowerLinux::TGT_O_LARGEFILE, _O_LARGEFILE },
-#endif
- { PowerLinux::TGT_O_DIRECTORY, _O_DIRECTORY },
- { PowerLinux::TGT_O_NOFOLLOW, _O_NOFOLLOW },
- { PowerLinux::TGT_O_NOATIME, _O_NOATIME },
-#ifdef _O_CLOEXEC
- { PowerLinux::TGT_O_CLOEXEC, _O_CLOEXEC },
-#endif
-#ifdef _O_SYNC
- { PowerLinux::TGT_O_SYNC, _O_SYNC },
-#endif
-#ifdef _O_PATH
- { PowerLinux::TGT_O_PATH, _O_PATH},
-#endif
-#else /* !_MSC_VER */
- { PowerLinux::TGT_O_RDONLY, O_RDONLY },
- { PowerLinux::TGT_O_WRONLY, O_WRONLY },
- { PowerLinux::TGT_O_RDWR, O_RDWR },
- { PowerLinux::TGT_O_CREAT, O_CREAT },
- { PowerLinux::TGT_O_EXCL, O_EXCL },
- { PowerLinux::TGT_O_NOCTTY, O_NOCTTY },
- { PowerLinux::TGT_O_TRUNC, O_TRUNC },
- { PowerLinux::TGT_O_APPEND, O_APPEND },
- { PowerLinux::TGT_O_NONBLOCK, O_NONBLOCK },
-#ifdef O_DSYNC
- { PowerLinux::TGT_O_DSYNC, O_DSYNC },
-#endif
- { PowerLinux::TGT_FASYNC, O_ASYNC },
- { PowerLinux::TGT_O_DIRECT, O_DIRECT },
-#ifdef O_LARGEFILE
- { PowerLinux::TGT_O_LARGEFILE, O_LARGEFILE },
-#endif
- { PowerLinux::TGT_O_DIRECTORY, O_DIRECTORY },
- { PowerLinux::TGT_O_NOFOLLOW, O_NOFOLLOW },
- { PowerLinux::TGT_O_NOATIME, O_NOATIME },
-#ifdef O_CLOEXEC
- { PowerLinux::TGT_O_CLOEXEC, O_CLOEXEC },
-#endif
-#ifdef O_SYNC
- { PowerLinux::TGT_O_SYNC, O_SYNC },
-#endif
-#ifdef O_PATH
- { PowerLinux::TGT_O_PATH, O_PATH},
-#endif
-#endif /* _MSC_VER */
-};
-
-const int PowerLinux::NUM_OPEN_FLAGS =
- (sizeof(PowerLinux::openFlagTable)/sizeof(PowerLinux::openFlagTable[0]));
-
-// mmap(2) flags translation table
-SyscallFlagTransTable PowerLinux::mmapFlagTable[] = {
- { PowerLinux::TGT_MAP_SHARED, MAP_SHARED },
- { PowerLinux::TGT_MAP_PRIVATE, MAP_PRIVATE },
- { PowerLinux::TGT_MAP_ANON, MAP_ANON },
- { PowerLinux::TGT_MAP_DENYWRITE, MAP_DENYWRITE },
- { PowerLinux::TGT_MAP_EXECUTABLE, MAP_EXECUTABLE },
- { PowerLinux::TGT_MAP_FILE, MAP_FILE },
- { PowerLinux::TGT_MAP_GROWSDOWN, MAP_GROWSDOWN },
- { PowerLinux::TGT_MAP_HUGETLB, MAP_HUGETLB },
- { PowerLinux::TGT_MAP_LOCKED, MAP_LOCKED },
- { PowerLinux::TGT_MAP_NONBLOCK, MAP_NONBLOCK },
- { PowerLinux::TGT_MAP_NORESERVE, MAP_NORESERVE },
- { PowerLinux::TGT_MAP_POPULATE, MAP_POPULATE },
-#ifdef MAP_STACK
- { PowerLinux::TGT_MAP_STACK, MAP_STACK },
-#endif
- { PowerLinux::TGT_MAP_ANONYMOUS, MAP_ANONYMOUS },
- { PowerLinux::TGT_MAP_FIXED, MAP_FIXED },
-};
-
-const unsigned PowerLinux::NUM_MMAP_FLAGS =
- sizeof(PowerLinux::mmapFlagTable) /
- sizeof(PowerLinux::mmapFlagTable[0]);
-
+#define TARGET PowerLinux
+#include "kern/linux/flag_tables.hh"